Data Structures | Macros
usbmsc.h File Reference

Generic types and defines use by the mass storage class. More...

Data Structures

struct  USBLIB_PACKED
 This structure is used to access the Command Block wrapper (CBW) data structure that is used when the communicating with the mass storage class device. More...
 
struct  USBLIB_PACKED
 This structure is used to access the Command Block wrapper (CBW) data structure that is used when the communicating with the mass storage class device. More...
 

Macros

#define USBREQ_GET_MAX_LUN   0xfe
 The request for maximum number of logical units on a mass storage device.
 
#define CBW_SIGNATURE   0x43425355
 The signatures used by the USB MSC class specification.
 
#define CBWFLAGS_DIR_M   0x80
 Flag for bmCBWFlags of tMSCCBW.
 
#define CSWSTATUS_CMD_SUCCESS   0
 Flag for the bCSWStatus member of tMSCCSW.
 
#define SCSI_CMD_STATUS_PASS   0x00
 SCSI command return codes.
 
#define SCSI_TEST_UNIT_READY   0x00
 SCSI Commands.
 
#define SCSI_INQUIRY_DATA_SZ   36
 Size of the SCSI inquiry response data.
 
#define SCSI_INQ_PQ_M   0xe0
 Peripheral Qualifier mask.
 
#define SCSI_INQ_PQ_CNCT   0x00
 Device connected.
 
#define SCSI_INQ_PQ_DISC   0x20
 Devce disconnected.
 
#define SCSI_INQ_PDT_M   0x1f
 Preipheral device type mask.
 
#define SCSI_INQ_PDT_SBC   0x00
 Direct Access device.
 
#define SCSI_INQ_RMB   0x80
 Device is removable. More...
 
#define SCSIIsRemovable(pData)   (((uint8_t *)pData)[1] & SCSI_INQ_RMB)
 Macro to check if removable.
 
#define SCSI_READ_CAPACITY_SZ   0x08
 Size of the SCSI Read capacity response data.
 
#define SCSI_MS_DBD   0x00000800
 Discable block descriptors. More...
 
#define SCSI_MS_PC_VENDOR   0x00000000
 Page code values used in combination with page control values.
 
#define SCSI_MS_PC_CURRENT   0x00000000
 Page control values.
 
#define SCSI_REQUEST_SENSE_SZ   18
 Size of the data returned by the Request Sense command. More...
 
#define SCSI_RS_SKEY   2
 Sense Key offset.
 
#define SCSI_RS_SKEY_AD_SKEY   12
 Additional Sense Key offset.
 
#define SCSI_RS_VALID   0x80
 Response is valid. More...
 
#define SCSI_RS_CUR_ERRORS   0x70
 
#define SCSI_RS_DEFER_ERRORS   0x71
 Deferred errors returned.
 
#define SCSI_RS_KEY_M   0x0f
 Sense Key. More...
 
#define SCSI_RS_KEY_NO_SENSE   0x00
 No Sense data.
 
#define SCSI_RS_KEY_RECOVRD_ERR   0x01
 Recovered Error.
 
#define SCSI_RS_KEY_NOT_READY   0x02
 Not ready.
 
#define SCSI_RS_KEY_MEDIUM_ERR   0x03
 Error in the media.
 
#define SCSI_RS_KEY_HW_ERR   0x04
 Hardware error, non recoverable.
 
#define SCSI_RS_KEY_ILGL_RQST   0x05
 Illegal request.
 
#define SCSI_RS_KEY_UNIT_ATTN   0x06
 Unit changed or reset.
 
#define SCSI_RS_KEY_DATA_PROT   0x07
 Write protect error.
 
#define SCSI_RS_KEY_BLANK_CHK   0x07
 Write once error, block not clear.
 
#define SCSI_RS_KEY_ABORT   0x0b
 Last command was aborted.
 
#define SCSI_RS_ILI   0x20
 Incorrect length indicator.
 
#define SCSI_RS_EOM   0x40
 End of medium condition.
 
#define SCSI_RS_FILEMARK   0x80
 Command has read a filemark/setmark.
 
#define SCSI_RS_MED_NOT_PRSNT   0x003a
 Medium not present.
 
#define SCSI_RS_MED_NOTRDY2RDY   0x0028
 Not ready to ready transition.
 
#define SCSI_RS_PV_INVALID   0x0226
 Parameter value invalid.
 
#define SCSI_RS_KEY_NOTPRSNT   0x3A
 Media not present. More...
 

Detailed Description

Generic types and defines use by the mass storage class.

USB Mass storage device class driver.

Macro Definition Documentation

#define SCSI_INQ_RMB   0x80

Device is removable.

Offset 1 of the Inquiry Data.

#define SCSI_MS_DBD   0x00000800

Discable block descriptors.

SCSI Mode Sense definitions, these are passed in via the ulFlags parameter of the SCSIModeSense() function call.

#define SCSI_REQUEST_SENSE_SZ   18

Size of the data returned by the Request Sense command.

Request Sense Definitions.

#define SCSI_RS_CUR_ERRORS   0x70

Current errors returned

#define SCSI_RS_KEY_M   0x0f

Sense Key.

Offset 2 in the Request Sense response.

#define SCSI_RS_KEY_NOTPRSNT   0x3A

Media not present.

Additional information for SCSI_RS_KEY_NOT_READY

#define SCSI_RS_VALID   0x80

Response is valid.

Offset 0 in the Request Sense response.


Copyright 2016, Texas Instruments Incorporated