- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# include/usb/msc_protocol.h

Go to the documentation of this file.

    00001
    00045 #ifndef USB_MSC_PROTOCOL_H_INCLUDED
    00046 #define USB_MSC_PROTOCOL_H_INCLUDED
    00047
    00048 #include <types.h>
    00049
    00054 #define USB_INTERFACE_CLASS_MSC 8
    00055
    00066 enum usb_msc_interface_subclass {
    00067         USB_MSC_SUBCLASS_RBC            = 0x01,
    00068         USB_MSC_SUBCLASS_ATAPI          = 0x02,
    00069         USB_MSC_SUBCLASS_QIC_157        = 0x03,
    00070         USB_MSC_SUBCLASS_UFI            = 0x04,
    00071         USB_MSC_SUBCLASS_SFF_8070I      = 0x05,
    00072         USB_MSC_SUBCLASS_TRANSPARENT    = 0x06,
    00073 };
    00074
    00081 enum usb_msc_interface_protocol {
    00082         USB_MSC_PROTOCOL_CBI            = 0x00,
    00083         USB_MSC_PROTOCOL_CBI_ALT        = 0x01,
    00084         USB_MSC_PROTOCOL_BULK           = 0x50,
    00085 };
    00086
    00090 enum usb_msc_reqid {
    00091         USB_MSC_REQ_BULK_RESET          = 0xff,
    00092         USB_MSC_REQ_GET_MAX_LUN         = 0xfe,
    00093 };
    00094
    00098 struct usb_msc_cbw {
    00099         le32_t  dCBWSignature;
    00100         le32_t  dCBWTag;
    00101         le32_t  dCBWDataTransferLength;
    00102         uint8_t bmCBWFlags;
    00103         uint8_t bCBWLUN;
    00104         uint8_t bCBWCBLength;
    00105         uint8_t CDB[16];
    00106 } __packed;
    00107
    00108 #define USB_CBW_SIGNATURE       0x43425355
    00109 #define USB_CBW_DIRECTION_IN    (1 << 7)
    00110 #define USB_CBW_LUN_MASK        0x0f
    00111 #define USB_CBW_LEN_MASK        0x1f
    00112
    00113
    00116 struct usb_msc_csw {
    00117         le32_t  dCSWSignature;
    00118         le32_t  dCSWTag;
    00119         le32_t  dCSWDataResidue;
    00120         uint8_t bCSWStatus;
    00121 } __packed;
    00122
    00123 #define USB_CSW_SIGNATURE       0x53425355
    00124 #define USB_CSW_STATUS_PASS     0x00
    00125 #define USB_CSW_STATUS_FAIL     0x01
    00126 #define USB_CSW_STATUS_PE       0x02
    00127
    00128 #endif /* USB_MSC_PROTOCOL_H_INCLUDED */