From 20bcb757d2d85f59c749e004e580bc2e52a96459 Mon Sep 17 00:00:00 2001 From: erictian Date: Fri, 29 Mar 2013 06:53:57 +0000 Subject: =?UTF-8?q?MdeMdeModulePkg/Usb:=20Fixed=20two=20usb=20issues=201.F?= =?UTF-8?q?ix=20the=20bug=20in=20interface=20parser=20logic=20for=20usb=20?= =?UTF-8?q?camera=20device.=20Reserve=20device=20address=20if=20the=20devi?= =?UTF-8?q?ce=20doesn=E2=80=99t=20get=20disconnected.=202.Some=20usb=201.1?= =?UTF-8?q?=20devices=20require=20the=20context=20evaluation=20immediately?= =?UTF-8?q?=20with=20actual=20max=20packet=20size=20after=20detecting=20th?= =?UTF-8?q?e=20device=20max=20packet=20size.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Feng Tian Reviewed-by: Elvin Li git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14226 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 4 ++-- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | 6 +++--- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index b8a1d78a7e..5809a0f914 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -1,7 +1,7 @@ /** @file The XHCI controller driver. -Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
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 @@ -916,7 +916,7 @@ XhcControlTransfer ( ((Request->RequestType == USB_REQUEST_TYPE (EfiUsbDataIn, USB_REQ_TYPE_STANDARD, USB_TARGET_DEVICE)) || ((Request->RequestType == USB_REQUEST_TYPE (EfiUsbDataIn, USB_REQ_TYPE_CLASS, USB_TARGET_DEVICE))))) { DescriptorType = (UINT8)(Request->Value >> 8); - if ((DescriptorType == USB_DESC_TYPE_DEVICE) && (*DataLength == sizeof (EFI_USB_DEVICE_DESCRIPTOR))) { + if ((DescriptorType == USB_DESC_TYPE_DEVICE) && ((*DataLength == sizeof (EFI_USB_DEVICE_DESCRIPTOR)) || ((DeviceSpeed == EFI_USB_SPEED_FULL) && (*DataLength == 8)))) { ASSERT (Data != NULL); // // Store a copy of device scriptor as hub device need this info to configure endpoint. diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c index 529b136188..35cdaf5527 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c @@ -2,7 +2,7 @@ Manage Usb Descriptor List -Copyright (c) 2007, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
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 @@ -360,8 +360,8 @@ UsbParseConfigDesc ( Setting = UsbParseInterfaceDesc (DescBuf, Len, &Consumed); if (Setting == NULL) { - DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: failed to parse interface setting\n")); - goto ON_ERROR; + DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: warning: failed to get interface setting, stop parsing now.\n")); + break; } else if (Setting->Desc.InterfaceNumber >= NumIf) { DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: mal-formated interface descriptor\n")); diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index 74de7d5d50..8340b72de2 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -2,7 +2,7 @@ Usb bus enumeration support. -Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
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 @@ -814,9 +814,6 @@ UsbEnumerateNewDev ( return EFI_SUCCESS; ON_ERROR: - if (Address != Bus->MaxDevices) { - Bus->Devices[Address] = NULL; - } if (Child != NULL) { UsbFreeDevice (Child); -- cgit v1.2.3