]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h
Sync USB modules with main trunk.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassBoot.h
index dc4b43faae0f8764dcc54a0a4ba005c919a50e43..bfef2609ad32d7090ea9cd858a00058900113b4f 100644 (file)
@@ -39,12 +39,14 @@ enum {
   USB_BOOT_INQUIRY_OPCODE         = 0x12,\r
   USB_BOOT_REQUEST_SENSE_OPCODE   = 0x03,\r
 \r
-  USB_BOOT_MODE_SENSE10_OPCODE    = 0x5a,\r
+  USB_BOOT_MODE_SENSE10_OPCODE    = 0x5A,\r
   USB_BOOT_READ_CAPACITY_OPCODE   = 0x25,\r
   USB_BOOT_TEST_UNIT_READY_OPCODE = 0x00,\r
   USB_BOOT_READ10_OPCODE          = 0x28,\r
-  USB_BOOT_WRITE10_OPCODE         = 0x2a,\r
+  USB_BOOT_WRITE10_OPCODE         = 0x2A,\r
 \r
+  USB_SCSI_MODE_SENSE6_OPCODE     = 0x1A,\r
+  \r
   //\r
   // The Sense Key part of the sense data. Sense data has three levels:\r
   // Sense key, Additional Sense Code and Additional Sense Code Qualifier\r
@@ -64,13 +66,9 @@ enum {
   USB_BOOT_SENSE_MISCOMPARE       = 0x0E, // Source data mis-match while verfying.\r
 \r
   USB_BOOT_ASC_NOT_READY          = 0x04,\r
-  USB_BOOT_ASC_MEDIA_UPSIDE_DOWN  = 0x06,\r
   USB_BOOT_ASC_NO_MEDIA           = 0x3A,\r
   USB_BOOT_ASC_MEDIA_CHANGE       = 0x28,\r
 \r
-  USB_BOOT_ASCQ_IN_PROGRESS       = 0x01,\r
-  USB_BOOT_ASCQ_DEVICE_BUSY       = 0xFF,\r
-\r
   //\r
   // Other parameters\r
   //\r
@@ -90,11 +88,13 @@ enum {
   //\r
   // Boot Transfer timeout\r
   //\r
-  USB_BOOT_GENERAL_BLOCK_TIMEOUT  = 200 * USB_MASS_STALL_1_MS,\r
-  USB_BOOT_OPTICAL_BLOCK_TIMEOUT  = 1 * USB_MASS_STALL_1_S,\r
-  USB_BOOT_GENERAL_CMD_TIMEOUT    = 1 * USB_MASS_STALL_1_S,\r
-  USB_BOOT_INQUIRY_CMD_TIMEOUT    = 3 * USB_MASS_STALL_1_S,\r
-\r
+  // USB2.0 Spec define the up-limit timeout 5s for all command. USB floppy, \r
+  // USB CD-Rom and iPod devices are much slower than USB key when reponse \r
+  // most of commands, So we set 5s as timeout here.\r
+  // \r
+  //\r
+  USB_BOOT_GENERAL_CMD_TIMEOUT    = 5 * USB_MASS_STALL_1_S,\r
+  \r
   //\r
   // Supported PDT codes, or Peripheral Device Type\r
   //\r
@@ -159,7 +159,7 @@ typedef struct {
   UINT8             ParaListLenLsb;\r
   UINT8             Reserved1;\r
   UINT8             Pad[2];\r
-} USB_BOOT_MODE_SENSE_CMD;\r
+} USB_BOOT_MODE_SENSE10_CMD;\r
 \r
 typedef struct {\r
   UINT8             ModeDataLenMsb;\r
@@ -167,7 +167,7 @@ typedef struct {
   UINT8             Reserved0[4];\r
   UINT8             BlkDesLenMsb;\r
   UINT8             BlkDesLenLsb;\r
-} USB_BOOT_MODE_PARA_HEADER;\r
+} USB_BOOT_MODE_SENSE10_PARA_HEADER;\r
 \r
 typedef struct {\r
   UINT8             OpCode;\r
@@ -209,6 +209,22 @@ typedef struct {
   UINT8             ASCQ;           // Additional Sense Code Qualifier\r
   UINT8             Reserverd2[4];\r
 } USB_BOOT_REQUEST_SENSE_DATA;\r
+\r
+typedef struct {\r
+  UINT8             OpCode;\r
+  UINT8             Lun;\r
+  UINT8             PageCode;\r
+  UINT8             Reserved0;\r
+  UINT8             AllocateLen;\r
+  UINT8             Control;\r
+} USB_SCSI_MODE_SENSE6_CMD;\r
+\r
+typedef struct {\r
+  UINT8             ModeDataLen;\r
+ UINT8             MediumType;\r
+  UINT8             DevicePara;\r
+  UINT8             BlkDesLen;\r
+} USB_SCSI_MODE_SENSE6_PARA_HEADER;\r
 #pragma pack()\r
 \r
 //\r