MdeMdeModulePkg/Usb: Fixed two usb issues

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
This commit is contained in:
erictian 2013-03-29 06:53:57 +00:00
parent 1687559138
commit 20bcb757d2
3 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
The XHCI controller driver. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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_STANDARD, USB_TARGET_DEVICE)) ||
((Request->RequestType == USB_REQUEST_TYPE (EfiUsbDataIn, USB_REQ_TYPE_CLASS, USB_TARGET_DEVICE))))) { ((Request->RequestType == USB_REQUEST_TYPE (EfiUsbDataIn, USB_REQ_TYPE_CLASS, USB_TARGET_DEVICE))))) {
DescriptorType = (UINT8)(Request->Value >> 8); 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); ASSERT (Data != NULL);
// //
// Store a copy of device scriptor as hub device need this info to configure endpoint. // Store a copy of device scriptor as hub device need this info to configure endpoint.

View File

@ -2,7 +2,7 @@
Manage Usb Descriptor List Manage Usb Descriptor List
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -360,8 +360,8 @@ UsbParseConfigDesc (
Setting = UsbParseInterfaceDesc (DescBuf, Len, &Consumed); Setting = UsbParseInterfaceDesc (DescBuf, Len, &Consumed);
if (Setting == NULL) { if (Setting == NULL) {
DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: failed to parse interface setting\n")); DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: warning: failed to get interface setting, stop parsing now.\n"));
goto ON_ERROR; break;
} else if (Setting->Desc.InterfaceNumber >= NumIf) { } else if (Setting->Desc.InterfaceNumber >= NumIf) {
DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: mal-formated interface descriptor\n")); DEBUG (( EFI_D_ERROR, "UsbParseConfigDesc: mal-formated interface descriptor\n"));

View File

@ -2,7 +2,7 @@
Usb bus enumeration support. Usb bus enumeration support.
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR> Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -814,9 +814,6 @@ UsbEnumerateNewDev (
return EFI_SUCCESS; return EFI_SUCCESS;
ON_ERROR: ON_ERROR:
if (Address != Bus->MaxDevices) {
Bus->Devices[Address] = NULL;
}
if (Child != NULL) { if (Child != NULL) {
UsbFreeDevice (Child); UsbFreeDevice (Child);