mirror of https://github.com/acidanthera/audk.git
Remove two global variable: mUsbCapabilityLen and mDeviceSpeed and integrate them into USB2_HC_DEV.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2235 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d02ea95873
commit
3727980651
|
@ -223,8 +223,6 @@ EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding = {
|
|||
NULL
|
||||
};
|
||||
|
||||
UINT32 mUsbCapabilityLen;
|
||||
UINT32 mDeviceSpeed[16];
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
|
@ -1283,9 +1281,9 @@ EhciGetRootHubPortStatus (
|
|||
// Not Low Speed Device Attached
|
||||
//
|
||||
if ((PORTSC_CCS & PortStatusControlReg) && (PORTSC_CSC & PortStatusControlReg)) {
|
||||
mDeviceSpeed[PortNumber] = IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0;
|
||||
HcDev->DeviceSpeed[PortNumber] = IsHighSpeedDevice (This, PortNumber) ? USB_PORT_STAT_HIGH_SPEED : 0;
|
||||
}
|
||||
PortStatus->PortStatus |= mDeviceSpeed[PortNumber];
|
||||
PortStatus->PortStatus |= HcDev->DeviceSpeed[PortNumber];
|
||||
}
|
||||
//
|
||||
// Fill Port Status Change bits
|
||||
|
@ -1410,7 +1408,7 @@ EhciSetRootHubPortFeature (
|
|||
}
|
||||
Status = WaitForEhcNotHalt (HcDev, EHCI_GENERIC_TIMEOUT);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((gEHCDebugLevel, "WaitForEhcNotHalt TimeOut\n"));
|
||||
DEBUG ((gEHCDebugLevel, "EHCI: WaitForEhcNotHalt TimeOut\n"));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,6 @@ extern UINTN gEHCErrorLevel;
|
|||
//
|
||||
// Enhanced Host Controller Registers definitions
|
||||
//
|
||||
extern UINT32 mUsbCapabilityLen;
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gEhciComponentName;
|
||||
|
||||
|
@ -393,6 +392,8 @@ typedef struct _USB2_HC_DEV {
|
|||
MEMORY_MANAGE_HEADER *MemoryHeader;
|
||||
UINT8 Is64BitCapable;
|
||||
UINT32 High32BitAddr;
|
||||
UINT32 UsbCapabilityLen;
|
||||
UINT16 DeviceSpeed[16];
|
||||
} USB2_HC_DEV;
|
||||
|
||||
|
||||
|
|
|
@ -151,12 +151,12 @@ Returns:
|
|||
|
||||
--*/
|
||||
{
|
||||
ASSERT (mUsbCapabilityLen);
|
||||
ASSERT (HcDev->UsbCapabilityLen);
|
||||
return HcDev->PciIo->Mem.Read (
|
||||
HcDev->PciIo,
|
||||
EfiPciIoWidthUint32,
|
||||
USB_BAR_INDEX,
|
||||
(UINT64) (OperationalRegAddr + mUsbCapabilityLen),
|
||||
(UINT64) (OperationalRegAddr + HcDev->UsbCapabilityLen),
|
||||
1,
|
||||
Data
|
||||
);
|
||||
|
@ -187,12 +187,12 @@ Returns:
|
|||
|
||||
--*/
|
||||
{
|
||||
ASSERT (mUsbCapabilityLen);
|
||||
ASSERT (HcDev->UsbCapabilityLen);
|
||||
return HcDev->PciIo->Mem.Write (
|
||||
HcDev->PciIo,
|
||||
EfiPciIoWidthUint32,
|
||||
USB_BAR_INDEX,
|
||||
(UINT64) (OperationalRegAddr + mUsbCapabilityLen),
|
||||
(UINT64) (OperationalRegAddr + HcDev->UsbCapabilityLen),
|
||||
1,
|
||||
&Data
|
||||
);
|
||||
|
@ -347,9 +347,9 @@ Returns:
|
|||
Status = ReadEhcCapabiltiyReg (
|
||||
HcDev,
|
||||
CapabilityLenAddr,
|
||||
&mUsbCapabilityLen
|
||||
&(HcDev->UsbCapabilityLen)
|
||||
);
|
||||
mUsbCapabilityLen = (UINT8) mUsbCapabilityLen;
|
||||
HcDev->UsbCapabilityLen = (UINT8) HcDev->UsbCapabilityLen;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -1004,7 +1004,7 @@ Returns:
|
|||
|
||||
HcCapParamsAddr = HCCPARAMS;
|
||||
|
||||
ReadEhcOperationalReg (
|
||||
ReadEhcCapabiltiyReg(
|
||||
HcDev,
|
||||
HcCapParamsAddr,
|
||||
&HcCapParamsReg
|
||||
|
|
|
@ -79,7 +79,7 @@ Returns:
|
|||
0
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((gEHCErrorLevel, "PciIo->AllocateBuffer Failed\n"));
|
||||
DEBUG ((gEHCErrorLevel, "EHCI: PciIo->AllocateBuffer Failed\n"));
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ Returns:
|
|||
&Map
|
||||
);
|
||||
if (EFI_ERROR (Status) || (BufferSizeInBytes != EFI_PAGE_SIZE)) {
|
||||
DEBUG ((gEHCErrorLevel, "PciIo->MapBuffer Failed\n"));
|
||||
DEBUG ((gEHCErrorLevel, "EHCI: PciIo->MapBuffer Failed\n"));
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto free_buffer;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ Returns:
|
|||
|
||||
Status = SetCtrlDataStructSeg (HcDev);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((gEHCErrorLevel, "SetCtrlDataStructSeg Failed\n"));
|
||||
DEBUG ((gEHCErrorLevel, "EHCI: SetCtrlDataStructSeg Failed\n"));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto unmap_buffer;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue