]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
MdeModulePkg/UsbMassStorageDxe: Enhance Request Sense Handling
authorMichael D Kinney <michael.d.kinney@intel.com>
Tue, 14 Nov 2017 23:56:30 +0000 (15:56 -0800)
committerMichael D Kinney <michael.d.kinney@intel.com>
Fri, 17 Nov 2017 18:37:56 +0000 (10:37 -0800)
commitd8030c2ae06b771c78d0438c869cd882e82d0c8f
tree79d9625acd87842272c23e53ef8012faa2d3de32
parentc09d9571300a089c35f5df2773b70edc25050d0d
MdeModulePkg/UsbMassStorageDxe: Enhance Request Sense Handling

https://bugzilla.tianocore.org/show_bug.cgi?id=782

Update the Request Sense check for the Request Sense Key of
USB_BOOT_SENSE_UNIT_ATTENTION.  For this Sense Key, the
Additional Sense Key to EFI_STATUS mappings are:

USB_BOOT_ASC_MEDIA_CHANGE -> EFI_MEDIA_CHANGE
USB_BOOT_ASC_NOT_READY    -> EFI_NOT_READY
USB_BOOT_ASC_NO_MEDIA     -> EFI_NOT_READY
All others                -> EFI_DEVICE_ERROR

A USB flash drive is returning Request Sense Key of
USB_BOOT_SENSE_UNIT_ATTENTION and an Additional Sense Key of
USB_BOOT_ASC_NO_MEDIA for a few seconds before returning an
Additional Sense Key of USB_BOOT_ASC_MEDIA_CHANGE.

The current logic treats this initial Request Sense info as an
error and reties the command 5 times before failing completely.

With this change the USB Flash Drive works correctly.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c