]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeMdeModulePkg/Usb: Fixed two usb issues
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Mar 2013 06:53:57 +0000 (06:53 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Mar 2013 06:53:57 +0000 (06:53 +0000)
1.Fix the bug in interface parser logic for usb camera device. Reserve device address if the device doesn’t get disconnected.
2.Some usb 1.1 devices require the context evaluation immediately with actual max packet size after detecting the device max packet size.

Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Elvin Li <elvin.li@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14226 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c

index b8a1d78a7e8b83983e5b7ecd035da21d1c778003..5809a0f91470a22fe9e853b22f3d9b54a467dfab 100644 (file)
@@ -1,7 +1,7 @@
 /** @file
   The XHCI controller driver.
 
-Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2013, 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
@@ -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.
index 529b136188ace95104d6dfb9e069e0c9b202c165..35cdaf55277ce4abfe505b9135697d654a483c1c 100644 (file)
@@ -2,7 +2,7 @@
 \r
     Manage Usb Descriptor List\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -360,8 +360,8 @@ UsbParseConfigDesc (
     Setting = UsbParseInterfaceDesc (DescBuf, Len, &Consumed);\r
 \r
     if (Setting == NULL) {\r
-      DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: failed to parse interface setting\n"));\r
-      goto ON_ERROR;\r
+      DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: warning: failed to get interface setting, stop parsing now.\n"));\r
+      break;\r
 \r
     } else if (Setting->Desc.InterfaceNumber >= NumIf) {\r
       DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: mal-formated interface descriptor\n"));\r
index 74de7d5d5069ee0cab0000ed422cbc9ed36f9503..8340b72de25c21aa68c14bd2365b9db3477bbff7 100644 (file)
@@ -2,7 +2,7 @@
 \r
     Usb bus enumeration support.\r
 \r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -814,9 +814,6 @@ UsbEnumerateNewDev (
   return EFI_SUCCESS;\r
 \r
 ON_ERROR:\r
-  if (Address != Bus->MaxDevices) {\r
-    Bus->Devices[Address] = NULL;\r
-  }\r
 \r
   if (Child != NULL) {\r
     UsbFreeDevice (Child);\r