summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
diff options
context:
space:
mode:
authorLinaro Packagers <linaro-pkg@lists.launchpad.net>2013-04-18 16:42:12 +0000
committerFathi Boudra <fathi.boudra@linaro.org>2013-04-20 10:20:05 +0300
commit0485fa28a08e3a1e6549dc4e28d5418212f89a14 (patch)
treea444ce65afaf7f43a8e0077681e107fb8c2e79b3 /MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
parent3ecb0687d28957a309ad40f47469ddd2e0ab5836 (diff)
parent60ea5c770707cf8e5be160aef2bb2f1e707e1926 (diff)
Imported Debian patch 1:0.1+git15+20130418+09259ca-0linaro1HEADdebian/1%0.1+git15+20130418+09259ca-0linaro1master
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
index 74de7d5d..0aa89617 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.<BR>
+Copyright (c) 2007 - 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
@@ -814,14 +814,20 @@ UsbEnumerateNewDev (
return EFI_SUCCESS;
ON_ERROR:
- if (Address != Bus->MaxDevices) {
- Bus->Devices[Address] = NULL;
- }
-
- if (Child != NULL) {
- UsbFreeDevice (Child);
- }
-
+ //
+ // If reach here, it means the enumeration process on a given port is interrupted due to error.
+ // The s/w resources, including the assigned address(Address) and the allocated usb device data
+ // structure(Bus->Devices[Address]), will NOT be freed here. These resources will be freed when
+ // the device is unplugged from the port or DriverBindingStop() is invoked.
+ //
+ // This way is used to co-work with the lower layer EDKII UHCI/EHCI/XHCI host controller driver.
+ // It's mainly because to keep UEFI spec unchanged EDKII XHCI driver have to maintain a state machine
+ // to keep track of the mapping between actual address and request address. If the request address
+ // (Address) is freed here, the Address value will be used by next enumerated device. Then EDKII XHCI
+ // host controller driver will have wrong information, which will cause further transaction error.
+ //
+ // EDKII UHCI/EHCI doesn't get impacted as it's make sense to reserve s/w resource till it gets unplugged.
+ //
return Status;
}