Remove two global variable: mUsbCapabilityLen and mDeviceSpeed and integrate them...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Jan 2007 05:47:58 +0000 (05:47 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Jan 2007 05:47:58 +0000 (05:47 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2235 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c
EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h
EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciReg.c
EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c

index d573532..8f32abf 100644 (file)
@@ -223,8 +223,6 @@ EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding = {
   NULL\r
 };\r
 \r
-UINT32                      mUsbCapabilityLen;\r
-UINT32                      mDeviceSpeed[16];\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -1283,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
@@ -1410,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
index eb0508f..747e1ee 100644 (file)
@@ -100,7 +100,6 @@ extern UINTN  gEHCErrorLevel;
 //\r
 // Enhanced Host Controller Registers definitions\r
 //\r
-extern UINT32                       mUsbCapabilityLen;\r
 extern EFI_DRIVER_BINDING_PROTOCOL  gEhciDriverBinding;\r
 extern EFI_COMPONENT_NAME_PROTOCOL  gEhciComponentName;\r
 \r
@@ -393,6 +392,8 @@ typedef struct _USB2_HC_DEV {
   MEMORY_MANAGE_HEADER      *MemoryHeader;\r
   UINT8                                                Is64BitCapable;\r
   UINT32                    High32BitAddr;\r
+  UINT32                    UsbCapabilityLen;\r
+  UINT16                    DeviceSpeed[16];\r
 } USB2_HC_DEV;\r
 \r
 \r
index 70d1d5c..5767bbc 100644 (file)
@@ -151,12 +151,12 @@ Returns:
     \r
 --*/\r
 {\r
-  ASSERT (mUsbCapabilityLen);\r
+  ASSERT (HcDev->UsbCapabilityLen);\r
   return HcDev->PciIo->Mem.Read (\r
                              HcDev->PciIo,\r
                              EfiPciIoWidthUint32,\r
                              USB_BAR_INDEX,\r
-                             (UINT64) (OperationalRegAddr + mUsbCapabilityLen),\r
+                             (UINT64) (OperationalRegAddr + HcDev->UsbCapabilityLen),\r
                              1,\r
                              Data\r
                              );\r
@@ -187,12 +187,12 @@ Returns:
   \r
 --*/\r
 {\r
-  ASSERT (mUsbCapabilityLen);\r
+  ASSERT (HcDev->UsbCapabilityLen);\r
   return HcDev->PciIo->Mem.Write (\r
                              HcDev->PciIo,\r
                              EfiPciIoWidthUint32,\r
                              USB_BAR_INDEX,\r
-                             (UINT64) (OperationalRegAddr + mUsbCapabilityLen),\r
+                             (UINT64) (OperationalRegAddr + HcDev->UsbCapabilityLen),\r
                              1,\r
                              &Data\r
                              );\r
@@ -347,9 +347,9 @@ Returns:
   Status = ReadEhcCapabiltiyReg (\r
              HcDev,\r
              CapabilityLenAddr,\r
-             &mUsbCapabilityLen\r
+             &(HcDev->UsbCapabilityLen)\r
              );\r
-  mUsbCapabilityLen = (UINT8) mUsbCapabilityLen;\r
+  HcDev->UsbCapabilityLen = (UINT8) HcDev->UsbCapabilityLen;\r
 \r
   return Status;\r
 }\r
@@ -1004,7 +1004,7 @@ Returns:
 \r
   HcCapParamsAddr = HCCPARAMS;\r
 \r
-  ReadEhcOperationalReg (\r
+  ReadEhcCapabiltiyReg(\r
     HcDev,\r
     HcCapParamsAddr,\r
     &HcCapParamsReg\r
index 1a94705..9f1a15d 100644 (file)
@@ -79,7 +79,7 @@ Returns:
                           0\r
                           );\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((gEHCErrorLevel, "PciIo->AllocateBuffer Failed\n"));\r
+    DEBUG ((gEHCErrorLevel, "EHCI: PciIo->AllocateBuffer Failed\n"));\r
     Status = EFI_OUT_OF_RESOURCES;\r
     goto exit;\r
   }\r
@@ -93,7 +93,7 @@ Returns:
                           &Map\r
                           );\r
   if (EFI_ERROR (Status) || (BufferSizeInBytes != EFI_PAGE_SIZE)) {\r
-    DEBUG ((gEHCErrorLevel, "PciIo->MapBuffer Failed\n"));\r
+    DEBUG ((gEHCErrorLevel, "EHCI: PciIo->MapBuffer Failed\n"));\r
     Status = EFI_OUT_OF_RESOURCES;\r
     goto free_buffer;\r
   }\r
@@ -107,7 +107,7 @@ Returns:
        \r
        Status = SetCtrlDataStructSeg (HcDev);\r
     if (EFI_ERROR (Status)) {\r
-      DEBUG ((gEHCErrorLevel, "SetCtrlDataStructSeg Failed\n"));\r
+      DEBUG ((gEHCErrorLevel, "EHCI: SetCtrlDataStructSeg Failed\n"));\r
       Status = EFI_DEVICE_ERROR;\r
       goto unmap_buffer;\r
     }\r