code cleanup:
1. remove unused macro/remove unnecessary included header file 2. for those values defined by PCI spec, use the naming of definition in IndustryStandard/Pci.h 3. use BITX macro in Base.h rather than define one by self. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8992 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -46,12 +46,6 @@ gEhciDriverBinding = {
|
||||
NULL
|
||||
};
|
||||
|
||||
///
|
||||
/// USB host controller Programming Interface.
|
||||
///
|
||||
#define PCI_CLASSC_PI_UHCI 0x00
|
||||
#define PCI_CLASSC_PI_EHCI 0x20
|
||||
|
||||
/**
|
||||
Retrieves the capability of root hub ports.
|
||||
|
||||
@@ -1347,7 +1341,7 @@ EhcDriverBindingSupported (
|
||||
Status = PciIo->Pci.Read (
|
||||
PciIo,
|
||||
EfiPciIoWidthUint8,
|
||||
EHC_PCI_CLASSC,
|
||||
PCI_CLASSCODE_OFFSET,
|
||||
sizeof (USB_CLASSC) / sizeof (UINT8),
|
||||
&UsbClassCReg
|
||||
);
|
||||
@@ -1361,7 +1355,7 @@ EhcDriverBindingSupported (
|
||||
// Test whether the controller belongs to Ehci type
|
||||
//
|
||||
if ((UsbClassCReg.BaseCode != PCI_CLASS_SERIAL) || (UsbClassCReg.SubClassCode != PCI_CLASS_SERIAL_USB)
|
||||
|| ((UsbClassCReg.PI != EHC_PCI_CLASSC_PI) && (UsbClassCReg.PI !=PCI_CLASSC_PI_UHCI))) {
|
||||
|| ((UsbClassCReg.PI != PCI_IF_EHCI) && (UsbClassCReg.PI !=PCI_IF_UHCI))) {
|
||||
|
||||
Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
@@ -1579,7 +1573,7 @@ EhcDriverBindingStart (
|
||||
Status = PciIo->Pci.Read (
|
||||
PciIo,
|
||||
EfiPciIoWidthUint8,
|
||||
EHC_PCI_CLASSC,
|
||||
PCI_CLASSCODE_OFFSET,
|
||||
sizeof (USB_CLASSC) / sizeof (UINT8),
|
||||
&UsbClassCReg
|
||||
);
|
||||
@@ -1589,7 +1583,7 @@ EhcDriverBindingStart (
|
||||
goto CLOSE_PCIIO;
|
||||
}
|
||||
|
||||
if ((UsbClassCReg.PI == PCI_CLASSC_PI_UHCI) &&
|
||||
if ((UsbClassCReg.PI == PCI_IF_UHCI) &&
|
||||
(UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) &&
|
||||
(UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {
|
||||
Status = PciIo->GetLocation (
|
||||
@@ -1628,7 +1622,7 @@ EhcDriverBindingStart (
|
||||
Status = Instance->Pci.Read (
|
||||
Instance,
|
||||
EfiPciIoWidthUint8,
|
||||
EHC_PCI_CLASSC,
|
||||
PCI_CLASSCODE_OFFSET,
|
||||
sizeof (USB_CLASSC) / sizeof (UINT8),
|
||||
&UsbClassCReg
|
||||
);
|
||||
@@ -1638,7 +1632,7 @@ EhcDriverBindingStart (
|
||||
goto CLOSE_PCIIO;
|
||||
}
|
||||
|
||||
if ((UsbClassCReg.PI == PCI_CLASSC_PI_EHCI) &&
|
||||
if ((UsbClassCReg.PI == PCI_IF_EHCI) &&
|
||||
(UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) &&
|
||||
(UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {
|
||||
Status = Instance->GetLocation (
|
||||
|
@@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
#include <IndustryStandard/Pci22.h>
|
||||
#include <IndustryStandard/Pci.h>
|
||||
|
||||
typedef struct _USB2_HC_DEV USB2_HC_DEV;
|
||||
|
||||
|
@@ -83,8 +83,6 @@ typedef enum {
|
||||
//
|
||||
// PCI Configuration Registers
|
||||
//
|
||||
EHC_PCI_CLASSC = 0x09,
|
||||
EHC_PCI_CLASSC_PI = 0x20,
|
||||
EHC_BAR_INDEX = 0 /* how many bytes away from USB_BASE to 0x10 */
|
||||
}EHCI_REGISTER_OFFSET;
|
||||
|
||||
|
@@ -16,9 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef _EFI_EHCI_MEM_H_
|
||||
#define _EFI_EHCI_MEM_H_
|
||||
|
||||
|
||||
#include <IndustryStandard/Pci22.h>
|
||||
|
||||
#define USB_HC_BIT(a) ((UINTN)(1 << (a)))
|
||||
|
||||
#define USB_HC_BIT_IS_SET(Data, Bit) \
|
||||
|
Reference in New Issue
Block a user