From: eric_tian Date: Tue, 11 Aug 2009 05:55:14 +0000 (+0000) Subject: add comments to clarify the enhancement on EHCI driver, which is guaranteed to get... X-Git-Tag: edk2-stable201903~17276 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=ba19956ac3c600eaeff1c90556457105032218d8 add comments to clarify the enhancement on EHCI driver, which is guaranteed to get attached to EHCI host controller before UHCI driver attaches to uhci host controller. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9040 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c index c6c7e5a519..d6210255f4 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c @@ -1,7 +1,15 @@ -/** @file - +/** @file The Ehci controller driver. + EhciDxe driver is responsible for managing the behavior of EHCI controller. + It implements the interfaces of monitoring the status of all ports and transferring + Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device. + + Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached + to the EHCI controller before the UHCI driver attaches to the companion UHCI controller. + This way avoids the control transfer on a shared port between EHCI and companion host + controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts. + Copyright (c) 2006 - 2009, 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 @@ -1570,6 +1578,9 @@ EhcDriverBindingStart ( goto CLOSE_PCIIO; } + // + // Get the Pci device class code. + // Status = PciIo->Pci.Read ( PciIo, EfiPciIoWidthUint8, @@ -1582,7 +1593,11 @@ EhcDriverBindingStart ( Status = EFI_UNSUPPORTED; goto CLOSE_PCIIO; } - + // + // determine if the device is UHCI host controller or not. If yes, then find out the + // companion usb ehci host controller and force EHCI driver get attached to it before + // UHCI driver attaches to UHCI host controller. + // if ((UsbClassCReg.PI == PCI_IF_UHCI) && (UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) && (UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) { @@ -1645,6 +1660,10 @@ EhcDriverBindingStart ( if (EFI_ERROR (Status)) { goto CLOSE_PCIIO; } + // + // Currently, the judgment on the companion usb host controller is through the + // same bus number, which may vary on different platform. + // if (EhciBusNumber == UhciBusNumber) { gBS->CloseProtocol ( Controller, diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf index fd98e4200f..381f4bd400 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf @@ -6,6 +6,11 @@ # It implements the interfaces of monitoring the status of all ports and transferring # Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device. # +# Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached +# to the EHCI controller before the UHCI driver attaches to the companion UHCI controller. +# This way avoids the control transfer on a shared port between EHCI and companion host +# controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts. +# # Copyright (c) 2006 - 2009, Intel Corporation. # # All rights reserved. This program and the accompanying materials