]> git.proxmox.com Git - mirror_edk2.git/commitdiff
add comments to clarify the enhancement on EHCI driver, which is guaranteed to get...
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Aug 2009 05:55:14 +0000 (05:55 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Aug 2009 05:55:14 +0000 (05:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9040 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf

index c6c7e5a5195efc38e96803e778f5917c0c154f91..d6210255f4dcae47a9a5ccb6b077e419f92cc531 100644 (file)
@@ -1,7 +1,15 @@
-/** @file\r
-  \r
+/** @file  \r
   The Ehci controller driver.\r
 \r
+  EhciDxe driver is responsible for managing the behavior of EHCI controller. \r
+  It implements the interfaces of monitoring the status of all ports and transferring \r
+  Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.\r
+\r
+  Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached\r
+  to the EHCI controller before the UHCI driver attaches to the companion UHCI controller. \r
+  This way avoids the control transfer on a shared port between EHCI and companion host\r
+  controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.\r
+\r
 Copyright (c) 2006 - 2009, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -1570,6 +1578,9 @@ EhcDriverBindingStart (
     goto CLOSE_PCIIO;\r
   }\r
 \r
+  //\r
+  // Get the Pci device class code.\r
+  //\r
   Status = PciIo->Pci.Read (\r
                         PciIo,\r
                         EfiPciIoWidthUint8,\r
@@ -1582,7 +1593,11 @@ EhcDriverBindingStart (
     Status = EFI_UNSUPPORTED;\r
     goto CLOSE_PCIIO;\r
   }\r
-\r
+  //\r
+  // determine if the device is UHCI host controller or not. If yes, then find out the \r
+  // companion usb ehci host controller and force EHCI driver get attached to it before\r
+  // UHCI driver attaches to UHCI host controller.\r
+  //\r
   if ((UsbClassCReg.PI == PCI_IF_UHCI) &&\r
        (UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) && \r
        (UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {\r
@@ -1645,6 +1660,10 @@ EhcDriverBindingStart (
         if (EFI_ERROR (Status)) {\r
           goto CLOSE_PCIIO;\r
         }\r
+        //\r
+        // Currently, the judgment on the companion usb host controller is through the\r
+        // same bus number, which may vary on different platform.\r
+        //\r
         if (EhciBusNumber == UhciBusNumber) {\r
           gBS->CloseProtocol (\r
                     Controller,\r
index fd98e4200f007e4f6179d74f4b6624b1e85e3859..381f4bd4004db70e93b18296ac3387db7c73f11b 100644 (file)
@@ -6,6 +6,11 @@
 #  It implements the interfaces of monitoring the status of all ports and transferring \r
 #  Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.\r
 #\r
+#  Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached\r
+#  to the EHCI controller before the UHCI driver attaches to the companion UHCI controller. \r
+#  This way avoids the control transfer on a shared port between EHCI and companion host\r
+#  controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.\r
+#\r
 #  Copyright (c) 2006 - 2009, Intel Corporation. \r
 #\r
 #  All rights reserved. This program and the accompanying materials\r