summaryrefslogtreecommitdiff
path: root/EdkModulePkg
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-30 03:21:44 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-30 03:21:44 +0000
commitea78388e1a314c78eb03814a5f9c78e8d3bfb140 (patch)
treea4d2fd44f65e6a2e5c4e6a18a5638125c7989f47 /EdkModulePkg
parentbecca880dcaeda04eda486bc67dce81e8374f01d (diff)
downloadedk2-ea78388e1a314c78eb03814a5f9c78e8d3bfb140.zip
edk2-ea78388e1a314c78eb03814a5f9c78e8d3bfb140.tar.gz
edk2-ea78388e1a314c78eb03814a5f9c78e8d3bfb140.tar.bz2
For USB mass storage, READ_FORMAT_CAPACITIES command returns wrong value for USB2.0 device.
In order to fix this issue, we change the retry policy. Try old command before new command. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2155 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r--EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.h4
-rw-r--r--EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.h b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.h
index 387c53a..fc19930 100644
--- a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.h
+++ b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.h
@@ -33,8 +33,8 @@ Revision History
#define PROTOCOL_CBI0 0
#define PROTOCOL_CBI1 1
-#define USBFLOPPY 1
-#define USBFLOPPY2 2 // for those that use ReadCapacity(0x25) command to retrieve media capacity
+#define USBFLOPPY 1 // for those that use ReadCapacity(0x25) command to retrieve media capacity
+#define USBFLOPPY2 2 // for those that use ReadFormatCapacity(0x23) command to retrieve media capacity
#define USBCDROM 3
#define USB_FLOPPY_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'f', 'l', 'p')
diff --git a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c
index 3d6a6d9..de61eeb 100644
--- a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c
+++ b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorageHelper.c
@@ -999,26 +999,26 @@ UsbFloppyDetectMedia (
Status = USBFloppyReadCapacity (UsbFloppyDevice);
break;
- case USBFLOPPY:
+ case USBFLOPPY2:
UsbMassStorageModeSense (UsbFloppyDevice);
Status = USBFloppyReadFormatCapacity (UsbFloppyDevice);
if (EFI_ERROR (Status) || !UsbFloppyDevice->BlkMedia.MediaPresent) {
//
// retry the ReadCapacity command
//
- UsbFloppyDevice->DeviceType = USBFLOPPY2;
+ UsbFloppyDevice->DeviceType = USBFLOPPY;
Status = EFI_DEVICE_ERROR;
}
break;
- case USBFLOPPY2:
+ case USBFLOPPY:
UsbMassStorageModeSense (UsbFloppyDevice);
Status = USBFloppyReadCapacity (UsbFloppyDevice);
if (EFI_ERROR (Status)) {
//
// retry the ReadFormatCapacity command
//
- UsbFloppyDevice->DeviceType = USBFLOPPY;
+ UsbFloppyDevice->DeviceType = USBFLOPPY2;
}
//
// force the BlockSize to be 0x200.