]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Remove USB HC Protocol installing from Uhci module. It only installs USB2 HC protocol.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 23 Jan 2008 09:41:04 +0000 (09:41 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 23 Jan 2008 09:41:04 +0000 (09:41 +0000)
2. Restore Incompatible Pci Device Support Protocol in PciBus module.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4617 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.c
IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/pcibus.h
MdeModulePkg/Bus/Pci/UhciDxe/ComponentName.c
MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h
MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
MdeModulePkg/Bus/Pci/UhciDxe/UhciReg.c

index 3e43bc73284fd2dd609c73b9b2f50684429af162..beb9bfcd8079bc462a2b7766ed6131928c1e4579 100644 (file)
@@ -32,8 +32,8 @@
 #\r
 #  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
 #\r
-#  DRIVER_BINDING                =  gPciBusDriverBinding                         \r
-#  COMPONENT_NAME                =  gPciBusComponentName                         \r
+#  DRIVER_BINDING                =  gPciBusDriverBinding\r
+#  COMPONENT_NAME                =  gPciBusComponentName\r
 #\r
 \r
 [Sources.common]\r
   gEfiPciPlatformProtocolGuid                   # PROTOCOL TO_START\r
   gEfiPciRootBridgeIoProtocolGuid               # PROTOCOL TO_START\r
   gEfiDevicePathProtocolGuid                    # PROTOCOL TO_START\r
+  gEfiIncompatiblePciDeviceSupportProtocolGuid  # PROTOCOL TO_START\r
 \r
 \r
 [FeaturePcd.common]\r
index 4c9c800147655acca84c50d9b2a27a0201254b4b..be316effdc8bc52e19fe5a9d8d6eece3f14b47ba 100644 (file)
@@ -1,13 +1,13 @@
 /**@file\r
 \r
-Copyright (c) 2006, 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
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006, 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
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
@@ -294,9 +294,7 @@ Returns:
   //\r
   // Update the bar information for this PCI device so as to support some specific device\r
   //\r
-  if (PcdGet8 (PcdPciIncompatibleDeviceSupportMask) & PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT) {\r
-    UpdatePciInfo (PciIoDevice);\r
-  }\r
+  UpdatePciInfo (PciIoDevice);\r
 \r
   if (PciIoDevice->DevicePath == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
@@ -1216,21 +1214,54 @@ Returns:
   EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;\r
 \r
   Configuration = NULL;\r
+  Status        = EFI_SUCCESS;\r
 \r
-  //\r
-  // Check whether the device belongs to incompatible devices or not\r
-  // If it is , then get its special requirement in the ACPI table\r
-  //\r
-  PciDeviceInfo.VendorID          = PciIoDevice->Pci.Hdr.VendorId;\r
-  PciDeviceInfo.DeviceID          = PciIoDevice->Pci.Hdr.DeviceId;\r
-  PciDeviceInfo.RevisionID        = PciIoDevice->Pci.Hdr.RevisionID;\r
-  PciDeviceInfo.SubsystemVendorID = PciIoDevice->Pci.Device.SubsystemVendorID;\r
-  PciDeviceInfo.SubsystemID       = PciIoDevice->Pci.Device.SubsystemID;\r
+  if (gEfiIncompatiblePciDeviceSupport == NULL) {\r
+    //\r
+    // It can only be supported after the Incompatible PCI Device\r
+    // Support Protocol has been installed\r
+    //\r
+    Status = gBS->LocateProtocol (\r
+                    &gEfiIncompatiblePciDeviceSupportProtocolGuid,\r
+                    NULL,\r
+                    (VOID **) &gEfiIncompatiblePciDeviceSupport\r
+                    );\r
+  }\r
+  if (Status == EFI_SUCCESS) {\r
+      //\r
+      // Check whether the device belongs to incompatible devices from protocol or not\r
+      // If it is , then get its special requirement in the ACPI table\r
+      //\r
+      Status = gEfiIncompatiblePciDeviceSupport->CheckDevice (\r
+                                                  gEfiIncompatiblePciDeviceSupport,\r
+                                                  PciIoDevice->Pci.Hdr.VendorId,\r
+                                                  PciIoDevice->Pci.Hdr.DeviceId,\r
+                                                  PciIoDevice->Pci.Hdr.RevisionID,\r
+                                                  PciIoDevice->Pci.Device.SubsystemVendorID,\r
+                                                  PciIoDevice->Pci.Device.SubsystemID,\r
+                                                  &Configuration\r
+                                                  );\r
 \r
-  Status = PciResourceUpdateCheck (&PciDeviceInfo, &Configuration);\r
+  }\r
 \r
   if (EFI_ERROR (Status)) {\r
-    return Status;\r
+    //\r
+    // Check whether the device belongs to incompatible devices from library or not\r
+    // If it is , then get its special requirement in the ACPI table\r
+    //\r
+    if (PcdGet8 (PcdPciIncompatibleDeviceSupportMask) & PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT) {\r
+      PciDeviceInfo.VendorID          = PciIoDevice->Pci.Hdr.VendorId;\r
+      PciDeviceInfo.DeviceID          = PciIoDevice->Pci.Hdr.DeviceId;\r
+      PciDeviceInfo.RevisionID        = PciIoDevice->Pci.Hdr.RevisionID;\r
+      PciDeviceInfo.SubsystemVendorID = PciIoDevice->Pci.Device.SubsystemVendorID;\r
+      PciDeviceInfo.SubsystemID       = PciIoDevice->Pci.Device.SubsystemID;\r
+\r
+      Status = PciResourceUpdateCheck (&PciDeviceInfo, &Configuration);\r
+    }\r
+  }\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_UNSUPPORTED;\r
   }\r
 \r
   //\r
index ebf817b96fd1f327c9064c3cccc8d200fcae298d..a8e50fcb284e8affaa0dc4a5cda90618b6ab6e17 100644 (file)
@@ -27,6 +27,7 @@ EFI_DRIVER_BINDING_PROTOCOL                   gPciBusDriverBinding = {
   NULL\r
 };\r
 \r
+EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL  *gEfiIncompatiblePciDeviceSupport = NULL;\r
 EFI_HANDLE                                    gPciHostBrigeHandles[PCI_MAX_HOST_BRIDGE_NUM];\r
 UINTN                                         gPciHostBridgeNumber;\r
 BOOLEAN                                       gFullEnumeration;\r
@@ -215,6 +216,12 @@ Returns:
 {\r
   EFI_STATUS  Status;\r
 \r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiIncompatiblePciDeviceSupportProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) &gEfiIncompatiblePciDeviceSupport\r
+                  );\r
+\r
   //\r
   // If PCI Platform protocol is available, get it now.\r
   // If the platform implements this, it must be installed before BDS phase\r
index 448a9dbb16b2e5304986388109badc8cb9c6c01b..9db1dde553fd2b0473a6231805f96c88377385ff 100644 (file)
@@ -1,13 +1,13 @@
 /**@file\r
 \r
-Copyright (c) 2006, 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
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006, 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
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
@@ -32,6 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/PciOptionRomTable.h>\r
 #include <Protocol/BusSpecificDriverOverride.h>\r
 #include <Protocol/UgaIo.h>\r
+#include <Protocol/IncompatiblePciDeviceSupport.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
@@ -237,6 +238,7 @@ typedef struct _PCI_IO_DEVICE {
 //\r
 // Global Variables\r
 //\r
+extern EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *gEfiIncompatiblePciDeviceSupport;\r
 extern EFI_DRIVER_BINDING_PROTOCOL                  gPciBusDriverBinding;\r
 extern EFI_COMPONENT_NAME_PROTOCOL                  gPciBusComponentName;\r
 extern EFI_COMPONENT_NAME2_PROTOCOL                 gPciBusComponentName2;\r
index 6be0e73b909122da22f1dcbe2a8b57bec8a26fd2..732dc6af4f3225000ba81c38ad1081ce6bdd1587 100644 (file)
@@ -308,9 +308,9 @@ UhciComponentNameGetControllerName (
   OUT CHAR16                                          **ControllerName\r
   )\r
 {\r
-  EFI_STATUS          Status;\r
-  USB_HC_DEV          *UhciDev;\r
-  EFI_USB_HC_PROTOCOL *UsbHc;\r
+  EFI_STATUS           Status;\r
+  USB_HC_DEV           *UhciDev;\r
+  EFI_USB2_HC_PROTOCOL *Usb2Hc;\r
 \r
   //\r
   // This is a device driver, so ChildHandle must be NULL.\r
@@ -336,8 +336,8 @@ UhciComponentNameGetControllerName (
   //\r
   Status = gBS->OpenProtocol (\r
                   ControllerHandle,\r
-                  &gEfiUsbHcProtocolGuid,\r
-                  (VOID **) &UsbHc,\r
+                  &gEfiUsb2HcProtocolGuid,\r
+                  (VOID **) &Usb2Hc,\r
                   gUhciDriverBinding.DriverBindingHandle,\r
                   ControllerHandle,\r
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
@@ -347,7 +347,7 @@ UhciComponentNameGetControllerName (
     return Status;\r
   }\r
 \r
-  UhciDev = UHC_FROM_USB_HC_PROTO (UsbHc);\r
+  UhciDev = UHC_FROM_USB2_HC_PROTO (Usb2Hc);\r
 \r
   return LookupUnicodeString2 (\r
            Language,\r
index b52510041f8e6ecf531a055eba806a4fd9e18af8..487ca0360cc2fdd11b53ef007fbcda221e1c99f6 100644 (file)
@@ -24,32 +24,38 @@ Revision History
 \r
 #include "Uhci.h"\r
 \r
-\r
 /**\r
-  Provides software reset for the USB host controller.\r
+  Provides software reset for the USB host controller according to UEFI 2.0 spec.\r
 \r
-  This      : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  Attributes: A bit mask of the reset operation to perform.\r
+  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  Attributes           A bit mask of the reset operation to perform.  See\r
+                               below for a list of the supported bit mask values.\r
 \r
   @return EFI_SUCCESS           : The reset operation succeeded.\r
   @return EFI_INVALID_PARAMETER : Attributes is not valid.\r
-  @return EFI_DEVICE_ERROR      : An error was encountered while attempting\r
-  @return to perform the reset operation.\r
+  @return EFI_UNSUPPORTED       : This type of reset is not currently supported\r
+  @return EFI_DEVICE_ERROR      : Other errors\r
 \r
 **/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciReset (\r
-  IN EFI_USB_HC_PROTOCOL     *This,\r
-  IN UINT16                  Attributes\r
+Uhci2Reset (\r
+  IN EFI_USB2_HC_PROTOCOL   *This,\r
+  IN UINT16                 Attributes\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
   EFI_TPL             OldTpl;\r
 \r
+  if ((Attributes == EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG) ||\r
+      (Attributes == EFI_USB_HC_RESET_HOST_WITH_DEBUG)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
+\r
   OldTpl  = gBS->RaiseTPL (UHCI_TPL);\r
-  Uhc     = UHC_FROM_USB_HC_PROTO (This);\r
 \r
   switch (Attributes) {\r
   case EFI_USB_HC_RESET_GLOBAL:\r
@@ -104,23 +110,22 @@ ON_INVAILD_PARAMETER:
 \r
 \r
 /**\r
-  Retrieves current state of the USB host controller.\r
+  Retrieves current state of the USB host controller according to UEFI 2.0 spec.\r
 \r
-  This    :  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  State   :  A pointer to the EFI_USB_HC_STATE data structure that\r
-  indicates current state of the USB host controller.\r
+  @param  This                 A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  State                Variable to receive current device state\r
 \r
-  @return EFI_SUCCESS           : State was returned\r
-  @return EFI_INVALID_PARAMETER : State is NULL.\r
-  @return EFI_DEVICE_ERROR      : An error was encountered\r
+  @return EFI_SUCCESS           : The state is returned\r
+  @return EFI_INVALID_PARAMETER : State is not valid.\r
+  @return EFI_DEVICE_ERROR      : Other errors2006\r
 \r
 **/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciGetState (\r
-  IN  EFI_USB_HC_PROTOCOL     *This,\r
-  OUT EFI_USB_HC_STATE        *State\r
+Uhci2GetState (\r
+  IN CONST EFI_USB2_HC_PROTOCOL   *This,\r
+  OUT      EFI_USB_HC_STATE       *State\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
@@ -131,7 +136,7 @@ UhciGetState (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  Uhc     = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
 \r
   UsbCmd  = UhciReadReg (Uhc->PciIo, USBCMD_OFFSET);\r
   UsbSts  = UhciReadReg (Uhc->PciIo, USBSTS_OFFSET);\r
@@ -151,21 +156,22 @@ UhciGetState (
 \r
 \r
 /**\r
-  Sets the USB host controller to a specific state.\r
+  Sets the USB host controller to a specific state according to UEFI 2.0 spec.\r
 \r
-  This     : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  State    : Indicates the state of the host controller that will be set.\r
+  @param  This                 A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  State                Indicates the state of the host controller that will\r
+                               be set.\r
 \r
-  @return EFI_SUCCESS           : The USB host controller was successfully set\r
+  @return EFI_SUCCESS           : Host controller was successfully placed in the state\r
   @return EFI_INVALID_PARAMETER : State is invalid.\r
-  @return EFI_DEVICE_ERROR      : Failed to set the state specified\r
+  @return EFI_DEVICE_ERROR      : Failed to set the state\r
 \r
 **/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciSetState (\r
-  IN EFI_USB_HC_PROTOCOL     *This,\r
+Uhci2SetState (\r
+  IN EFI_USB2_HC_PROTOCOL    *This,\r
   IN EFI_USB_HC_STATE        State\r
   )\r
 {\r
@@ -175,8 +181,8 @@ UhciSetState (
   EFI_STATUS          Status;\r
   UINT16              UsbCmd;\r
 \r
-  Uhc     = UHC_FROM_USB_HC_PROTO (This);\r
-  Status  = UhciGetState (This, &CurState);\r
+  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
+  Status  = Uhci2GetState (This, &CurState);\r
 \r
   if (EFI_ERROR (Status)) {\r
     return EFI_DEVICE_ERROR;\r
@@ -231,7 +237,7 @@ UhciSetState (
     break;\r
 \r
   case EfiUsbHcStateSuspend:\r
-    Status = UhciSetState (This, EfiUsbHcStateHalt);\r
+    Status = Uhci2SetState (This, EfiUsbHcStateHalt);\r
 \r
     if (EFI_ERROR (Status)) {\r
       Status = EFI_DEVICE_ERROR;\r
@@ -256,24 +262,29 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-\r
 /**\r
-  Retrieves the number of root hub ports.\r
+  Retrieves capabilities of USB host controller according to UEFI 2.0 spec.\r
 \r
-  This       : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  PortNumber : A pointer to the number of the root hub ports.\r
+  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL instance\r
+  @param  MaxSpeed             A pointer to the max speed USB host controller\r
+                               supports.\r
+  @param  PortNumber           A pointer to the number of root hub ports.\r
+  @param  Is64BitCapable       A pointer to an integer to show whether USB host\r
+                               controller supports 64-bit memory addressing.\r
 \r
-  @return EFI_SUCCESS           : The port number was retrieved successfully.\r
-  @return EFI_INVALID_PARAMETER : PortNumber is NULL.\r
+  @return EFI_SUCCESS           : capabilities were retrieved successfully.\r
+  @return EFI_INVALID_PARAMETER : MaxSpeed or PortNumber or Is64BitCapable is NULL.\r
   @return EFI_DEVICE_ERROR      : An error was encountered\r
 \r
 **/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciGetRootHubPortNumber (\r
-  IN  EFI_USB_HC_PROTOCOL     *This,\r
-  OUT UINT8                   *PortNumber\r
+Uhci2GetCapability (\r
+  IN  EFI_USB2_HC_PROTOCOL  *This,\r
+  OUT UINT8                 *MaxSpeed,\r
+  OUT UINT8                 *PortNumber,\r
+  OUT UINT8                 *Is64BitCapable\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
@@ -281,12 +292,15 @@ UhciGetRootHubPortNumber (
   UINT16              PortSC;\r
   UINT32              Index;\r
 \r
-  Uhc = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
 \r
-  if (PortNumber == NULL) {\r
+  if ((NULL == MaxSpeed) || (NULL == PortNumber) || (NULL == Is64BitCapable)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  *MaxSpeed       = EFI_USB_SPEED_FULL;\r
+  *Is64BitCapable = (UINT8) FALSE;\r
+\r
   *PortNumber = 0;\r
 \r
   for (Index = 0; Index < USB_MAX_ROOTHUB_PORT; Index++) {\r
@@ -306,36 +320,38 @@ UhciGetRootHubPortNumber (
 \r
   Uhc->RootPorts = *PortNumber;\r
 \r
-  UHCI_DEBUG (("UhciGetRootHubPortNumber: %d ports\n", Uhc->RootPorts));\r
+  UHCI_DEBUG (("Uhci2GetCapability: %d ports\n", Uhc->RootPorts));\r
   return EFI_SUCCESS;\r
 }\r
 \r
 \r
 /**\r
-  Retrieves the current status of a USB root hub port.\r
+  Retrieves the current status of a USB root hub port according to UEFI 2.0 spec.\r
 \r
-  This        : A pointer to the EFI_USB_HC_PROTOCOL.\r
-  PortNumber  : Specifies the root hub port. This value is zero-based.\r
-  PortStatus  : A pointer to the current port status bits and port status change bits.\r
+  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL.\r
+  @param  PortNumber           The port to get status\r
+  @param  PortStatus           A pointer to the current port status bits and  port\r
+                               status change bits.\r
 \r
-  @return EFI_SUCCESS           : The port status was returned in PortStatus.\r
+  @return EFI_SUCCESS           : status of the USB root hub port was returned in PortStatus.\r
   @return EFI_INVALID_PARAMETER : PortNumber is invalid.\r
   @return EFI_DEVICE_ERROR      : Can't read register\r
 \r
 **/\r
+STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciGetRootHubPortStatus (\r
-  IN  EFI_USB_HC_PROTOCOL     *This,\r
-  IN  UINT8                   PortNumber,\r
-  OUT EFI_USB_PORT_STATUS     *PortStatus\r
+Uhci2GetRootHubPortStatus (\r
+  IN  CONST EFI_USB2_HC_PROTOCOL   *This,\r
+  IN  CONST UINT8                  PortNumber,\r
+  OUT       EFI_USB_PORT_STATUS    *PortStatus\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
   UINT32              Offset;\r
   UINT16              PortSC;\r
 \r
-  Uhc = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
 \r
   if (PortStatus == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -360,7 +376,7 @@ UhciGetRootHubPortStatus (
   }\r
 \r
   if (PortSC & USBPORTSC_SUSP) {\r
-    UHCI_DEBUG (("UhciGetRootHubPortStatus: port %d is suspended\n", PortNumber));\r
+    UHCI_DEBUG (("Uhci2GetRootHubPortStatus: port %d is suspended\n", PortNumber));\r
     PortStatus->PortStatus |= USB_PORT_STAT_SUSPEND;\r
   }\r
 \r
@@ -390,15 +406,15 @@ UhciGetRootHubPortStatus (
 \r
 \r
 /**\r
-  Sets a feature for the specified root hub port.\r
+  Sets a feature for the specified root hub port according to UEFI 2.0 spec.\r
 \r
-  This        : A pointer to the EFI_USB_HC_PROTOCOL.\r
-  PortNumber  : Specifies the root hub port whose feature\r
-  is requested to be set.\r
-  PortFeature : Indicates the feature selector associated\r
-  with the feature set request.\r
+  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL.\r
+  @param  PortNumber           Specifies the root hub port whose feature  is\r
+                               requested to be set.\r
+  @param  PortFeature          Indicates the feature selector associated  with the\r
+                               feature set request.\r
 \r
-  @return EFI_SUCCESS           : The feature was set for the port.\r
+  @return EFI_SUCCESS           : PortFeature was set for the root port\r
   @return EFI_INVALID_PARAMETER : PortNumber is invalid or PortFeature is invalid.\r
   @return EFI_DEVICE_ERROR      : Can't read register\r
 \r
@@ -406,10 +422,10 @@ UhciGetRootHubPortStatus (
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciSetRootHubPortFeature (\r
-  IN  EFI_USB_HC_PROTOCOL     *This,\r
-  IN  UINT8                   PortNumber,\r
-  IN  EFI_USB_PORT_FEATURE    PortFeature\r
+Uhci2SetRootHubPortFeature (\r
+  IN EFI_USB2_HC_PROTOCOL    *This,\r
+  IN UINT8                   PortNumber,\r
+  IN EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
@@ -418,7 +434,7 @@ UhciSetRootHubPortFeature (
   UINT16              PortSC;\r
   UINT16              Command;\r
 \r
-  Uhc = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
 \r
   if (PortNumber >= Uhc->RootPorts) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -470,15 +486,15 @@ UhciSetRootHubPortFeature (
 \r
 \r
 /**\r
-  Clears a feature for the specified root hub port.\r
+  Clears a feature for the specified root hub port according to Uefi 2.0 spec.\r
 \r
-  This        : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  PortNumber  : Specifies the root hub port whose feature\r
-  is requested to be cleared.\r
-  PortFeature : Indicates the feature selector associated with the\r
-  feature clear request.\r
+  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  PortNumber           Specifies the root hub port whose feature  is\r
+                               requested to be cleared.\r
+  @param  PortFeature          Indicates the feature selector associated with the\r
+                               feature clear request.\r
 \r
-  @return EFI_SUCCESS           : The feature was cleared for the port.\r
+  @return EFI_SUCCESS           : PortFeature was cleared for the USB root hub port\r
   @return EFI_INVALID_PARAMETER : PortNumber is invalid or PortFeature is invalid.\r
   @return EFI_DEVICE_ERROR      : Can't read register\r
 \r
@@ -486,10 +502,10 @@ UhciSetRootHubPortFeature (
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciClearRootHubPortFeature (\r
-  IN  EFI_USB_HC_PROTOCOL     *This,\r
-  IN  UINT8                   PortNumber,\r
-  IN  EFI_USB_PORT_FEATURE    PortFeature\r
+Uhci2ClearRootHubPortFeature (\r
+  IN EFI_USB2_HC_PROTOCOL    *This,\r
+  IN UINT8                   PortNumber,\r
+  IN EFI_USB_PORT_FEATURE    PortFeature\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
@@ -497,7 +513,7 @@ UhciClearRootHubPortFeature (
   UINT32              Offset;\r
   UINT16              PortSC;\r
 \r
-  Uhc = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
 \r
   if (PortNumber >= Uhc->RootPorts) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -574,21 +590,21 @@ UhciClearRootHubPortFeature (
 \r
 \r
 /**\r
-  Submits control transfer to a target USB device.\r
+  Submits control transfer to a target USB device accroding to UEFI 2.0 spec..\r
 \r
-  This                : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  DeviceAddress       : Usb device address\r
-  IsSlowDevice        : Whether the device is of slow speed or full speed\r
-  MaximumPacketLength : maximum packet size of the default control endpoint\r
+  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  DeviceAddress       : Target device address\r
+  DeviceSpeed         : Device speed\r
+  MaximumPacketLength : Maximum packet size of the target endpoint\r
   Request             : USB device request to send\r
-  TransferDirection   : Specifies the data direction for the transfer.\r
-  Data                : Data buffer to transmit from or receive into\r
-  DataLength          : Number of bytes of the data\r
-  TimeOut             : Maximum time, in microseconds\r
-  TransferResult      : Return result in this\r
+  TransferDirection   : Data direction of the Data stage in control transfer\r
+  Data                : Data to transmit/receive in data stage\r
+  DataLength          : Length of the data\r
+  TimeOut             : Maximum time, in microseconds, for transfer to complete.\r
+  TransferResult      : Variable to receive the transfer result\r
 \r
-  @return EFI_SUCCESS           : Transfer was completed successfully.\r
-  @return EFI_OUT_OF_RESOURCES  : Failed due to a lack of resources.\r
+  @return EFI_SUCCESS           : The control transfer was completed successfully.\r
+  @return EFI_OUT_OF_RESOURCES  : Failed due to lack of resource.\r
   @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
   @return EFI_TIMEOUT           : Failed due to timeout.\r
   @return EFI_DEVICE_ERROR      : Failed due to host controller or device error.\r
@@ -597,17 +613,18 @@ UhciClearRootHubPortFeature (
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciControlTransfer (\r
-  IN       EFI_USB_HC_PROTOCOL        *This,\r
-  IN       UINT8                      DeviceAddress,\r
-  IN       BOOLEAN                    IsSlowDevice,\r
-  IN       UINT8                      MaximumPacketLength,\r
-  IN       EFI_USB_DEVICE_REQUEST     *Request,\r
-  IN       EFI_USB_DATA_DIRECTION     TransferDirection,\r
-  IN OUT   VOID                       *Data,              OPTIONAL\r
-  IN OUT   UINTN                      *DataLength,        OPTIONAL\r
-  IN       UINTN                      TimeOut,\r
-  OUT      UINT32                     *TransferResult\r
+Uhci2ControlTransfer (\r
+  IN     EFI_USB2_HC_PROTOCOL                 *This,\r
+  IN     UINT8                                DeviceAddress,\r
+  IN     UINT8                                DeviceSpeed,\r
+  IN     UINTN                                MaximumPacketLength,\r
+  IN     EFI_USB_DEVICE_REQUEST               *Request,\r
+  IN     EFI_USB_DATA_DIRECTION               TransferDirection,\r
+  IN OUT VOID                                 *Data,\r
+  IN OUT UINTN                                *DataLength,\r
+  IN     UINTN                                TimeOut,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR   *Translator,\r
+  OUT    UINT32                               *TransferResult\r
   )\r
 {\r
   USB_HC_DEV              *Uhc;\r
@@ -620,14 +637,17 @@ UhciControlTransfer (
   VOID                    *RequestMap;\r
   UINT8                   *DataPhy;\r
   VOID                    *DataMap;\r
+  BOOLEAN                 IsSlowDevice;\r
 \r
-  Uhc         = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc         = UHC_FROM_USB2_HC_PROTO (This);\r
   TDs         = NULL;\r
   DataPhy     = NULL;\r
   DataMap     = NULL;\r
   RequestPhy  = NULL;\r
   RequestMap  = NULL;\r
 \r
+  IsSlowDevice  = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
+\r
   //\r
   // Parameters Checking\r
   //\r
@@ -688,7 +708,7 @@ UhciControlTransfer (
           RequestPhy,\r
           DataPhy,\r
           *DataLength,\r
-          MaximumPacketLength,\r
+          (UINT8) MaximumPacketLength,\r
           IsSlowDevice\r
           );\r
 \r
@@ -726,18 +746,23 @@ ON_EXIT:
 }\r
 \r
 \r
+\r
 /**\r
-  Submits bulk transfer to a bulk endpoint of a USB device.\r
+  Submits bulk transfer to a bulk endpoint of a USB device\r
 \r
-  This                :A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  DeviceAddress       : Usb device address\r
-  EndPointAddress     : Endpoint number and endpoint direction\r
+  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  DeviceAddress       : Target device address\r
+  EndPointAddress     : Endpoint number and direction\r
+  DeviceSpeed         : Device speed\r
   MaximumPacketLength : Maximum packet size of the target endpoint\r
-  Data                : Data buffer to transmit from or receive into\r
-  DataLength          : Length of the data buffer\r
-  DataToggle          : On input, data toggle to use, on output, the next toggle\r
-  TimeOut             : Indicates the maximum time\r
-  TransferResult      : Variable to receive the transfer result\r
+  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
+  Data                : Array of pointers to the buffers of data\r
+  DataLength          : On input, size of the data buffer, On output,\r
+  actually transferred data size.\r
+  DataToggle          : On input, data toggle to use; On output, next data toggle\r
+  Translator          : A pointr to the transaction translator data.\r
+  TimeOut             : Maximum time out, in microseconds\r
+  TransferResult      : Variable to receive transfer result\r
 \r
   @return EFI_SUCCESS           : The bulk transfer was completed successfully.\r
   @return EFI_OUT_OF_RESOURCES  : Failed due to lack of resource.\r
@@ -749,16 +774,19 @@ ON_EXIT:
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciBulkTransfer (\r
-  IN       EFI_USB_HC_PROTOCOL     *This,\r
-  IN       UINT8                   DeviceAddress,\r
-  IN       UINT8                   EndPointAddress,\r
-  IN       UINT8                   MaximumPacketLength,\r
-  IN OUT   VOID                    *Data,\r
-  IN OUT   UINTN                   *DataLength,\r
-  IN OUT   UINT8                   *DataToggle,\r
-  IN       UINTN                   TimeOut,\r
-  OUT      UINT32                  *TransferResult\r
+Uhci2BulkTransfer (\r
+  IN     EFI_USB2_HC_PROTOCOL               *This,\r
+  IN     UINT8                              DeviceAddress,\r
+  IN     UINT8                              EndPointAddress,\r
+  IN     UINT8                              DeviceSpeed,\r
+  IN     UINTN                              MaximumPacketLength,\r
+  IN     UINT8                              DataBuffersNumber,\r
+  IN OUT VOID                               *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r
+  IN OUT UINTN                              *DataLength,\r
+  IN OUT UINT8                              *DataToggle,\r
+  IN     UINTN                              TimeOut,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+  OUT    UINT32                             *TransferResult\r
   )\r
 {\r
   EFI_USB_DATA_DIRECTION  Direction;\r
@@ -772,10 +800,14 @@ UhciBulkTransfer (
   UINT8                   *DataPhy;\r
   VOID                    *DataMap;\r
 \r
-  Uhc     = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
   DataPhy = NULL;\r
   DataMap = NULL;\r
 \r
+  if (DeviceSpeed == EFI_USB_SPEED_LOW) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   if ((DataLength == NULL) || (Data == NULL) || (TransferResult == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -818,7 +850,7 @@ UhciBulkTransfer (
     Direction = EfiUsbDataOut;\r
   }\r
 \r
-  Status = UhciMapUserData (Uhc, Direction, Data, DataLength, &PktId, &DataPhy, &DataMap);\r
+  Status = UhciMapUserData (Uhc, Direction, *Data, DataLength, &PktId, &DataPhy, &DataMap);\r
 \r
   if (EFI_ERROR (Status)) {\r
     goto ON_EXIT;\r
@@ -833,7 +865,7 @@ UhciBulkTransfer (
              DataPhy,\r
              *DataLength,\r
              DataToggle,\r
-             MaximumPacketLength,\r
+             (UINT8) MaximumPacketLength,\r
              FALSE\r
              );\r
 \r
@@ -870,45 +902,49 @@ ON_EXIT:
 \r
 \r
 /**\r
-  Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+  Submits an asynchronous interrupt transfer to an\r
+  interrupt endpoint of a USB device according to UEFI 2.0 spec.\r
 \r
-  This                : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
   DeviceAddress       : Target device address\r
-  EndPointAddress     : Endpoint number with direction\r
-  IsSlowDevice        : Whether the target device is slow device or full-speed device.\r
+  EndPointAddress     : Endpoint number and direction\r
+  DeviceSpeed         : Device speed\r
   MaximumPacketLength : Maximum packet size of the target endpoint\r
-  IsNewTransfer       : If TRUE, submit a new async interrupt transfer, otherwise\r
-  cancel an existed one\r
-  DataToggle          : On input, the data toggle to use; On output, next data toggle\r
+  IsNewTransfer       : If TRUE, submit a new transfer, if FALSE cancel old transfer\r
+  DataToggle          : On input, data toggle to use; On output, next data toggle\r
   PollingInterval     : Interrupt poll rate in milliseconds\r
-  DataLength          : Length of data to receive\r
+  DataLength          : On input, size of the data buffer, On output,\r
+  actually transferred data size.\r
+  Translator          : A pointr to the transaction translator data.\r
   CallBackFunction    : Function to call periodically\r
   Context             : User context\r
 \r
-  @return EFI_SUCCESS           : Request is submitted or cancelled\r
+  @return EFI_SUCCESS           : Transfer was submitted\r
   @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
   @return EFI_OUT_OF_RESOURCES  : Failed due to a lack of resources.\r
-  @return EFI_DEVICE_ERROR      : Failed to due to device error\r
+  @return EFI_DEVICE_ERROR      : Can't read register\r
 \r
 **/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciAsyncInterruptTransfer (\r
-  IN     EFI_USB_HC_PROTOCOL                * This,\r
+Uhci2AsyncInterruptTransfer (\r
+  IN     EFI_USB2_HC_PROTOCOL               *This,\r
   IN     UINT8                              DeviceAddress,\r
   IN     UINT8                              EndPointAddress,\r
-  IN     BOOLEAN                            IsSlowDevice,\r
-  IN     UINT8                              MaximumPacketLength,\r
+  IN     UINT8                              DeviceSpeed,\r
+  IN     UINTN                              MaximumPacketLength,\r
   IN     BOOLEAN                            IsNewTransfer,\r
   IN OUT UINT8                              *DataToggle,\r
-  IN     UINTN                              PollingInterval,    OPTIONAL\r
-  IN     UINTN                              DataLength,         OPTIONAL\r
-  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK    CallBackFunction,   OPTIONAL\r
-  IN     VOID                               *Context OPTIONAL\r
+  IN     UINTN                              PollingInterval,\r
+  IN     UINTN                              DataLength,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK    CallBackFunction,\r
+  IN     VOID                               *Context\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
+  BOOLEAN             IsSlowDevice;\r
   UHCI_QH_SW          *Qh;\r
   UHCI_TD_SW          *IntTds;\r
   EFI_TPL             OldTpl;\r
@@ -918,13 +954,15 @@ UhciAsyncInterruptTransfer (
   VOID                *DataMap;\r
   UINT8               PktId;\r
 \r
-  Uhc       = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc       = UHC_FROM_USB2_HC_PROTO (This);\r
   Qh        = NULL;\r
   IntTds    = NULL;\r
   DataPtr   = NULL;\r
   DataPhy   = NULL;\r
   DataMap   = NULL;\r
 \r
+  IsSlowDevice  = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
+\r
   if ((EndPointAddress & 0x80) == 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -1006,7 +1044,7 @@ UhciAsyncInterruptTransfer (
              DataPhy,\r
              DataLength,\r
              DataToggle,\r
-             MaximumPacketLength,\r
+             (UINT8) MaximumPacketLength,\r
              IsSlowDevice\r
              );\r
 \r
@@ -1059,43 +1097,46 @@ FREE_DATA:
   return Status;\r
 }\r
 \r
-\r
 /**\r
-  Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+  Submits synchronous interrupt transfer to an interrupt endpoint\r
+  of a USB device according to UEFI 2.0 spec.\r
 \r
-  This                : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  DeviceAddress       : Device address of the target USB device\r
+  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  DeviceAddress       : Target device address\r
   EndPointAddress     : Endpoint number and direction\r
-  IsSlowDevice        : Whether the target device is of slow speed or full speed\r
-  MaximumPacketLength : Maximum packet size of target endpoint\r
-  Data                : Data to transmit or receive\r
-  DataLength          : On input, data length to transmit or buffer size.\r
-  On output, the number of bytes transferred.\r
+  DeviceSpeed         : Device speed\r
+  MaximumPacketLength : Maximum packet size of the target endpoint\r
+  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
+  Data                : Array of pointers to the buffers of data\r
+  DataLength          : On input, size of the data buffer, On output,\r
+  actually transferred data size.\r
   DataToggle          : On input, data toggle to use; On output, next data toggle\r
-  TimeOut             : Maximum time, in microseconds, transfer is allowed to complete.\r
+  TimeOut             : Maximum time out, in microseconds\r
+  Translator          : A pointr to the transaction translator data.\r
   TransferResult      : Variable to receive transfer result\r
 \r
-  @return EFI_SUCCESS           : Transfer was completed successfully.\r
+  @return EFI_SUCCESS           : The transfer was completed successfully.\r
   @return EFI_OUT_OF_RESOURCES  : Failed due to lack of resource.\r
   @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
   @return EFI_TIMEOUT           : Failed due to timeout.\r
-  @return EFI_DEVICE_ERROR      : Failed due to host controller or device error\r
+  @return EFI_DEVICE_ERROR      : Failed due to host controller or device error.\r
 \r
 **/\r
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciSyncInterruptTransfer (\r
-  IN       EFI_USB_HC_PROTOCOL     *This,\r
-  IN       UINT8                   DeviceAddress,\r
-  IN       UINT8                   EndPointAddress,\r
-  IN       BOOLEAN                 IsSlowDevice,\r
-  IN       UINT8                   MaximumPacketLength,\r
-  IN OUT   VOID                    *Data,\r
-  IN OUT   UINTN                   *DataLength,\r
-  IN OUT   UINT8                   *DataToggle,\r
-  IN       UINTN                   TimeOut,\r
-  OUT      UINT32                  *TransferResult\r
+Uhci2SyncInterruptTransfer (\r
+  IN     EFI_USB2_HC_PROTOCOL                      *This,\r
+  IN     UINT8                                     DeviceAddress,\r
+  IN     UINT8                                     EndPointAddress,\r
+  IN     UINT8                                     DeviceSpeed,\r
+  IN     UINTN                                     MaximumPacketLength,\r
+  IN OUT VOID                                      *Data,\r
+  IN OUT UINTN                                     *DataLength,\r
+  IN OUT UINT8                                     *DataToggle,\r
+  IN     UINTN                                     TimeOut,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR        *Translator,\r
+  OUT    UINT32                                    *TransferResult\r
   )\r
 {\r
   EFI_STATUS          Status;\r
@@ -1106,12 +1147,19 @@ UhciSyncInterruptTransfer (
   UINT8               *DataPhy;\r
   VOID                *DataMap;\r
   UINT8               PktId;\r
+  BOOLEAN             IsSlowDevice;\r
 \r
-  Uhc     = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
   DataPhy = NULL;\r
   DataMap = NULL;\r
   TDs     = NULL;\r
 \r
+  if (DeviceSpeed == EFI_USB_SPEED_HIGH) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  IsSlowDevice  = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
+\r
   if ((DataLength == NULL) || (Data == NULL) || (TransferResult == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -1170,7 +1218,7 @@ UhciSyncInterruptTransfer (
           DataPhy,\r
           *DataLength,\r
           DataToggle,\r
-          MaximumPacketLength,\r
+          (UINT8) MaximumPacketLength,\r
           IsSlowDevice\r
           );\r
 \r
@@ -1203,15 +1251,19 @@ ON_EXIT:
 \r
 \r
 /**\r
-  Submits isochronous transfer to a target USB device.\r
+  Submits isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
 \r
-  This                : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
   DeviceAddress       : Target device address\r
-  EndPointAddress     : End point address withdirection\r
-  MaximumPacketLength : Maximum packet size of the endpoint\r
-  Data                : Data to transmit or receive\r
-  DataLength          : Bytes of the data\r
-  TransferResult      : Variable to receive the result\r
+  EndPointAddress     : Endpoint number and direction\r
+  DeviceSpeed         : Device speed\r
+  MaximumPacketLength : Maximum packet size of the target endpoint\r
+  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
+  Data                : Array of pointers to the buffers of data\r
+  DataLength          : On input, size of the data buffer, On output,\r
+  actually transferred data size.\r
+  Translator          : A pointr to the transaction translator data.\r
+  TransferResult      : Variable to receive transfer result\r
 \r
   @return EFI_UNSUPPORTED\r
 \r
@@ -1219,14 +1271,17 @@ ON_EXIT:
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciIsochronousTransfer (\r
-  IN       EFI_USB_HC_PROTOCOL     *This,\r
-  IN       UINT8                   DeviceAddress,\r
-  IN       UINT8                   EndPointAddress,\r
-  IN       UINT8                   MaximumPacketLength,\r
-  IN OUT   VOID                    *Data,\r
-  IN       UINTN                   DataLength,\r
-  OUT      UINT32                  *TransferResult\r
+Uhci2IsochronousTransfer (\r
+  IN     EFI_USB2_HC_PROTOCOL               *This,\r
+  IN     UINT8                              DeviceAddress,\r
+  IN     UINT8                              EndPointAddress,\r
+  IN     UINT8                              DeviceSpeed,\r
+  IN     UINTN                              MaximumPacketLength,\r
+  IN     UINT8                              DataBuffersNumber,\r
+  IN OUT VOID                               *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
+  IN     UINTN                              DataLength,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+  OUT    UINT32                             *TransferResult\r
   )\r
 {\r
   return EFI_UNSUPPORTED;\r
@@ -1234,15 +1289,18 @@ UhciIsochronousTransfer (
 \r
 \r
 /**\r
-  Submits Async isochronous transfer to a target USB device.\r
+  Submits Async isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
 \r
-  This                : A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
   DeviceAddress       : Target device address\r
-  EndPointAddress     : End point address withdirection\r
-  MaximumPacketLength : Maximum packet size of the endpoint\r
-  Data                : Data to transmit or receive\r
-  IsochronousCallBack : Function to call when the transfer completes\r
-  Context             : User context\r
+  EndPointAddress     : Endpoint number and direction\r
+  DeviceSpeed         : Device speed\r
+  MaximumPacketLength : Maximum packet size of the target endpoint\r
+  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
+  Data                : Array of pointers to the buffers of data\r
+  Translator          : A pointr to the transaction translator data.\r
+  IsochronousCallBack : Function to call when the transfer complete\r
+  Context             : Pass to the call back function as parameter\r
 \r
   @return EFI_UNSUPPORTED\r
 \r
@@ -1250,568 +1308,18 @@ UhciIsochronousTransfer (
 STATIC\r
 EFI_STATUS\r
 EFIAPI\r
-UhciAsyncIsochronousTransfer (\r
-  IN       EFI_USB_HC_PROTOCOL                 * This,\r
-  IN       UINT8                               DeviceAddress,\r
-  IN       UINT8                               EndPointAddress,\r
-  IN       UINT8                               MaximumPacketLength,\r
-  IN OUT   VOID                                *Data,\r
-  IN       UINTN                               DataLength,\r
-  IN       EFI_ASYNC_USB_TRANSFER_CALLBACK     IsochronousCallBack,\r
-  IN       VOID                                *Context OPTIONAL\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-\r
-/**\r
-  Provides software reset for the USB host controller according to UEFI 2.0 spec.\r
-\r
-  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  @param  Attributes           A bit mask of the reset operation to perform.  See\r
-                               below for a list of the supported bit mask values.\r
-\r
-  @return EFI_SUCCESS           : The reset operation succeeded.\r
-  @return EFI_INVALID_PARAMETER : Attributes is not valid.\r
-  @return EFI_UNSUPPORTED       : This type of reset is not currently supported\r
-  @return EFI_DEVICE_ERROR      : Other errors\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2Reset (\r
-  IN EFI_USB2_HC_PROTOCOL   *This,\r
-  IN UINT16                 Attributes\r
-  )\r
-{\r
-  USB_HC_DEV          *UhciDev;\r
-\r
-  UhciDev = UHC_FROM_USB2_HC_PROTO (This);\r
-\r
-  if ((Attributes == EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG) ||\r
-      (Attributes == EFI_USB_HC_RESET_HOST_WITH_DEBUG)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  return UhciReset (&UhciDev->UsbHc, Attributes);\r
-}\r
-\r
-\r
-/**\r
-  Retrieves current state of the USB host controller according to UEFI 2.0 spec.\r
-\r
-  @param  This                 A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  @param  State                Variable to receive current device state\r
-\r
-  @return EFI_SUCCESS           : The state is returned\r
-  @return EFI_INVALID_PARAMETER : State is not valid.\r
-  @return EFI_DEVICE_ERROR      : Other errors2006\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2GetState (\r
-  IN CONST EFI_USB2_HC_PROTOCOL   *This,\r
-  OUT      EFI_USB_HC_STATE       *State\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-\r
-  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-  return UhciGetState (&Uhc->UsbHc, State);\r
-}\r
-\r
-\r
-/**\r
-  Sets the USB host controller to a specific state according to UEFI 2.0 spec.\r
-\r
-  @param  This                 A pointer to the EFI_USB_HC_PROTOCOL instance.\r
-  @param  State                Indicates the state of the host controller that will\r
-                               be set.\r
-\r
-  @return EFI_SUCCESS           : Host controller was successfully placed in the state\r
-  @return EFI_INVALID_PARAMETER : State is invalid.\r
-  @return EFI_DEVICE_ERROR      : Failed to set the state\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2SetState (\r
-  IN EFI_USB2_HC_PROTOCOL    *This,\r
-  IN EFI_USB_HC_STATE        State\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-\r
-  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-  return UhciSetState (&Uhc->UsbHc, State);\r
-}\r
-\r
-\r
-/**\r
-  Retrieves capabilities of USB host controller according to UEFI 2.0 spec.\r
-\r
-  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL instance\r
-  @param  MaxSpeed             A pointer to the max speed USB host controller\r
-                               supports.\r
-  @param  PortNumber           A pointer to the number of root hub ports.\r
-  @param  Is64BitCapable       A pointer to an integer to show whether USB host\r
-                               controller supports 64-bit memory addressing.\r
-\r
-  @return EFI_SUCCESS           : capabilities were retrieved successfully.\r
-  @return EFI_INVALID_PARAMETER : MaxSpeed or PortNumber or Is64BitCapable is NULL.\r
-  @return EFI_DEVICE_ERROR      : An error was encountered\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2GetCapability (\r
-  IN  EFI_USB2_HC_PROTOCOL  *This,\r
-  OUT UINT8                 *MaxSpeed,\r
-  OUT UINT8                 *PortNumber,\r
-  OUT UINT8                 *Is64BitCapable\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-\r
-  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-\r
-  if ((NULL == MaxSpeed) || (NULL == PortNumber) || (NULL == Is64BitCapable)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *MaxSpeed       = EFI_USB_SPEED_FULL;\r
-  *Is64BitCapable = (UINT8) FALSE;\r
-\r
-  return UhciGetRootHubPortNumber (&Uhc->UsbHc, PortNumber);\r
-}\r
-\r
-\r
-/**\r
-  Retrieves the current status of a USB root hub port according to UEFI 2.0 spec.\r
-\r
-  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL.\r
-  @param  PortNumber           The port to get status\r
-  @param  PortStatus           A pointer to the current port status bits and  port\r
-                               status change bits.\r
-\r
-  @return EFI_SUCCESS           : status of the USB root hub port was returned in PortStatus.\r
-  @return EFI_INVALID_PARAMETER : PortNumber is invalid.\r
-  @return EFI_DEVICE_ERROR      : Can't read register\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2GetRootHubPortStatus (\r
-  IN  CONST EFI_USB2_HC_PROTOCOL   *This,\r
-  IN  CONST UINT8                  PortNumber,\r
-  OUT       EFI_USB_PORT_STATUS    *PortStatus\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-\r
-  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-\r
-  return UhciGetRootHubPortStatus (&Uhc->UsbHc, PortNumber, PortStatus);\r
-}\r
-\r
-\r
-/**\r
-  Sets a feature for the specified root hub port according to UEFI 2.0 spec.\r
-\r
-  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL.\r
-  @param  PortNumber           Specifies the root hub port whose feature  is\r
-                               requested to be set.\r
-  @param  PortFeature          Indicates the feature selector associated  with the\r
-                               feature set request.\r
-\r
-  @return EFI_SUCCESS           : PortFeature was set for the root port\r
-  @return EFI_INVALID_PARAMETER : PortNumber is invalid or PortFeature is invalid.\r
-  @return EFI_DEVICE_ERROR      : Can't read register\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2SetRootHubPortFeature (\r
-  IN EFI_USB2_HC_PROTOCOL    *This,\r
-  IN UINT8                   PortNumber,\r
-  IN EFI_USB_PORT_FEATURE    PortFeature\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-\r
-  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-\r
-  return UhciSetRootHubPortFeature (&Uhc->UsbHc, PortNumber, PortFeature);\r
-}\r
-\r
-\r
-/**\r
-  Clears a feature for the specified root hub port according to Uefi 2.0 spec.\r
-\r
-  @param  This                 A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  @param  PortNumber           Specifies the root hub port whose feature  is\r
-                               requested to be cleared.\r
-  @param  PortFeature          Indicates the feature selector associated with the\r
-                               feature clear request.\r
-\r
-  @return EFI_SUCCESS           : PortFeature was cleared for the USB root hub port\r
-  @return EFI_INVALID_PARAMETER : PortNumber is invalid or PortFeature is invalid.\r
-  @return EFI_DEVICE_ERROR      : Can't read register\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2ClearRootHubPortFeature (\r
-  IN EFI_USB2_HC_PROTOCOL    *This,\r
-  IN UINT8                   PortNumber,\r
-  IN EFI_USB_PORT_FEATURE    PortFeature\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-\r
-  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-\r
-  return UhciClearRootHubPortFeature (&Uhc->UsbHc, PortNumber, PortFeature);\r
-}\r
-\r
-\r
-/**\r
-  Submits control transfer to a target USB device accroding to UEFI 2.0 spec..\r
-\r
-  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  DeviceAddress       : Target device address\r
-  DeviceSpeed         : Device speed\r
-  MaximumPacketLength : Maximum packet size of the target endpoint\r
-  Request             : USB device request to send\r
-  TransferDirection   : Data direction of the Data stage in control transfer\r
-  Data                : Data to transmit/receive in data stage\r
-  DataLength          : Length of the data\r
-  TimeOut             : Maximum time, in microseconds, for transfer to complete.\r
-  TransferResult      : Variable to receive the transfer result\r
-\r
-  @return EFI_SUCCESS           : The control transfer was completed successfully.\r
-  @return EFI_OUT_OF_RESOURCES  : Failed due to lack of resource.\r
-  @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
-  @return EFI_TIMEOUT           : Failed due to timeout.\r
-  @return EFI_DEVICE_ERROR      : Failed due to host controller or device error.\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2ControlTransfer (\r
-  IN     EFI_USB2_HC_PROTOCOL                 *This,\r
-  IN     UINT8                                DeviceAddress,\r
-  IN     UINT8                                DeviceSpeed,\r
-  IN     UINTN                                MaximumPacketLength,\r
-  IN     EFI_USB_DEVICE_REQUEST               *Request,\r
-  IN     EFI_USB_DATA_DIRECTION               TransferDirection,\r
-  IN OUT VOID                                 *Data,\r
-  IN OUT UINTN                                *DataLength,\r
-  IN     UINTN                                TimeOut,\r
-  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR   *Translator,\r
-  OUT    UINT32                               *TransferResult\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-  BOOLEAN             IsSlow;\r
-\r
-  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
-  IsSlow  = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
-\r
-  return UhciControlTransfer (\r
-           &Uhc->UsbHc,\r
-           DeviceAddress,\r
-           IsSlow,\r
-           (UINT8) MaximumPacketLength,\r
-           Request,\r
-           TransferDirection,\r
-           Data,\r
-           DataLength,\r
-           TimeOut,\r
-           TransferResult\r
-           );\r
-}\r
-\r
-\r
-/**\r
-  Submits bulk transfer to a bulk endpoint of a USB device\r
-\r
-  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  DeviceAddress       : Target device address\r
-  EndPointAddress     : Endpoint number and direction\r
-  DeviceSpeed         : Device speed\r
-  MaximumPacketLength : Maximum packet size of the target endpoint\r
-  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
-  Data                : Array of pointers to the buffers of data\r
-  DataLength          : On input, size of the data buffer, On output,\r
-  actually transferred data size.\r
-  DataToggle          : On input, data toggle to use; On output, next data toggle\r
-  Translator          : A pointr to the transaction translator data.\r
-  TimeOut             : Maximum time out, in microseconds\r
-  TransferResult      : Variable to receive transfer result\r
-\r
-  @return EFI_SUCCESS           : The bulk transfer was completed successfully.\r
-  @return EFI_OUT_OF_RESOURCES  : Failed due to lack of resource.\r
-  @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
-  @return EFI_TIMEOUT           : Failed due to timeout.\r
-  @return EFI_DEVICE_ERROR      : Failed due to host controller or device error.\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2BulkTransfer (\r
-  IN     EFI_USB2_HC_PROTOCOL               *This,\r
-  IN     UINT8                              DeviceAddress,\r
-  IN     UINT8                              EndPointAddress,\r
-  IN     UINT8                              DeviceSpeed,\r
-  IN     UINTN                              MaximumPacketLength,\r
-  IN     UINT8                              DataBuffersNumber,\r
-  IN OUT VOID                               *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r
-  IN OUT UINTN                              *DataLength,\r
-  IN OUT UINT8                              *DataToggle,\r
-  IN     UINTN                              TimeOut,\r
-  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
-  OUT    UINT32                             *TransferResult\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-\r
-  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-\r
-  if (Data == NULL || DeviceSpeed == EFI_USB_SPEED_LOW) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // For full-speed bulk transfers only the data pointed by Data[0] shall be used\r
-  //\r
-  return UhciBulkTransfer (\r
-           &Uhc->UsbHc,\r
-           DeviceAddress,\r
-           EndPointAddress,\r
-           (UINT8) MaximumPacketLength,\r
-           *Data,\r
-           DataLength,\r
-           DataToggle,\r
-           TimeOut,\r
-           TransferResult\r
-           );\r
-}\r
-\r
-\r
-/**\r
-  Submits an asynchronous interrupt transfer to an\r
-  interrupt endpoint of a USB device according to UEFI 2.0 spec.\r
-\r
-  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  DeviceAddress       : Target device address\r
-  EndPointAddress     : Endpoint number and direction\r
-  DeviceSpeed         : Device speed\r
-  MaximumPacketLength : Maximum packet size of the target endpoint\r
-  IsNewTransfer       : If TRUE, submit a new transfer, if FALSE cancel old transfer\r
-  DataToggle          : On input, data toggle to use; On output, next data toggle\r
-  PollingInterval     : Interrupt poll rate in milliseconds\r
-  DataLength          : On input, size of the data buffer, On output,\r
-  actually transferred data size.\r
-  Translator          : A pointr to the transaction translator data.\r
-  CallBackFunction    : Function to call periodically\r
-  Context             : User context\r
-\r
-  @return EFI_SUCCESS           : Transfer was submitted\r
-  @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
-  @return EFI_OUT_OF_RESOURCES  : Failed due to a lack of resources.\r
-  @return EFI_DEVICE_ERROR      : Can't read register\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2AsyncInterruptTransfer (\r
-  IN     EFI_USB2_HC_PROTOCOL               *This,\r
-  IN     UINT8                              DeviceAddress,\r
-  IN     UINT8                              EndPointAddress,\r
-  IN     UINT8                              DeviceSpeed,\r
-  IN     UINTN                              MaximumPacketLength,\r
-  IN     BOOLEAN                            IsNewTransfer,\r
-  IN OUT UINT8                              *DataToggle,\r
-  IN     UINTN                              PollingInterval,\r
-  IN     UINTN                              DataLength,\r
-  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
-  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK    CallBackFunction,\r
-  IN     VOID                               *Context\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-  BOOLEAN             IsSlow;\r
-\r
-  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
-  IsSlow  = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
-\r
-  return UhciAsyncInterruptTransfer (\r
-           &Uhc->UsbHc,\r
-           DeviceAddress,\r
-           EndPointAddress,\r
-           IsSlow,\r
-           (UINT8) MaximumPacketLength,\r
-           IsNewTransfer,\r
-           DataToggle,\r
-           PollingInterval,\r
-           DataLength,\r
-           CallBackFunction,\r
-           Context\r
-           );\r
-}\r
-\r
-\r
-/**\r
-  Submits synchronous interrupt transfer to an interrupt endpoint\r
-  of a USB device according to UEFI 2.0 spec.\r
-\r
-  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  DeviceAddress       : Target device address\r
-  EndPointAddress     : Endpoint number and direction\r
-  DeviceSpeed         : Device speed\r
-  MaximumPacketLength : Maximum packet size of the target endpoint\r
-  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
-  Data                : Array of pointers to the buffers of data\r
-  DataLength          : On input, size of the data buffer, On output,\r
-  actually transferred data size.\r
-  DataToggle          : On input, data toggle to use; On output, next data toggle\r
-  TimeOut             : Maximum time out, in microseconds\r
-  Translator          : A pointr to the transaction translator data.\r
-  TransferResult      : Variable to receive transfer result\r
-\r
-  @return EFI_SUCCESS           : The transfer was completed successfully.\r
-  @return EFI_OUT_OF_RESOURCES  : Failed due to lack of resource.\r
-  @return EFI_INVALID_PARAMETER : Some parameters are invalid.\r
-  @return EFI_TIMEOUT           : Failed due to timeout.\r
-  @return EFI_DEVICE_ERROR      : Failed due to host controller or device error.\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2SyncInterruptTransfer (\r
-  IN     EFI_USB2_HC_PROTOCOL                      *This,\r
-  IN     UINT8                                     DeviceAddress,\r
-  IN     UINT8                                     EndPointAddress,\r
-  IN     UINT8                                     DeviceSpeed,\r
-  IN     UINTN                                     MaximumPacketLength,\r
-  IN OUT VOID                                      *Data,\r
-  IN OUT UINTN                                     *DataLength,\r
-  IN OUT UINT8                                     *DataToggle,\r
-  IN     UINTN                                     TimeOut,\r
-  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR        *Translator,\r
-  OUT    UINT32                                    *TransferResult\r
-  )\r
-{\r
-  USB_HC_DEV          *Uhc;\r
-  BOOLEAN             IsSlow;\r
-\r
-  if (DeviceSpeed == EFI_USB_SPEED_HIGH) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Uhc     = UHC_FROM_USB2_HC_PROTO (This);\r
-  IsSlow  = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
-\r
-  return UhciSyncInterruptTransfer (\r
-           &Uhc->UsbHc,\r
-           DeviceAddress,\r
-           EndPointAddress,\r
-           IsSlow,\r
-           (UINT8) MaximumPacketLength,\r
-           Data,\r
-           DataLength,\r
-           DataToggle,\r
-           TimeOut,\r
-           TransferResult\r
-           );\r
-}\r
-\r
-\r
-/**\r
-  Submits isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
-\r
-  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  DeviceAddress       : Target device address\r
-  EndPointAddress     : Endpoint number and direction\r
-  DeviceSpeed         : Device speed\r
-  MaximumPacketLength : Maximum packet size of the target endpoint\r
-  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
-  Data                : Array of pointers to the buffers of data\r
-  DataLength          : On input, size of the data buffer, On output,\r
-  actually transferred data size.\r
-  Translator          : A pointr to the transaction translator data.\r
-  TransferResult      : Variable to receive transfer result\r
-\r
-  @return EFI_UNSUPPORTED\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2IsochronousTransfer (\r
-  IN     EFI_USB2_HC_PROTOCOL               *This,\r
-  IN     UINT8                              DeviceAddress,\r
-  IN     UINT8                              EndPointAddress,\r
-  IN     UINT8                              DeviceSpeed,\r
-  IN     UINTN                              MaximumPacketLength,\r
-  IN     UINT8                              DataBuffersNumber,\r
-  IN OUT VOID                               *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
-  IN     UINTN                              DataLength,\r
-  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
-  OUT    UINT32                             *TransferResult\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-/**\r
-  Submits Async isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
-\r
-  This                : A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
-  DeviceAddress       : Target device address\r
-  EndPointAddress     : Endpoint number and direction\r
-  DeviceSpeed         : Device speed\r
-  MaximumPacketLength : Maximum packet size of the target endpoint\r
-  DataBuffersNumber   : Number of data buffers prepared for the transfer.\r
-  Data                : Array of pointers to the buffers of data\r
-  Translator          : A pointr to the transaction translator data.\r
-  IsochronousCallBack : Function to call when the transfer complete\r
-  Context             : Pass to the call back function as parameter\r
-\r
-  @return EFI_UNSUPPORTED\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-Uhci2AsyncIsochronousTransfer (\r
-  IN     EFI_USB2_HC_PROTOCOL                *This,\r
-  IN     UINT8                               DeviceAddress,\r
-  IN     UINT8                               EndPointAddress,\r
-  IN     UINT8                               DeviceSpeed,\r
-  IN     UINTN                               MaximumPacketLength,\r
-  IN     UINT8                               DataBuffersNumber,\r
-  IN OUT VOID                                *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
-  IN     UINTN                               DataLength,\r
-  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR  *Translator,\r
-  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK     IsochronousCallBack,\r
-  IN     VOID                                *Context\r
+Uhci2AsyncIsochronousTransfer (\r
+  IN     EFI_USB2_HC_PROTOCOL                *This,\r
+  IN     UINT8                               DeviceAddress,\r
+  IN     UINT8                               EndPointAddress,\r
+  IN     UINT8                               DeviceSpeed,\r
+  IN     UINTN                               MaximumPacketLength,\r
+  IN     UINT8                               DataBuffersNumber,\r
+  IN OUT VOID                                *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
+  IN     UINTN                               DataLength,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR  *Translator,\r
+  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK     IsochronousCallBack,\r
+  IN     VOID                                *Context\r
   )\r
 {\r
   return EFI_UNSUPPORTED;\r
@@ -1959,22 +1467,6 @@ UhciAllocateDev (
   // USB_HC_PROTOCOL is for EFI 1.1 backward compability.\r
   //\r
   Uhc->Signature                        = USB_HC_DEV_SIGNATURE;\r
-  Uhc->UsbHc.Reset                      = UhciReset;\r
-  Uhc->UsbHc.GetState                   = UhciGetState;\r
-  Uhc->UsbHc.SetState                   = UhciSetState;\r
-  Uhc->UsbHc.ControlTransfer            = UhciControlTransfer;\r
-  Uhc->UsbHc.BulkTransfer               = UhciBulkTransfer;\r
-  Uhc->UsbHc.AsyncInterruptTransfer     = UhciAsyncInterruptTransfer;\r
-  Uhc->UsbHc.SyncInterruptTransfer      = UhciSyncInterruptTransfer;\r
-  Uhc->UsbHc.IsochronousTransfer        = UhciIsochronousTransfer;\r
-  Uhc->UsbHc.AsyncIsochronousTransfer   = UhciAsyncIsochronousTransfer;\r
-  Uhc->UsbHc.GetRootHubPortNumber       = UhciGetRootHubPortNumber;\r
-  Uhc->UsbHc.GetRootHubPortStatus       = UhciGetRootHubPortStatus;\r
-  Uhc->UsbHc.SetRootHubPortFeature      = UhciSetRootHubPortFeature;\r
-  Uhc->UsbHc.ClearRootHubPortFeature    = UhciClearRootHubPortFeature;\r
-  Uhc->UsbHc.MajorRevision              = 0x1;\r
-  Uhc->UsbHc.MinorRevision              = 0x1;\r
-\r
   Uhc->Usb2Hc.GetCapability             = Uhci2GetCapability;\r
   Uhc->Usb2Hc.Reset                     = Uhci2Reset;\r
   Uhc->Usb2Hc.GetState                  = Uhci2GetState;\r
@@ -2065,8 +1557,8 @@ UhciFreeDev (
 STATIC\r
 VOID\r
 UhciCleanDevUp (\r
-  IN  EFI_HANDLE          Controller,\r
-  IN  EFI_USB_HC_PROTOCOL *This\r
+  IN  EFI_HANDLE           Controller,\r
+  IN  EFI_USB2_HC_PROTOCOL *This\r
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
@@ -2074,15 +1566,9 @@ UhciCleanDevUp (
   //\r
   // Uninstall the USB_HC and USB_HC2 protocol, then disable the controller\r
   //\r
-  Uhc = UHC_FROM_USB_HC_PROTO (This);\r
+  Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
   UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);\r
 \r
-  gBS->UninstallProtocolInterface (\r
-        Controller,\r
-        &gEfiUsbHcProtocolGuid,\r
-        &Uhc->UsbHc\r
-        );\r
-\r
   gBS->UninstallProtocolInterface (\r
         Controller,\r
         &gEfiUsb2HcProtocolGuid,\r
@@ -2218,12 +1704,10 @@ UhciDriverBindingStart (
   }\r
 \r
   //\r
-  // Install both USB_HC_PROTOCOL and USB2_HC_PROTOCOL\r
+  // Install USB2_HC_PROTOCOL\r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &Controller,\r
-                  &gEfiUsbHcProtocolGuid,\r
-                  &Uhc->UsbHc,\r
                   &gEfiUsb2HcProtocolGuid,\r
                   &Uhc->Usb2Hc,\r
                   NULL\r
@@ -2310,28 +1794,10 @@ UhciDriverBindingStop (
   IN EFI_HANDLE                      *ChildHandleBuffer\r
   )\r
 {\r
-  EFI_USB_HC_PROTOCOL   *UsbHc;\r
   EFI_USB2_HC_PROTOCOL  *Usb2Hc;\r
   EFI_STATUS            Status;\r
 \r
-  Status = gBS->OpenProtocol (\r
-                  Controller,\r
-                  &gEfiUsbHcProtocolGuid,\r
-                  (VOID **) &UsbHc,\r
-                  This->DriverBindingHandle,\r
-                  Controller,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  //\r
-  // Test whether the Controller handler passed in is a valid\r
-  // Usb controller handle that should be supported, if not,\r
-  // return the error status directly\r
-  //\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = gBS->OpenProtocol (\r
+   Status = gBS->OpenProtocol (\r
                   Controller,\r
                   &gEfiUsb2HcProtocolGuid,\r
                   (VOID **) &Usb2Hc,\r
@@ -2349,7 +1815,7 @@ UhciDriverBindingStop (
     return Status;\r
   }\r
 \r
-  UhciCleanDevUp (Controller, UsbHc);\r
+  UhciCleanDevUp (Controller, Usb2Hc);\r
 \r
   gBS->CloseProtocol (\r
         Controller,\r
index e47679515b86833f5939d218d3c9aba27046b8e0..d0aea616f595a078197a6520c9f037c2c6e18e58 100644 (file)
@@ -98,7 +98,6 @@ typedef struct {
 } USB_CLASSC;\r
 #pragma pack()\r
 \r
-#define UHC_FROM_USB_HC_PROTO(This)   CR(This, USB_HC_DEV, UsbHc, USB_HC_DEV_SIGNATURE)\r
 #define UHC_FROM_USB2_HC_PROTO(This)  CR(This, USB_HC_DEV, Usb2Hc, USB_HC_DEV_SIGNATURE)\r
 \r
 //\r
@@ -114,7 +113,6 @@ typedef struct {
 //\r
 struct _USB_HC_DEV {\r
   UINT32                    Signature;\r
-  EFI_USB_HC_PROTOCOL       UsbHc;\r
   EFI_USB2_HC_PROTOCOL      Usb2Hc;\r
   EFI_PCI_IO_PROTOCOL       *PciIo;\r
   UINT64                    OriginalPciAttributes;\r
index f5849f28127ab1d8f3104ec0df16cffa36aaae42..4f46bf5bb1410c6395d71e7813fde1aaa061929d 100644 (file)
@@ -63,6 +63,5 @@
 \r
 [Protocols]\r
   gEfiPciIoProtocolGuid                         # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiUsbHcProtocolGuid                         # PROTOCOL ALWAYS_CONSUMED\r
   gEfiUsb2HcProtocolGuid                        # PROTOCOL ALWAYS_CONSUMED\r
 \r
index 8bb0f2b19aa2c45523e5f994f316283dd2ed0ca7..9c632a60fc29ceb27044ad222e9d61ddfac117c2 100644 (file)
@@ -168,7 +168,7 @@ UhciAckAllInterrupt (
   //\r
   if (!UhciIsHcWorking (Uhc->PciIo)) {\r
     UHCI_ERROR (("UhciAckAllInterrupt: re-enable the UHCI from system error\n"));\r
-    Uhc->UsbHc.SetState (&Uhc->UsbHc, EfiUsbHcStateOperational);\r
+    Uhc->Usb2Hc.SetState (&Uhc->Usb2Hc, EfiUsbHcStateOperational);\r
   }\r
 }\r
 \r
@@ -186,8 +186,8 @@ UhciAckAllInterrupt (
 **/\r
 EFI_STATUS\r
 UhciStopHc (\r
-  IN USB_HC_DEV         *Uhc,\r
-  IN UINTN              Timeout\r
+  IN USB_HC_DEV        *Uhc,\r
+  IN UINTN             Timeout\r
   )\r
 {\r
   UINT16                UsbSts;\r