audk/MdeModulePkg/Bus/Usb/UsbBusDxe
Michael D Kinney b4e96b82b4 MdeModulePkg/UsbBusDxe: Add UsbControlTransfer() error check
https://bugzilla.tianocore.org/show_bug.cgi?id=767

The USB I/O Protocol function ControlTransfer() has a DataLength
parameter that specifies the size of the Data buffer.  The
UsbBusDxe module implements the USB I/O Protocol using the
services of the USB2 Host Controller Protocol.  The DataLength
parameter in the USB2 Host Controller Protocol ControlTransfer()
service is an IN OUT parameter so the number of bytes actually
transferred is returned.  Since the USB I/O Protocol
ControlTransfer() service can not return the number of bytes
actually transferred, the only option if the number of bytes
actually transferred is less than the number of bytes requested
is to return EFI_DEVICE_ERROR.

The change fixes an issue with a USB mass storage device that
responds with 0 bytes to the Get MAX LUN command.

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>
2017-11-20 14:43:28 -08:00
..
ComponentName.c Fix the comments to follow UEFI Spec regarding how to check an EFI_HANDLE is valid/invalid. 2011-07-06 03:55:36 +00:00
UsbBus.c MdeModulePkg/UsbBusDxe: Add UsbControlTransfer() error check 2017-11-20 14:43:28 -08:00
UsbBus.h MdeMdeModulePkg/UsbBusDxe: If DisconnectController() returns an error the USB Bus Driver would retry the DisconnectController() from a timer event until it succeeds 2013-10-30 03:49:24 +00:00
UsbBusDxe.inf MdeModulePkg: list ARM and AARCH64 as valid architectures for some modules 2015-02-23 16:05:50 +00:00
UsbBusDxe.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UsbBusDxeExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UsbDesc.c MdeModulePkg/UsbBusDxe: Fixed USB descriptor length check 2016-06-29 10:37:22 +08:00
UsbDesc.h MdeModulePkg/UsbBusDxe: Fixed Clang build error. 2014-09-10 06:14:26 +00:00
UsbEnumer.c MdeModulePkg/UsbBusDxe: log warning message at DEBUG_WARN level 2017-09-11 22:38:59 +02:00
UsbEnumer.h MdeMdeModulePkg/UsbBusDxe: If DisconnectController() returns an error the USB Bus Driver would retry the DisconnectController() from a timer event until it succeeds 2013-10-30 03:49:24 +00:00
UsbHub.c MdeModulePkg/UsbBusDxe: rebase to ARRAY_SIZE() 2016-10-27 11:10:55 +02:00
UsbHub.h MdeModulePkg/UsbBusDxe: Timing tunning for better boot performance. 2012-10-10 02:46:06 +00:00
UsbUtility.c MdeModulePkg/UsbBus: Correct debug message 2017-06-02 12:59:28 +08:00
UsbUtility.h Update the copyright notice format 2010-04-24 09:49:11 +00:00