source: mainline/uspace/drv/block/usbmast/bo_trans.h@ d7f7a4a

Last change on this file since d7f7a4a was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2011 Vojtech Horky
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup drvusbmast
8 * @{
9 */
10/** @file
11 * USB mass storage bulk-only transport.
12 */
13
14#ifndef BO_TRANS_H_
15#define BO_TRANS_H_
16
17#include <scsi/spc.h>
18#include <stddef.h>
19#include <stdint.h>
20#include <usb/usb.h>
21#include <usb/dev/pipes.h>
22#include <usb/dev/driver.h>
23#include "usbmast.h"
24
25typedef enum cmd_status {
26 CMDS_GOOD,
27 CMDS_FAILED
28} cmd_status_t;
29
30/** SCSI command.
31 *
32 * Contains (a subset of) the input and output arguments of SCSI
33 * Execute Command procedure call (see SAM-4 chapter 5.1)
34 */
35typedef struct {
36 /*
37 * Related to IN fields
38 */
39
40 /** Command Descriptor Block */
41 const void *cdb;
42 /** CDB size in bytes */
43 size_t cdb_size;
44
45 /** Outgoing data */
46 const void *data_out;
47 /** Size of outgoing data in bytes */
48 size_t data_out_size;
49
50 /*
51 * Related to OUT fields
52 */
53
54 /** Buffer for incoming data */
55 void *data_in;
56 /** Size of input buffer in bytes */
57 size_t data_in_size;
58
59 /** Number of bytes actually received */
60 size_t rcvd_size;
61
62 /** Status */
63 cmd_status_t status;
64} scsi_cmd_t;
65
66extern errno_t usb_massstor_cmd(usbmast_fun_t *, uint32_t, scsi_cmd_t *);
67extern errno_t usb_massstor_reset(usbmast_dev_t *);
68extern void usb_massstor_reset_recovery(usbmast_dev_t *);
69extern int usb_massstor_get_max_lun(usbmast_dev_t *);
70extern size_t usb_masstor_get_lun_count(usbmast_dev_t *);
71
72#endif
73
74/**
75 * @}
76 */
Note: See TracBrowser for help on using the repository browser.