goto ON_EXIT;\r
}\r
\r
- Status = UsbBootReadBlocks (UsbMass, (UINT32) Lba, TotalBlock, Buffer);\r
+ if (UsbMass->Cdb16Byte) {\r
+ Status = UsbBootReadBlocks16 (UsbMass, Lba, TotalBlock, Buffer);\r
+ } else {\r
+ Status = UsbBootReadBlocks (UsbMass, (UINT32) Lba, TotalBlock, Buffer);\r
+ }\r
+\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "UsbMassReadBlocks: UsbBootReadBlocks (%r) -> Reset\n", Status));\r
UsbMassReset (This, TRUE);\r
// Try to write the data even the device is marked as ReadOnly,\r
// and clear the status should the write succeed.\r
//\r
- Status = UsbBootWriteBlocks (UsbMass, (UINT32) Lba, TotalBlock, Buffer);\r
+ if (UsbMass->Cdb16Byte) {\r
+ Status = UsbBootWriteBlocks16 (UsbMass, Lba, TotalBlock, Buffer);\r
+ } else {\r
+ Status = UsbBootWriteBlocks (UsbMass, (UINT32) Lba, TotalBlock, Buffer);\r
+ } \r
+\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "UsbMassWriteBlocks: UsbBootWriteBlocks (%r) -> Reset\n", Status));\r
UsbMassReset (This, TRUE);\r
{\r
EFI_BLOCK_IO_MEDIA *Media;\r
EFI_STATUS Status;\r
- UINTN Index;\r
\r
Media = &UsbMass->BlockIoMedia;\r
\r
Media->IoAlign = 0;\r
Media->MediaId = 1;\r
\r
- //\r
- // Some device may spend several seconds before it is ready.\r
- // Try several times before giving up. Wait 5s at most.\r
- //\r
- Status = EFI_SUCCESS;\r
-\r
- for (Index = 0; Index < USB_BOOT_INIT_MEDIA_RETRY; Index++) {\r
-\r
- Status = UsbBootGetParams (UsbMass);\r
- if ((Status != EFI_MEDIA_CHANGED) && (Status != EFI_NOT_READY) && (Status != EFI_TIMEOUT)) {\r
- break;\r
- }\r
-\r
- Status = UsbBootIsUnitReady (UsbMass);\r
- if (EFI_ERROR (Status)) {\r
- gBS->Stall (USB_BOOT_RETRY_UNIT_READY_STALL * (Index + 1));\r
- }\r
- }\r
-\r
+ Status = UsbBootGetParams (UsbMass);\r
return Status;\r
}\r
\r