MdeModulePkg/UsbMassStorage: Don't send READ_CAPACITY to unsupported usb mass storage type device.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tian, Feng <feng.tian@intel.com>
Reviewed-by: Zeng, Star <star.zeng@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15447 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Tian, Feng
2014-04-10 02:45:32 +00:00
committed by erictian
parent d8adff447d
commit 66a5771e7a
2 changed files with 32 additions and 63 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 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2007 - 2014, 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
@@ -628,6 +628,18 @@ UsbBootGetParams (
return Status;
}
//
// According to USB Mass Storage Specification for Bootability, only following
// 4 Peripheral Device Types are in spec.
//
if ((UsbMass->Pdt != USB_PDT_DIRECT_ACCESS) &&
(UsbMass->Pdt != USB_PDT_CDROM) &&
(UsbMass->Pdt != USB_PDT_OPTICAL) &&
(UsbMass->Pdt != USB_PDT_SIMPLE_DIRECT)) {
DEBUG ((EFI_D_ERROR, "UsbBootGetParams: Found an unsupported peripheral type[%d]\n", UsbMass->Pdt));
return EFI_UNSUPPORTED;
}
//
// Don't use the Removable bit in inquiry data to test whether the media
// is removable because many flash disks wrongly set this bit.