LUFA Library  120219
MassStorageClassCommon.h File Reference

Common definitions and declarations for the library USB Mass Storage Class driver. More...

Data Structures

struct  MS_CommandBlockWrapper_t
 Mass Storage Class Command Block Wrapper. More...
struct  MS_CommandStatusWrapper_t
 Mass Storage Class Command Status Wrapper. More...
struct  SCSI_Request_Sense_Response_t
 Mass Storage Class SCSI Sense Structure. More...
struct  SCSI_Inquiry_Response_t
 Mass Storage Class SCSI Inquiry Structure. More...

Defines

#define MS_CBW_SIGNATURE   0x43425355UL
#define MS_CSW_SIGNATURE   0x53425355UL
#define MS_COMMAND_DIR_DATA_OUT   (0 << 7)
#define MS_COMMAND_DIR_DATA_IN   (1 << 7)
SCSI Commands
#define SCSI_CMD_INQUIRY   0x12
#define SCSI_CMD_REQUEST_SENSE   0x03
#define SCSI_CMD_TEST_UNIT_READY   0x00
#define SCSI_CMD_READ_CAPACITY_10   0x25
#define SCSI_CMD_SEND_DIAGNOSTIC   0x1D
#define SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL   0x1E
#define SCSI_CMD_WRITE_10   0x2A
#define SCSI_CMD_READ_10   0x28
#define SCSI_CMD_WRITE_6   0x0A
#define SCSI_CMD_READ_6   0x08
#define SCSI_CMD_VERIFY_10   0x2F
#define SCSI_CMD_MODE_SENSE_6   0x1A
#define SCSI_CMD_MODE_SENSE_10   0x5A
SCSI Sense Key Values
#define SCSI_SENSE_KEY_GOOD   0x00
#define SCSI_SENSE_KEY_RECOVERED_ERROR   0x01
#define SCSI_SENSE_KEY_NOT_READY   0x02
#define SCSI_SENSE_KEY_MEDIUM_ERROR   0x03
#define SCSI_SENSE_KEY_HARDWARE_ERROR   0x04
#define SCSI_SENSE_KEY_ILLEGAL_REQUEST   0x05
#define SCSI_SENSE_KEY_UNIT_ATTENTION   0x06
#define SCSI_SENSE_KEY_DATA_PROTECT   0x07
#define SCSI_SENSE_KEY_BLANK_CHECK   0x08
#define SCSI_SENSE_KEY_VENDOR_SPECIFIC   0x09
#define SCSI_SENSE_KEY_COPY_ABORTED   0x0A
#define SCSI_SENSE_KEY_ABORTED_COMMAND   0x0B
#define SCSI_SENSE_KEY_VOLUME_OVERFLOW   0x0D
#define SCSI_SENSE_KEY_MISCOMPARE   0x0E
SCSI Additional Sense Codes
#define SCSI_ASENSE_NO_ADDITIONAL_INFORMATION   0x00
#define SCSI_ASENSE_LOGICAL_UNIT_NOT_READY   0x04
#define SCSI_ASENSE_INVALID_FIELD_IN_CDB   0x24
#define SCSI_ASENSE_NOT_READY_TO_READY_CHANGE   0x28
#define SCSI_ASENSE_WRITE_PROTECTED   0x27
#define SCSI_ASENSE_FORMAT_ERROR   0x31
#define SCSI_ASENSE_INVALID_COMMAND   0x20
#define SCSI_ASENSE_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE   0x21
#define SCSI_ASENSE_MEDIUM_NOT_PRESENT   0x3A
SCSI Additional Sense Key Code Qualifiers
#define SCSI_ASENSEQ_NO_QUALIFIER   0x00
#define SCSI_ASENSEQ_FORMAT_COMMAND_FAILED   0x01
#define SCSI_ASENSEQ_INITIALIZING_COMMAND_REQUIRED   0x02
#define SCSI_ASENSEQ_OPERATION_IN_PROGRESS   0x07

Enumerations

enum  MS_Descriptor_ClassSubclassProtocol_t {
  MS_CSCP_MassStorageClass = 0x08,
  MS_CSCP_SCSITransparentSubclass = 0x06,
  MS_CSCP_BulkOnlyTransportProtocol = 0x50
}
enum  MS_ClassRequests_t {
  MS_REQ_GetMaxLUN = 0xFE,
  MS_REQ_MassStorageReset = 0xFF
}
enum  MS_CommandStatusCodes_t {
  MS_SCSI_COMMAND_Pass = 0,
  MS_SCSI_COMMAND_Fail = 1,
  MS_SCSI_COMMAND_PhaseError = 2
}

Detailed Description

Common definitions and declarations for the library USB Mass Storage Class driver.

Note:
This file should not be included directly. It is automatically included as needed by the USB module driver dispatch header located in LUFA/Drivers/USB.h.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines