summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Pci/EhciDxe
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-24 05:34:55 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-24 05:34:55 +0000
commita261044cf5036534c6bd3f81c5f4a5fb69380399 (patch)
treebea163f99478159d28f69c22b122efa963769db2 /MdeModulePkg/Bus/Pci/EhciDxe
parent15a865075cec6ddd26f2a16bbeaa23fb850e4e62 (diff)
downloadedk2-platforms-a261044cf5036534c6bd3f81c5f4a5fb69380399.tar.xz
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
Diffstat (limited to 'MdeModulePkg/Bus/Pci/EhciDxe')
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c18
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h2
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.h2
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.h3
4 files changed, 7 insertions, 18 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index aae39b0acb..c6c7e5a519 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -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 (
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
index 2137d1cfba..2af722df4f 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.h
@@ -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;
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.h b/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.h
index 23f794381f..15fd661e3d 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.h
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciReg.h
@@ -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;
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.h b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.h
index d5213284ce..8152ce813b 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.h
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.h
@@ -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) \