]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumerator.c
1. Added EdkPciIncompatibleDeviceSupportLib in EdkModulePkg, this library is used...
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / PciBus / Dxe / PciEnumerator.c
index d3566a16009c3421804a11586dbe0456fe5b9c45..e7a05a2ec9be40c4eebfa2c6442fce3f971508f2 100644 (file)
@@ -1,18 +1,18 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
 \r
   PciEnumerator.c\r
-  \r
+\r
 Abstract:\r
 \r
   PCI Bus Driver\r
@@ -21,7 +21,7 @@ Revision History
 \r
 --*/\r
 \r
-#include "Pcibus.h"\r
+#include "pcibus.h"\r
 #include "PciEnumerator.h"\r
 #include "PciResourceSupport.h"\r
 #include "PciOptionRomSupport.h"\r
@@ -34,7 +34,7 @@ PciEnumerator (
 \r
 Routine Description:\r
 \r
-  This routine is used to enumerate entire pci bus system \r
+  This routine is used to enumerate entire pci bus system\r
   in a given platform\r
 \r
 Arguments:\r
@@ -118,7 +118,7 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-      \r
+\r
   //\r
   // Submit the resource request\r
   //\r
@@ -127,7 +127,7 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Process P2C\r
   //\r
@@ -136,7 +136,7 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Process attributes for devices on this host bridge\r
   //\r
@@ -286,7 +286,7 @@ Returns:
   while (CurrentLink && CurrentLink != &Bridge->ChildList) {\r
     Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
     if (!IsListEmpty (&Temp->ChildList)) {\r
-      \r
+\r
       //\r
       // Go further to process the option rom under this bridge\r
       //\r
@@ -294,7 +294,7 @@ Returns:
     }\r
 \r
     if (Temp->RomSize != 0 && Temp->RomSize <= MaxLength) {\r
-     \r
+\r
       //\r
       // Load and process the option rom\r
       //\r
@@ -382,8 +382,9 @@ Returns:
 \r
         Address   = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x18);\r
 \r
-        Status = PciRootBridgeIo->Pci.Write (\r
+        Status = PciRootBridgeIoWrite (\r
                                         PciRootBridgeIo,\r
+                                        &Pci,\r
                                         EfiPciWidthUint16,\r
                                         Address,\r
                                         1,\r
@@ -394,8 +395,9 @@ Returns:
         // Initialize SubBusNumber to SecondBus\r
         //\r
         Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x1A);\r
-        Status = PciRootBridgeIo->Pci.Write (\r
+        Status = PciRootBridgeIoWrite (\r
                                         PciRootBridgeIo,\r
+                                        &Pci,\r
                                         EfiPciWidthUint8,\r
                                         Address,\r
                                         1,\r
@@ -407,8 +409,9 @@ Returns:
         if (IS_PCI_BRIDGE (&Pci)) {\r
 \r
           Register8 = 0xFF;\r
-          Status = PciRootBridgeIo->Pci.Write (\r
+          Status = PciRootBridgeIoWrite (\r
                                           PciRootBridgeIo,\r
+                                          &Pci,\r
                                           EfiPciWidthUint8,\r
                                           Address,\r
                                           1,\r
@@ -432,8 +435,9 @@ Returns:
 \r
         Address = EFI_PCI_ADDRESS (StartBusNumber, Device, Func, 0x1A);\r
 \r
-        Status = PciRootBridgeIo->Pci.Write (\r
+        Status = PciRootBridgeIoWrite (\r
                                         PciRootBridgeIo,\r
+                                        &Pci,\r
                                         EfiPciWidthUint8,\r
                                         Address,\r
                                         1,\r
@@ -503,7 +507,7 @@ Returns:
   // Here is the point where PCI bus driver calls HOST bridge allocation protocol\r
   // Currently we hardcoded for ea815\r
   //\r
-  \r
+\r
   if (Attributes & EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM) {\r
     RootBridgeDev->Decodes |= EFI_BRIDGE_PMEM_MEM_COMBINE_SUPPORTED;\r
   }\r
@@ -526,7 +530,7 @@ GetMaxOptionRomSize (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
     Get Max Option Rom size on this bridge\r
 \r
 Arguments:\r
@@ -552,7 +556,7 @@ Returns:
   while (CurrentLink && CurrentLink != &Bridge->ChildList) {\r
     Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
     if (!IsListEmpty (&Temp->ChildList)) {\r
-      \r
+\r
       //\r
       // Get max option rom size under this bridge\r
       //\r
@@ -567,13 +571,13 @@ Returns:
       }\r
 \r
     } else {\r
-      \r
+\r
       //\r
       // For devices get the rom size directly\r
       //\r
       TempOptionRomSize = Temp->RomSize;\r
     }\r
-    \r
+\r
     //\r
     // Get the largest rom size on this bridge\r
     //\r
@@ -594,7 +598,7 @@ PciHostBridgeDeviceAttribute (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
     Process attributes of devices on this host bridge\r
 \r
 Arguments:\r
@@ -650,7 +654,7 @@ GetResourceAllocationStatus (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
     Get resource allocation status from the ACPI pointer\r
 \r
 Arguments:\r
@@ -736,7 +740,7 @@ RejectPciDevice (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
     Remove a PCI device from device pool and mark its bar\r
 \r
 Arguments:\r
@@ -789,7 +793,7 @@ Returns:
     //\r
     InitializeP2C (PciDevice);\r
   }\r
-    \r
+\r
   //\r
   // Remove the device\r
   //\r
@@ -817,7 +821,7 @@ IsRejectiveDevice (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
     Determine whethter a PCI device can be rejected\r
 \r
 Arguments:\r
@@ -839,7 +843,7 @@ Returns:
   if (!Temp) {\r
     return FALSE;\r
   }\r
-    \r
+\r
   //\r
   // PPB and RB should go ahead\r
   //\r
@@ -853,7 +857,7 @@ Returns:
   if ((Temp->Parent) && (Temp->BusNumber == 0)) {\r
     return FALSE;\r
   }\r
-  \r
+\r
   //\r
   // Skip VGA\r
   //\r
@@ -872,7 +876,7 @@ GetLargerConsumerDevice (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
     Get the larger resource consumer\r
 \r
 Arguments:\r
@@ -914,8 +918,8 @@ GetMaxResourceConsumerDevice (
 /*++\r
 \r
 Routine Description:\r
-  \r
-    Get the max resource consumer in the host resource pool \r
+\r
+    Get the max resource consumer in the host resource pool\r
 \r
 Arguments:\r
 \r
@@ -974,7 +978,7 @@ PciHostBridgeAdjustAllocation (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
     Adjust host bridge allocation so as to reduce resource requirement\r
 \r
 Arguments:\r
@@ -1039,7 +1043,7 @@ Returns:
       //\r
       return EFI_ABORTED;\r
     }\r
-    \r
+\r
     //\r
     // Hostbridge hasn't enough resource\r
     //\r
@@ -1047,7 +1051,7 @@ Returns:
     if (!PciResNode) {\r
       continue;\r
     }\r
-    \r
+\r
     //\r
     // Check if the device has been removed before\r
     //\r
@@ -1056,13 +1060,13 @@ Returns:
         continue;\r
       }\r
     }\r
-    \r
+\r
     //\r
     // Remove the device if it isn't in the array\r
     //\r
     Status = RejectPciDevice (PciResNode->PciDev);\r
     if (Status == EFI_SUCCESS) {\r
-      \r
+\r
       //\r
       // Raise the EFI_IOB_EC_RESOURCE_CONFLICT status code\r
       //\r
@@ -1399,7 +1403,7 @@ Returns:
       // Memory type aperture\r
       //\r
       case 0:\r
-  \r
+\r
         //\r
         // Check to see the granularity\r
         //\r
@@ -1471,7 +1475,7 @@ Returns:
   SubBusNumber    = 0;\r
   StartBusNumber  = 0;\r
   PciIo           = &(BridgeDev->PciIo);\r
-  Status          = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x19, 1, &StartBusNumber);\r
+  Status          = PciIoRead (PciIo, EfiPciIoWidthUint8, 0x19, 1, &StartBusNumber);\r
 \r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -1896,7 +1900,7 @@ Returns:
   if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r
   }\r
-  \r
+\r
   //\r
   // Get Root Brige Handle\r
   //\r
@@ -1965,7 +1969,7 @@ PciHotPlugRequestNotify (
 Routine Description:\r
 \r
   Hot plug request notify.\r
-  \r
+\r
 Arguments:\r
 \r
   This                 - A pointer to the hot plug request protocol.\r
@@ -2082,7 +2086,7 @@ SearchHostBridgeHandle (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
 Arguments:\r
 \r
 Returns:\r
@@ -2130,7 +2134,7 @@ AddHostBridgeEnumerator (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
 Arguments:\r
 \r
 Returns:\r