diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c index b4f1a50799..348cde60f6 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c @@ -1434,7 +1434,7 @@ EhcGetUsbDebugPortInfo ( Status = PciIo->Pci.Read ( PciIo, EfiPciIoWidthUint8, - PCI_CAPBILITY_POINTER_OFFSET, + PCI_CAPABILITY_POINTER_OFFSET, 1, &CapabilityPtr ); diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c index 75c9b344ee..97b520f1cf 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciCommand.c @@ -137,7 +137,7 @@ LocateCapabilityRegBlock ( PciIoDevice->PciIo.Pci.Read ( &PciIoDevice->PciIo, EfiPciIoWidthUint8, - PCI_CAPBILITY_POINTER_OFFSET, + PCI_CAPABILITY_POINTER_OFFSET, 1, &CapabilityPtr ); diff --git a/MdePkg/Include/IndustryStandard/Pci22.h b/MdePkg/Include/IndustryStandard/Pci22.h index 67b1f66c64..b107b779b4 100644 --- a/MdePkg/Include/IndustryStandard/Pci22.h +++ b/MdePkg/Include/IndustryStandard/Pci22.h @@ -549,11 +549,14 @@ typedef struct { #define PCI_SID_OFFSET 0x2E ///< SubSystem ID #define PCI_SUBSYSTEM_ID_OFFSET 0x2E #define PCI_EXPANSION_ROM_BASE 0x30 -#define PCI_CAPBILITY_POINTER_OFFSET 0x34 -#define PCI_INT_LINE_OFFSET 0x3C ///< Interrupt Line Register -#define PCI_INT_PIN_OFFSET 0x3D ///< Interrupt Pin Register -#define PCI_MAXGNT_OFFSET 0x3E ///< Max Grant Register -#define PCI_MAXLAT_OFFSET 0x3F ///< Max Latency Register +#define PCI_CAPABILITY_POINTER_OFFSET 0x34 +// This misspelling is kept temporarily for backwards compatibility and will +// be removed in a future PR. Consumers must migrate to the new definition +#define PCI_CAPBILITY_POINTER_OFFSET PCI_CAPABILITY_POINTER_OFFSET +#define PCI_INT_LINE_OFFSET 0x3C ///< Interrupt Line Register +#define PCI_INT_PIN_OFFSET 0x3D ///< Interrupt Pin Register +#define PCI_MAXGNT_OFFSET 0x3E ///< Max Grant Register +#define PCI_MAXLAT_OFFSET 0x3F ///< Max Latency Register // // defined in PCI-to-PCI Bridge Architecture Specification diff --git a/MdePkg/Include/IndustryStandard/PciExpress21.h b/MdePkg/Include/IndustryStandard/PciExpress21.h index d5302d9ae3..17ddc65917 100644 --- a/MdePkg/Include/IndustryStandard/PciExpress21.h +++ b/MdePkg/Include/IndustryStandard/PciExpress21.h @@ -624,8 +624,15 @@ typedef struct { UINT8 EgressControlVectorArray[1]; } PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED; -#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(ACS_EXTENDED) (UINT8)(((ACS_EXTENDED->AcsCapability)&0x00000020)) -#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(ACS_EXTENDED) (UINT8)(((ACS_EXTENDED->AcsCapability)&0x0000FF00)) +#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRESS_CONTROL(ACS_EXTENDED) (UINT8)(((ACS_EXTENDED->AcsCapability)&0x00000020)) +#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRESS_VECTOR_SIZE(ACS_EXTENDED) (UINT8)(((ACS_EXTENDED->AcsCapability)&0x0000FF00)) + +// This misspelling is kept temporarily for backwards compatibility and will +// be removed in a future PR. Consumers must migrate to the new definition +#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(ACS_EXTENDED) PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRESS_CONTROL(ACS_EXTENDED) +// This misspelling is kept temporarily for backwards compatibility and will +// be removed in a future PR. Consumers must migrate to the new definition +#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(ACS_EXTENDED) PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRESS_VECTOR_SIZE(ACS_EXTENDED) #define PCI_EXPRESS_EXTENDED_CAPABILITY_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_ID 0x0007 #define PCI_EXPRESS_EXTENDED_CAPABILITY_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_VER1 0x1 diff --git a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c index 766a2ccb9c..dc0f33d3bf 100644 --- a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c +++ b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.c @@ -588,7 +588,7 @@ PciCapListInit ( // Status = PciDevice->ReadConfig ( PciDevice, - PCI_CAPBILITY_POINTER_OFFSET, + PCI_CAPABILITY_POINTER_OFFSET, &NormalCapHdrOffset, sizeof NormalCapHdrOffset ); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c index f47cc97c31..5169646826 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c @@ -5147,8 +5147,8 @@ PrintInterpretedExtendedCompatibilityAcs ( Header->AcsCapability, Header->AcsControl ); - if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL (Header)) { - VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE (Header); + if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRESS_CONTROL (Header)) { + VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRESS_VECTOR_SIZE (Header); if (VectorSize == 0) { VectorSize = 256; } diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c index da55f3e69e..45dea04fec 100644 --- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c +++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c @@ -213,7 +213,7 @@ CalculateUsbDebugPortBar ( // // Get Pointer To Capability List // - CapabilityPtr = PciRead8 (PcdGet32 (PcdUsbEhciPciAddress) + PCI_CAPBILITY_POINTER_OFFSET); + CapabilityPtr = PciRead8 (PcdGet32 (PcdUsbEhciPciAddress) + PCI_CAPABILITY_POINTER_OFFSET); // // Find Capability ID 0xA, Which Is For Debug Port