USB Host Shield 2.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Typedefs
masstorage.h File Reference
#include "Usb.h"
Include dependency graph for masstorage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Capacity
 
struct  BASICCDB
 
struct  CDB6
 
struct  CDB10
 
struct  CDB12
 
struct  CDB_LBA32_16
 
struct  CDB_LBA64_16
 
struct  InquiryResponse
 
struct  CommandBlockWrapperBase
 
struct  CommandBlockWrapper
 
struct  CommandStatusWrapper
 
struct  RequestSenseResponce
 
class  BulkOnly
 

Macros

#define MS_WANT_PARSER   0
 
#define bmREQ_MASSOUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define bmREQ_MASSIN   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define MASS_SUBCLASS_SCSI_NOT_REPORTED   0x00
 
#define MASS_SUBCLASS_RBC   0x01
 
#define MASS_SUBCLASS_ATAPI   0x02
 
#define MASS_SUBCLASS_OBSOLETE1   0x03
 
#define MASS_SUBCLASS_UFI   0x04
 
#define MASS_SUBCLASS_OBSOLETE2   0x05
 
#define MASS_SUBCLASS_SCSI   0x06
 
#define MASS_SUBCLASS_LSDFS   0x07
 
#define MASS_SUBCLASS_IEEE1667   0x08
 
#define MASS_PROTO_CBI   0x00
 
#define MASS_PROTO_CBI_NO_INT   0x01
 
#define MASS_PROTO_OBSOLETE   0x02
 
#define MASS_PROTO_BBB   0x50
 
#define MASS_PROTO_UAS   0x62
 
#define MASS_REQ_ADSC   0x00
 
#define MASS_REQ_GET   0xFC
 
#define MASS_REQ_PUT   0xFD
 
#define MASS_REQ_GET_MAX_LUN   0xFE
 
#define MASS_REQ_BOMSR   0xFF
 
#define MASS_CBW_SIGNATURE   0x43425355
 
#define MASS_CSW_SIGNATURE   0x53425355
 
#define MASS_CMD_DIR_OUT   0
 
#define MASS_CMD_DIR_IN   0x80
 
#define SCSI_CMD_TEST_UNIT_READY   0x00
 
#define SCSI_CMD_REQUEST_SENSE   0x03
 
#define SCSI_CMD_FORMAT_UNIT   0x04
 
#define SCSI_CMD_READ_6   0x08
 
#define SCSI_CMD_WRITE_6   0x0A
 
#define SCSI_CMD_INQUIRY   0x12
 
#define SCSI_CMD_MODE_SELECT_6   0x15
 
#define SCSI_CMD_MODE_SENSE_6   0x1A
 
#define SCSI_CMD_START_STOP_UNIT   0x1B
 
#define SCSI_CMD_PREVENT_REMOVAL   0x1E
 
#define SCSI_CMD_READ_FORMAT_CAPACITIES   0x23
 
#define SCSI_CMD_READ_CAPACITY_10   0x25
 
#define SCSI_CMD_READ_10   0x28
 
#define SCSI_CMD_WRITE_10   0x2A
 
#define SCSI_CMD_SEEK_10   0x2B
 
#define SCSI_CMD_ERASE_10   0x2C
 
#define SCSI_CMD_WRITE_AND_VERIFY_10   0x2E
 
#define SCSI_CMD_VERIFY_10   0x2F
 
#define SCSI_CMD_SYNCHRONIZE_CACHE   0x35
 
#define SCSI_CMD_WRITE_BUFFER   0x3B
 
#define SCSI_CMD_READ_BUFFER   0x3C
 
#define SCSI_CMD_READ_SUBCHANNEL   0x42
 
#define SCSI_CMD_READ_TOC   0x43
 
#define SCSI_CMD_READ_HEADER   0x44
 
#define SCSI_CMD_PLAY_AUDIO_10   0x45
 
#define SCSI_CMD_GET_CONFIGURATION   0x46
 
#define SCSI_CMD_PLAY_AUDIO_MSF   0x47
 
#define SCSI_CMD_PLAY_AUDIO_TI   0x48
 
#define SCSI_CMD_PLAY_TRACK_REL_10   0x49
 
#define SCSI_CMD_GET_EVENT_STATUS   0x4A
 
#define SCSI_CMD_PAUSE_RESUME   0x4B
 
#define SCSI_CMD_READ_DISC_INFORMATION   0x51
 
#define SCSI_CMD_READ_TRACK_INFORMATION   0x52
 
#define SCSI_CMD_RESERVE_TRACK   0x53
 
#define SCSI_CMD_SEND_OPC_INFORMATION   0x54
 
#define SCSI_CMD_MODE_SELECT_10   0x55
 
#define SCSI_CMD_REPAIR_TRACK   0x58
 
#define SCSI_CMD_MODE_SENSE_10   0x5A
 
#define SCSI_CMD_CLOSE_TRACK_SESSION   0x5B
 
#define SCSI_CMD_READ_BUFFER_CAPACITY   0x5C
 
#define SCSI_CMD_SEND_CUE_SHEET   0x5D
 
#define SCSI_CMD_REPORT_LUNS   0xA0
 
#define SCSI_CMD_BLANK   0xA1
 
#define SCSI_CMD_SECURITY_PROTOCOL_IN   0xA2
 
#define SCSI_CMD_SEND_KEY   0xA3
 
#define SCSI_CMD_REPORT_KEY   0xA4
 
#define SCSI_CMD_PLAY_AUDIO_12   0xA5
 
#define SCSI_CMD_LOAD_UNLOAD   0xA6
 
#define SCSI_CMD_SET_READ_AHEAD   0xA7
 
#define SCSI_CMD_READ_12   0xA8
 
#define SCSI_CMD_PLAY_TRACK_REL_12   0xA9
 
#define SCSI_CMD_WRITE_12   0xAA
 
#define SCSI_CMD_READ_MEDIA_SERIAL_12   0xAB
 
#define SCSI_CMD_GET_PERFORMANCE   0xAC
 
#define SCSI_CMD_READ_DVD_STRUCTURE   0xAD
 
#define SCSI_CMD_SECURITY_PROTOCOL_OUT   0xB5
 
#define SCSI_CMD_SET_STREAMING   0xB6
 
#define SCSI_CMD_READ_MSF   0xB9
 
#define SCSI_CMD_SET_SPEED   0xBB
 
#define SCSI_CMD_MECHANISM_STATUS   0xBD
 
#define SCSI_CMD_READ_CD   0xBE
 
#define SCSI_CMD_SEND_DISC_STRUCTURE   0xBF
 
#define SCSI_CMD_CD_PLAYBACK_STATUS   0xC4 /* SONY unique */
 
#define SCSI_CMD_PLAYBACK_CONTROL   0xC9 /* SONY unique */
 
#define SCSI_CMD_READ_CDDA   0xD8 /* Vendor unique */
 
#define SCSI_CMD_READ_CDXA   0xDB /* Vendor unique */
 
#define SCSI_CMD_READ_ALL_SUBCODES   0xDF /* Vendor unique */
 
#define SCSI_S_NOT_READY   0x02
 
#define SCSI_S_MEDIUM_ERROR   0x03
 
#define SCSI_S_ILLEGAL_REQUEST   0x05
 
#define SCSI_S_UNIT_ATTENTION   0x06
 
#define SCSI_ASC_LBA_OUT_OF_RANGE   0x21
 
#define SCSI_ASC_MEDIA_CHANGED   0x28
 
#define SCSI_ASC_MEDIUM_NOT_PRESENT   0x3A
 
#define MASS_ERR_SUCCESS   0x00
 
#define MASS_ERR_PHASE_ERROR   0x02
 
#define MASS_ERR_UNIT_NOT_READY   0x03
 
#define MASS_ERR_UNIT_BUSY   0x04
 
#define MASS_ERR_STALL   0x05
 
#define MASS_ERR_CMD_NOT_SUPPORTED   0x06
 
#define MASS_ERR_INVALID_CSW   0x07
 
#define MASS_ERR_NO_MEDIA   0x08
 
#define MASS_ERR_BAD_LBA   0x09
 
#define MASS_ERR_MEDIA_CHANGED   0x0A
 
#define MASS_ERR_DEVICE_DISCONNECTED   0x11
 
#define MASS_ERR_UNABLE_TO_RECOVER   0x12
 
#define MASS_ERR_INVALID_LUN   0x13
 
#define MASS_ERR_WRITE_STALL   0x14
 
#define MASS_ERR_READ_NAKS   0x15
 
#define MASS_ERR_WRITE_NAKS   0x16
 
#define MASS_ERR_WRITE_PROTECTED   0x17
 
#define MASS_ERR_NOT_IMPLEMENTED   0xFD
 
#define MASS_ERR_GENERAL_SCSI_ERROR   0xFE
 
#define MASS_ERR_GENERAL_USB_ERROR   0xFF
 
#define MASS_ERR_USER   0xA0
 
#define MASS_TRANS_FLG_CALLBACK   0x01
 
#define MASS_TRANS_FLG_NO_STALL_CHECK   0x02
 
#define MASS_TRANS_FLG_NO_PHASE_CHECK   0x04
 
#define MASS_MAX_ENDPOINTS   3
 

Typedefs

typedef BASICCDB BASICCDB_t
 
typedef CDB6 CDB6_t
 
typedef CDB10 CDB10_t
 
typedef CDB12 CDB12_t
 

Macro Definition Documentation

#define MS_WANT_PARSER   0

Definition at line 23 of file masstorage.h.

Definition at line 28 of file masstorage.h.

Definition at line 29 of file masstorage.h.

#define MASS_SUBCLASS_SCSI_NOT_REPORTED   0x00

Definition at line 32 of file masstorage.h.

#define MASS_SUBCLASS_RBC   0x01

Definition at line 33 of file masstorage.h.

#define MASS_SUBCLASS_ATAPI   0x02

Definition at line 34 of file masstorage.h.

#define MASS_SUBCLASS_OBSOLETE1   0x03

Definition at line 35 of file masstorage.h.

#define MASS_SUBCLASS_UFI   0x04

Definition at line 36 of file masstorage.h.

#define MASS_SUBCLASS_OBSOLETE2   0x05

Definition at line 37 of file masstorage.h.

#define MASS_SUBCLASS_SCSI   0x06

Definition at line 38 of file masstorage.h.

#define MASS_SUBCLASS_LSDFS   0x07

Definition at line 39 of file masstorage.h.

#define MASS_SUBCLASS_IEEE1667   0x08

Definition at line 40 of file masstorage.h.

#define MASS_PROTO_CBI   0x00

Definition at line 43 of file masstorage.h.

#define MASS_PROTO_CBI_NO_INT   0x01

Definition at line 44 of file masstorage.h.

#define MASS_PROTO_OBSOLETE   0x02

Definition at line 45 of file masstorage.h.

#define MASS_PROTO_BBB   0x50

Definition at line 46 of file masstorage.h.

#define MASS_PROTO_UAS   0x62

Definition at line 47 of file masstorage.h.

#define MASS_REQ_ADSC   0x00

Definition at line 50 of file masstorage.h.

#define MASS_REQ_GET   0xFC

Definition at line 51 of file masstorage.h.

#define MASS_REQ_PUT   0xFD

Definition at line 52 of file masstorage.h.

#define MASS_REQ_GET_MAX_LUN   0xFE

Definition at line 53 of file masstorage.h.

#define MASS_REQ_BOMSR   0xFF

Definition at line 54 of file masstorage.h.

#define MASS_CBW_SIGNATURE   0x43425355

Definition at line 56 of file masstorage.h.

#define MASS_CSW_SIGNATURE   0x53425355

Definition at line 57 of file masstorage.h.

#define MASS_CMD_DIR_OUT   0

Definition at line 59 of file masstorage.h.

#define MASS_CMD_DIR_IN   0x80

Definition at line 60 of file masstorage.h.

#define SCSI_CMD_TEST_UNIT_READY   0x00

Definition at line 70 of file masstorage.h.

#define SCSI_CMD_REQUEST_SENSE   0x03

Definition at line 71 of file masstorage.h.

#define SCSI_CMD_FORMAT_UNIT   0x04

Definition at line 72 of file masstorage.h.

#define SCSI_CMD_READ_6   0x08

Definition at line 73 of file masstorage.h.

#define SCSI_CMD_WRITE_6   0x0A

Definition at line 74 of file masstorage.h.

#define SCSI_CMD_INQUIRY   0x12

Definition at line 75 of file masstorage.h.

#define SCSI_CMD_MODE_SELECT_6   0x15

Definition at line 76 of file masstorage.h.

#define SCSI_CMD_MODE_SENSE_6   0x1A

Definition at line 77 of file masstorage.h.

#define SCSI_CMD_START_STOP_UNIT   0x1B

Definition at line 78 of file masstorage.h.

#define SCSI_CMD_PREVENT_REMOVAL   0x1E

Definition at line 79 of file masstorage.h.

#define SCSI_CMD_READ_FORMAT_CAPACITIES   0x23

Definition at line 81 of file masstorage.h.

#define SCSI_CMD_READ_CAPACITY_10   0x25

Definition at line 82 of file masstorage.h.

#define SCSI_CMD_READ_10   0x28

Definition at line 83 of file masstorage.h.

#define SCSI_CMD_WRITE_10   0x2A

Definition at line 84 of file masstorage.h.

#define SCSI_CMD_SEEK_10   0x2B

Definition at line 85 of file masstorage.h.

#define SCSI_CMD_ERASE_10   0x2C

Definition at line 86 of file masstorage.h.

#define SCSI_CMD_WRITE_AND_VERIFY_10   0x2E

Definition at line 87 of file masstorage.h.

#define SCSI_CMD_VERIFY_10   0x2F

Definition at line 88 of file masstorage.h.

#define SCSI_CMD_SYNCHRONIZE_CACHE   0x35

Definition at line 89 of file masstorage.h.

#define SCSI_CMD_WRITE_BUFFER   0x3B

Definition at line 90 of file masstorage.h.

#define SCSI_CMD_READ_BUFFER   0x3C

Definition at line 91 of file masstorage.h.

#define SCSI_CMD_READ_SUBCHANNEL   0x42

Definition at line 92 of file masstorage.h.

#define SCSI_CMD_READ_TOC   0x43

Definition at line 93 of file masstorage.h.

#define SCSI_CMD_READ_HEADER   0x44

Definition at line 94 of file masstorage.h.

#define SCSI_CMD_PLAY_AUDIO_10   0x45

Definition at line 95 of file masstorage.h.

#define SCSI_CMD_GET_CONFIGURATION   0x46

Definition at line 96 of file masstorage.h.

#define SCSI_CMD_PLAY_AUDIO_MSF   0x47

Definition at line 97 of file masstorage.h.

#define SCSI_CMD_PLAY_AUDIO_TI   0x48

Definition at line 98 of file masstorage.h.

#define SCSI_CMD_PLAY_TRACK_REL_10   0x49

Definition at line 99 of file masstorage.h.

#define SCSI_CMD_GET_EVENT_STATUS   0x4A

Definition at line 100 of file masstorage.h.

#define SCSI_CMD_PAUSE_RESUME   0x4B

Definition at line 101 of file masstorage.h.

#define SCSI_CMD_READ_DISC_INFORMATION   0x51

Definition at line 102 of file masstorage.h.

#define SCSI_CMD_READ_TRACK_INFORMATION   0x52

Definition at line 103 of file masstorage.h.

#define SCSI_CMD_RESERVE_TRACK   0x53

Definition at line 104 of file masstorage.h.

#define SCSI_CMD_SEND_OPC_INFORMATION   0x54

Definition at line 105 of file masstorage.h.

#define SCSI_CMD_MODE_SELECT_10   0x55

Definition at line 106 of file masstorage.h.

#define SCSI_CMD_REPAIR_TRACK   0x58

Definition at line 107 of file masstorage.h.

#define SCSI_CMD_MODE_SENSE_10   0x5A

Definition at line 108 of file masstorage.h.

#define SCSI_CMD_CLOSE_TRACK_SESSION   0x5B

Definition at line 109 of file masstorage.h.

#define SCSI_CMD_READ_BUFFER_CAPACITY   0x5C

Definition at line 110 of file masstorage.h.

#define SCSI_CMD_SEND_CUE_SHEET   0x5D

Definition at line 111 of file masstorage.h.

#define SCSI_CMD_REPORT_LUNS   0xA0

Definition at line 113 of file masstorage.h.

#define SCSI_CMD_BLANK   0xA1

Definition at line 114 of file masstorage.h.

#define SCSI_CMD_SECURITY_PROTOCOL_IN   0xA2

Definition at line 115 of file masstorage.h.

#define SCSI_CMD_SEND_KEY   0xA3

Definition at line 116 of file masstorage.h.

#define SCSI_CMD_REPORT_KEY   0xA4

Definition at line 117 of file masstorage.h.

#define SCSI_CMD_PLAY_AUDIO_12   0xA5

Definition at line 118 of file masstorage.h.

#define SCSI_CMD_LOAD_UNLOAD   0xA6

Definition at line 119 of file masstorage.h.

#define SCSI_CMD_SET_READ_AHEAD   0xA7

Definition at line 120 of file masstorage.h.

#define SCSI_CMD_READ_12   0xA8

Definition at line 121 of file masstorage.h.

#define SCSI_CMD_PLAY_TRACK_REL_12   0xA9

Definition at line 122 of file masstorage.h.

#define SCSI_CMD_WRITE_12   0xAA

Definition at line 123 of file masstorage.h.

#define SCSI_CMD_READ_MEDIA_SERIAL_12   0xAB

Definition at line 124 of file masstorage.h.

#define SCSI_CMD_GET_PERFORMANCE   0xAC

Definition at line 125 of file masstorage.h.

#define SCSI_CMD_READ_DVD_STRUCTURE   0xAD

Definition at line 126 of file masstorage.h.

#define SCSI_CMD_SECURITY_PROTOCOL_OUT   0xB5

Definition at line 127 of file masstorage.h.

#define SCSI_CMD_SET_STREAMING   0xB6

Definition at line 128 of file masstorage.h.

#define SCSI_CMD_READ_MSF   0xB9

Definition at line 129 of file masstorage.h.

#define SCSI_CMD_SET_SPEED   0xBB

Definition at line 130 of file masstorage.h.

#define SCSI_CMD_MECHANISM_STATUS   0xBD

Definition at line 131 of file masstorage.h.

#define SCSI_CMD_READ_CD   0xBE

Definition at line 132 of file masstorage.h.

#define SCSI_CMD_SEND_DISC_STRUCTURE   0xBF

Definition at line 133 of file masstorage.h.

#define SCSI_CMD_CD_PLAYBACK_STATUS   0xC4 /* SONY unique */

Definition at line 135 of file masstorage.h.

#define SCSI_CMD_PLAYBACK_CONTROL   0xC9 /* SONY unique */

Definition at line 136 of file masstorage.h.

#define SCSI_CMD_READ_CDDA   0xD8 /* Vendor unique */

Definition at line 137 of file masstorage.h.

#define SCSI_CMD_READ_CDXA   0xDB /* Vendor unique */

Definition at line 138 of file masstorage.h.

#define SCSI_CMD_READ_ALL_SUBCODES   0xDF /* Vendor unique */

Definition at line 139 of file masstorage.h.

#define SCSI_S_NOT_READY   0x02

Definition at line 142 of file masstorage.h.

#define SCSI_S_MEDIUM_ERROR   0x03

Definition at line 143 of file masstorage.h.

#define SCSI_S_ILLEGAL_REQUEST   0x05

Definition at line 144 of file masstorage.h.

#define SCSI_S_UNIT_ATTENTION   0x06

Definition at line 145 of file masstorage.h.

#define SCSI_ASC_LBA_OUT_OF_RANGE   0x21

Definition at line 146 of file masstorage.h.

#define SCSI_ASC_MEDIA_CHANGED   0x28

Definition at line 147 of file masstorage.h.

#define SCSI_ASC_MEDIUM_NOT_PRESENT   0x3A

Definition at line 148 of file masstorage.h.

#define MASS_ERR_SUCCESS   0x00

Definition at line 151 of file masstorage.h.

#define MASS_ERR_PHASE_ERROR   0x02

Definition at line 152 of file masstorage.h.

#define MASS_ERR_UNIT_NOT_READY   0x03

Definition at line 153 of file masstorage.h.

#define MASS_ERR_UNIT_BUSY   0x04

Definition at line 154 of file masstorage.h.

#define MASS_ERR_STALL   0x05

Definition at line 155 of file masstorage.h.

#define MASS_ERR_CMD_NOT_SUPPORTED   0x06

Definition at line 156 of file masstorage.h.

#define MASS_ERR_INVALID_CSW   0x07

Definition at line 157 of file masstorage.h.

#define MASS_ERR_NO_MEDIA   0x08

Definition at line 158 of file masstorage.h.

#define MASS_ERR_BAD_LBA   0x09

Definition at line 159 of file masstorage.h.

#define MASS_ERR_MEDIA_CHANGED   0x0A

Definition at line 160 of file masstorage.h.

#define MASS_ERR_DEVICE_DISCONNECTED   0x11

Definition at line 161 of file masstorage.h.

#define MASS_ERR_UNABLE_TO_RECOVER   0x12

Definition at line 162 of file masstorage.h.

#define MASS_ERR_INVALID_LUN   0x13

Definition at line 163 of file masstorage.h.

#define MASS_ERR_WRITE_STALL   0x14

Definition at line 164 of file masstorage.h.

#define MASS_ERR_READ_NAKS   0x15

Definition at line 165 of file masstorage.h.

#define MASS_ERR_WRITE_NAKS   0x16

Definition at line 166 of file masstorage.h.

#define MASS_ERR_WRITE_PROTECTED   0x17

Definition at line 167 of file masstorage.h.

#define MASS_ERR_NOT_IMPLEMENTED   0xFD

Definition at line 168 of file masstorage.h.

#define MASS_ERR_GENERAL_SCSI_ERROR   0xFE

Definition at line 169 of file masstorage.h.

#define MASS_ERR_GENERAL_USB_ERROR   0xFF

Definition at line 170 of file masstorage.h.

#define MASS_ERR_USER   0xA0

Definition at line 171 of file masstorage.h.

#define MASS_TRANS_FLG_CALLBACK   0x01

Definition at line 173 of file masstorage.h.

#define MASS_TRANS_FLG_NO_STALL_CHECK   0x02

Definition at line 174 of file masstorage.h.

#define MASS_TRANS_FLG_NO_PHASE_CHECK   0x04

Definition at line 175 of file masstorage.h.

#define MASS_MAX_ENDPOINTS   3

Definition at line 177 of file masstorage.h.

Typedef Documentation

Definition at line 194 of file masstorage.h.

typedef CDB6 CDB6_t

Definition at line 220 of file masstorage.h.

typedef CDB10 CDB10_t

Definition at line 254 of file masstorage.h.

typedef CDB12 CDB12_t

Definition at line 272 of file masstorage.h.