]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c
Fix component name bugs when input Controller Name is invalid
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / Ehci / Dxe / Ehci.c
index e7d359ee2495e8137e751daf2c05027faf603274..2d6dc838a4a71218ae68bf23498b71b332127317 100644 (file)
@@ -22,8 +22,10 @@ Revision History
 \r
 #include "Ehci.h"\r
 \r
-UINTN                       gEHCDebugLevel  = EFI_D_INFO;\r
-UINTN                       gEHCErrorLevel  = EFI_D_ERROR;\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED UINTN    gEHCDebugLevel  = EFI_D_INFO;\r
+GLOBAL_REMOVE_IF_UNREFERENCED UINTN    gEHCErrorLevel  = EFI_D_ERROR;\r
+\r
 \r
 //\r
 // Prototypes\r
@@ -216,13 +218,11 @@ EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding = {
   EhciDriverBindingSupported,\r
   EhciDriverBindingStart,\r
   EhciDriverBindingStop,\r
-  0x10,\r
+  0xa,\r
   NULL,\r
   NULL\r
 };\r
 \r
-UINT32                      mUsbCapabilityLen;\r
-UINT32                      mDeviceSpeed[16];\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -439,6 +439,13 @@ EhciDriverBindingStart (
     Status = EFI_DEVICE_ERROR;\r
     goto uninstall_usb2hc_protocol;\r
   }\r
+\r
+  ClearLegacySupport (HcDev);\r
+  HostReset (HcDev);\r
+\r
+  DEBUG_CODE (\r
+   DumpEHCIPortsStatus (HcDev);\r
+  );\r
   \r
   //\r
   // Create and Init Perodic Frame List\r
@@ -479,7 +486,7 @@ EhciDriverBindingStart (
   //\r
   // Create AsyncRequest Polling Timer\r
   //\r
-  Status = CreatePollingTimer (HcDev, AsyncRequestMoniter);\r
+  Status = CreatePollingTimer (HcDev, (EFI_EVENT_NOTIFY) AsyncRequestMoniter);\r
   if (EFI_ERROR (Status)) {\r
     Status = EFI_OUT_OF_RESOURCES;\r
     goto deinit_memory_management;\r
@@ -886,7 +893,7 @@ EhciReset (
     //\r
     Status = SetFrameListBaseAddr (\r
                HcDev, \r
-               (UINT32) GET_0B_TO_31B (HcDev->PeriodicFrameListBuffer)\r
+               (UINT32)GET_0B_TO_31B (HcDev->PeriodicFrameListBuffer)\r
                );\r
     if (EFI_ERROR (Status)) {\r
       Status = EFI_DEVICE_ERROR;\r
@@ -1274,9 +1281,9 @@ EhciGetRootHubPortStatus (
     // Not Low Speed Device Attached\r
     //\r
     if ((PORTSC_CCS & PortStatusControlReg) && (PORTSC_CSC & PortStatusControlReg)) {\r
-      mDeviceSpeed[PortNumber] = IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0;\r
+      HcDev->DeviceSpeed[PortNumber] = IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0;\r
     }\r
-    PortStatus->PortStatus |= mDeviceSpeed[PortNumber];\r
+    PortStatus->PortStatus |= HcDev->DeviceSpeed[PortNumber];\r
   }\r
   //\r
   // Fill Port Status Change bits\r
@@ -1401,7 +1408,7 @@ EhciSetRootHubPortFeature (
       }\r
       Status = WaitForEhcNotHalt (HcDev, EHCI_GENERIC_TIMEOUT);\r
       if (EFI_ERROR (Status)) {\r
-        DEBUG ((gEHCDebugLevel, "WaitForEhcNotHalt TimeOut\n"));\r
+        DEBUG ((gEHCDebugLevel, "EHCI: WaitForEhcNotHalt TimeOut\n"));\r
         Status = EFI_DEVICE_ERROR;\r
         goto exit;\r
       }\r
@@ -2162,7 +2169,9 @@ EhciAsyncInterruptTransfer (
   \r
     Submits an asynchronous interrupt transfer to an \r
     interrupt endpoint of a USB device.\r
-  \r
+    Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated \r
+    in the following specification version.\r
+    \r
   Arguments:\r
     \r
     This            - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
@@ -2469,7 +2478,9 @@ EhciSyncInterruptTransfer (
   Routine Description:\r
   \r
     Submits synchronous interrupt transfer to an interrupt endpoint \r
-    of a USB device.\r
+    of a USB device. \r
+    Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated \r
+    in the following specification version.\r
   \r
   Arguments:\r
     \r