MdeModulePkg/UsbMassStorageDxe: Fix USB Mass Storage detection

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

Update logic to not return an error from UsbBootRequestSense()
if a Request Sense command responds with no sense information.
It is legal for a USB mass storage device to respond to a
Request Sense command with a SenseKey of
USB_BOOT_SENSE_NO_SENSE and an Additional Sense
Code of USB_BOOT_ASC_NO_ADDITIONAL_SENSE_INFORMATION.

This is described in Section 3.3 of the Universal Serial
Bus Mass Storage Specification For Bootability:

http://www.usb.org/developers/docs/devclass_docs/usb_msc_boot_1.0.pdf

The previous logic returned an error of EFI_NO_RESPONSE
and this caused USB mass storage devices such as a USB
floppy drive to not be detected.

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>
This commit is contained in:
Michael D Kinney 2017-10-30 13:57:32 -07:00
parent e7275d3ffd
commit 275b96da60
2 changed files with 14 additions and 6 deletions

View File

@ -2,7 +2,7 @@
Implementation of the command set of USB Mass Storage Specification
for Bootability, Revision 1.0.
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -80,7 +80,14 @@ UsbBootRequestSense (
switch (USB_BOOT_SENSE_KEY (SenseData.SenseKey)) {
case USB_BOOT_SENSE_NO_SENSE:
if (SenseData.Asc == USB_BOOT_ASC_NO_ADDITIONAL_SENSE_INFORMATION) {
//
// It is not an error if a device does not have additional sense information
//
Status = EFI_SUCCESS;
} else {
Status = EFI_NO_RESPONSE;
}
break;
case USB_BOOT_SENSE_RECOVERED:

View File

@ -2,7 +2,7 @@
Definition of the command set of USB Mass Storage Specification
for Bootability, Revision 1.0.
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -51,6 +51,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define USB_BOOT_SENSE_VOLUME_OVERFLOW 0x0D ///< Partition overflow
#define USB_BOOT_SENSE_MISCOMPARE 0x0E ///< Source data mis-match while verfying.
#define USB_BOOT_ASC_NO_ADDITIONAL_SENSE_INFORMATION 0x00
#define USB_BOOT_ASC_NOT_READY 0x04
#define USB_BOOT_ASC_NO_MEDIA 0x3A
#define USB_BOOT_ASC_MEDIA_CHANGE 0x28