USB_INTERFACE_SUBCLASS_NONE = 0x00
"SCSI command set not reported."
USB_INTERFACE_SUBCLASS_RBC = 0x01
"Reduced Block Command (RBC)."
USB_INTERFACE_SUBCLASS_MMC5 = 0x02
"MMC-5 (ATAPI)."
USB_INTERFACE_SUBCLASS_QIC157 = 0x03
"QIC-157 (obsolete)."
USB_INTERFACE_SUBCLASS_UFI = 0x04
"UFI (floppy drive)."
USB_INTERFACE_SUBCLASS_SFF8070I = 0x05
"SFF-8070i (obsolete)."
USB_INTERFACE_SUBCLASS_SCSI = 0x06
"SCSI transparent command set."
USB_INTERFACE_SUBCLASS_LSDFS = 0x07
"Lockable Storage Devices (LSD) feature specification."
USB_INTERFACE_SUBCLASS_IEEE1667 = 0x08
"IEEE-1667."

USB_INTERFACE_PROTOCOL_CBI_WITH_COMPLETION = 0x00
"Control/Block/Interrupt (CBI) (with command completion interrupt)."
USB_INTERFACE_PROTOCOL_CBI = 0x01
"Control/Block/Interrupt (CBI) (without command completion interrupt)."
USB_INTERFACE_PROTOCOL_BBB = 0x50
"Bulk-only (BBB)."
USB_INTERFACE_PROTOCOL_UAS = 0x62
"USB Attached SCSI (UAS)."

USBMS_REQ_ADSC = 0x00
"Accept Device-Specific Command (ADSC)"
USBMS_REQ_LSD_GET_REQUESTS = 0xfc
"LSD Get Requests"
USBMS_REQ_LSD_PUT_REQUESTS = 0xfd
"LSD Put Requests"
USBMS_REQ_BBB_GET_MAX_LUN = 0xfe
"Bulk-only Get Max LUN"
USBMS_REQ_BBB_RESET = 0xff
"Bulk-only Reset"

USBMS_CBW_MAGIC = 0x43425355
USBMS_CSW_MAGIC = 0x53425355

USBMS_CBW_DIR_MASK = 0x80
USBMS_CBW_DIR_IN = 0x80
USBMS_CBW_DIR_OUT = 0x00

USBMS_CSW_STATUS_GOOD = 0x00
USBMS_CSW_STATUS_BAD = 0x01
USBMS_CSW_STATUS_PHASE_ERROR = 0x02

SCSI_CMD_TEST_UNIT_READY = 0x00
SCSI_CMD_REQUEST_SENSE = 0x03
SCSI_CMD_INQUIRY = 0x12
SCSI_CMD_MODE_SENSE6 = 0x1a
SCSI_CMD_START_STOP_UNIT = 0x1b
SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1e
SCSI_CMD_READ_FORMAT_CAPACITY = 0x23
SCSI_CMD_READ_CAPACITY10 = 0x25
SCSI_CMD_READ10 = 0x28
SCSI_CMD_WRITE10 = 0x2a
SCSI_CMD_VERIFY10 = 0x2f
SCSI_CMD_MODE_SENSE10 = 0x5a

SCSI_REQUEST_SENSE_F0_ERROR_CODE_MASK = 0x7f
SCSI_REQUEST_SENSE_F0_VALID_MASK = 0x80
SCSI_ERROR_CODE_CURRENT = 0x70
SCSI_ERROR_CODE_DEFERRED = 0x71

SCSI_REQUEST_SENSE_F2_SENSE_KEY_MASK = 0x0f
SCSI_SENSE_KEY_NO_SENSE = 0x0
SCSI_SENSE_KEY_RECOVERED_ERROR = 0x1
SCSI_SENSE_KEY_NOT_READY = 0x2
SCSI_SENSE_KEY_MEDIUM_ERROR = 0x3
SCSI_SENSE_KEY_HARDWARE_ERROR = 0x4
SCSI_SENSE_KEY_ILLEGAL_REQUEST = 0x5
SCSI_SENSE_KEY_UNIT_ATTENTION = 0x6
SCSI_SENSE_KEY_DATA_PROTECT = 0x7
SCSI_SENSE_KEY_BLANK_CHECK = 0x8
SCSI_SENSE_KEY_VENDOR_SPECIFIC = 0x9
SCSI_SENSE_KEY_COPY_ABORTED = 0xa
SCSI_SENSE_KEY_ABORTED_COMMAND = 0xb
SCSI_SENSE_KEY_VOLUME_OVERFLOW = 0xd
SCSI_SENSE_KEY_MISCOMPARE = 0xe

SCSI_ASC_NONE = 0x00
SCSI_ASC_LUN_NOT_READY = 0x0400
SCSI_ASC_LUN_STARTING = SCSI_ASC_LUN_NOT_READY | 0x01
SCSI_ASC_INVALID_FIELD_IN_CDB = 0x2400
SCSI_ASC_LUN_NOT_SUPPORTED = 0x2500

SCSI_INQUIRY_HEADER_F1_RMB = 0x80
SCSI_INQUIRY_HEADER_F3_AERC = 0x80
SCSI_INQUIRY_HEADER_F3_NORMACA = 0x20
SCSI_INQUIRY_HEADER_F3_HISUP = 0x10
SCSI_INQUIRY_HEADER_F3_FORMAT_MASK = 0x0f
SCSI_INQUIRY_HEADER_FORMAT_SPC2 = 0x02

SCSI_INQUIRY_HEADER_VERSION_NONE = 0x0
SCSI_INQUIRY_HEADER_VERSION_SCSI2_ANSI = 0x2
SCSI_INQUIRY_HEADER_VERSION_SPC = 0x3
SCSI_INQUIRY_HEADER_VERSION_SPC2 = 0x4
SCSI_INQUIRY_HEADER_VERSION_SCSI2_ISO = 0x80

SCSI_INQUIRY_PERIF_QUALIFIER_LOADED = 0 << 5
SCSI_INQUIRY_PERIF_QUALIFIER_UNLOADED = 1 << 5
SCSI_INQUIRY_PERIF_QUALIFIER_UNKNOWN = 3 << 5
SCSI_INQUIRY_PERIF_TYPE_DIRECT = 0x00

SCSI_INQUIRY_FEATURES_F0_SCCS = 0x80
SCSI_INQUIRY_FEATURES_FLAG_BQUE = 0x8000
SCSI_INQUIRY_FEATURES_FLAG_ENCSERV = 0x4000
SCSI_INQUIRY_FEATURES_FLAG_MULTIP = 0x1000
SCSI_INQUIRY_FEATURES_FLAG_MCHNGR = 0x0800
SCSI_INQUIRY_FEATURES_FLAG_ADDR16 = 0x0100
SCSI_INQUIRY_FEATURES_FLAG_RELADR = 0x0080
SCSI_INQUIRY_FEATURES_FLAG_WBUS16 = 0x0020
SCSI_INQUIRY_FEATURES_FLAG_SYNC = 0x0010
SCSI_INQUIRY_FEATURES_FLAG_LINKED = 0x0008
SCSI_INQUIRY_FEATURES_FLAG_CMDQUE = 0x0002

SCSI_VERIFY_F1_BYTCHK = 0x02
