mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
becca880dc
commit
ea78388e1a
|
@ -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')
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue