EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;\r
BOOLEAN BusPadding;\r
UINT32 TempReservedBusNum;\r
+ BOOLEAN IsAriEnabled;\r
\r
PciRootBridgeIo = Bridge->PciRootBridgeIo;\r
SecondBus = 0;\r
BusPadding = FALSE;\r
PciDevice = NULL;\r
PciAddress = 0;\r
+ IsAriEnabled = FALSE;\r
\r
for (Device = 0; Device <= PCI_MAX_DEVICE; Device++) {\r
- TempReservedBusNum = 0;\r
+ if (!IsAriEnabled) {\r
+ TempReservedBusNum = 0;\r
+ }\r
+\r
for (Func = 0; Func <= PCI_MAX_FUNC; Func++) {\r
//\r
// Check to see whether a pci device is present\r
continue;\r
}\r
\r
+ //\r
+ // Per Pcie spec ARI Extended Capability\r
+ // This capability must be implemented by each function in an ARI device.\r
+ // It is not applicable to a Root Port, a Switch Downstream Port, an RCiEP, or a Root Complex Event Collector\r
+ //\r
+ if (((Device == 0) && (Func == 0)) && (PciDevice->IsAriEnabled)) {\r
+ IsAriEnabled = TRUE;\r
+ }\r
+\r
+ if (PciDevice->IsAriEnabled != IsAriEnabled) {\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ "ERROR: %02x:%02x:%02x device ARI Feature(%x) is not consistent with others Function\n",\r
+ StartBusNumber,\r
+ Device,\r
+ Func,\r
+ PciDevice->IsAriEnabled\r
+ ));\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+\r
PciAddress = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0);\r
\r
if (!IS_PCI_BRIDGE (&Pci)) {\r