#include <Library/MemoryAllocationLib.h>\r
#include <Library/DevicePathLib.h>\r
\r
-#define USB_IS_IN_ENDPOINT(EndPointAddr) (((EndPointAddr) & 0x80) == 0x80)\r
-#define USB_IS_OUT_ENDPOINT(EndPointAddr) (((EndPointAddr) & 0x80) == 0)\r
-#define USB_IS_BULK_ENDPOINT(Attribute) (((Attribute) & 0x03) == 0x02)\r
-#define USB_IS_INTERRUPT_ENDPOINT(Attribute) (((Attribute) & 0x03) == 0x03)\r
+#define USB_IS_IN_ENDPOINT(EndPointAddr) (((EndPointAddr) & BIT7) == BIT7)\r
+#define USB_IS_OUT_ENDPOINT(EndPointAddr) (((EndPointAddr) & BIT7) == 0)\r
+#define USB_IS_BULK_ENDPOINT(Attribute) (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_BULK)\r
+#define USB_IS_INTERRUPT_ENDPOINT(Attribute) (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT)\r
#define USB_IS_ERROR(Result, Error) (((Result) & (Error)) != 0)\r
\r
typedef enum {\r
//\r
// Usb mass storage subclass code, specify the command set used.\r
//\r
- USB_MASS_STORE_RBC = 0x01, // Reduced Block Commands\r
- USB_MASS_STORE_8020I = 0x02, // SFF-8020i, typically a CD/DVD device\r
- USB_MASS_STORE_QIC = 0x03, // Typically a tape device\r
- USB_MASS_STORE_UFI = 0x04, // Typically a floppy disk driver device\r
- USB_MASS_STORE_8070I = 0x05, // SFF-8070i, typically a floppy disk driver device.\r
- USB_MASS_STORE_SCSI = 0x06, // SCSI transparent command set\r
+ USB_MASS_STORE_RBC = 0x01, ///< Reduced Block Commands\r
+ USB_MASS_STORE_8020I = 0x02, ///< SFF-8020i, typically a CD/DVD device\r
+ USB_MASS_STORE_QIC = 0x03, ///< Typically a tape device\r
+ USB_MASS_STORE_UFI = 0x04, ///< Typically a floppy disk driver device\r
+ USB_MASS_STORE_8070I = 0x05, ///< SFF-8070i, typically a floppy disk driver device.\r
+ USB_MASS_STORE_SCSI = 0x06, ///< SCSI transparent command set\r
\r
//\r
// Usb mass storage protocol code, specify the transport protocol\r
//\r
- USB_MASS_STORE_CBI0 = 0x00, // CBI protocol with command completion interrupt\r
- USB_MASS_STORE_CBI1 = 0x01, // CBI protocol without command completion interrupt\r
- USB_MASS_STORE_BOT = 0x50, // Bulk-Only Transport\r
+ USB_MASS_STORE_CBI0 = 0x00, ///< CBI protocol with command completion interrupt\r
+ USB_MASS_STORE_CBI1 = 0x01, ///< CBI protocol without command completion interrupt\r
+ USB_MASS_STORE_BOT = 0x50, ///< Bulk-Only Transport\r
\r
USB_MASS_1_MILLISECOND = 1000,\r
USB_MASS_1_SECOND = 1000 * USB_MASS_1_MILLISECOND,\r
\r
typedef\r
EFI_STATUS\r
-(*USB_MASS_FINI) (\r
+(*USB_MASS_CLEAN_UP) (\r
IN VOID *Context\r
);\r
\r
-//\r
-// This structure contains information necessary to select the\r
-// proper transport protocol. The mass storage class defines\r
-// two transport protocols. One is the CBI, and the other is BOT.\r
-// CBI is being obseleted. The design is made modular by this\r
-// structure so that the CBI protocol can be easily removed when\r
-// it is no longer necessary.\r
-//\r
+///\r
+/// This structure contains information necessary to select the\r
+/// proper transport protocol. The mass storage class defines\r
+/// two transport protocols. One is the CBI, and the other is BOT.\r
+/// CBI is being obseleted. The design is made modular by this\r
+/// structure so that the CBI protocol can be easily removed when\r
+/// it is no longer necessary.\r
+///\r
typedef struct {\r
UINT8 Protocol;\r
- USB_MASS_INIT_TRANSPORT Init; // Initialize the mass storage transport protocol\r
- USB_MASS_EXEC_COMMAND ExecCommand; // Transport command to the device then get result\r
- USB_MASS_RESET Reset; // Reset the device\r
- USB_MASS_GET_MAX_LUN GetMaxLun; // Get max lun, only for bot\r
- USB_MASS_FINI Fini; // Clean up the resources.\r
+ USB_MASS_INIT_TRANSPORT Init; ///< Initialize the mass storage transport protocol\r
+ USB_MASS_EXEC_COMMAND ExecCommand; ///< Transport command to the device then get result\r
+ USB_MASS_RESET Reset; ///< Reset the device\r
+ USB_MASS_GET_MAX_LUN GetMaxLun; ///< Get max lun, only for bot\r
+ USB_MASS_CLEAN_UP CleanUp; ///< Clean up the resources.\r
} USB_MASS_TRANSPORT;\r
\r
\r