]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
Update all the code to consume the ConvertDevicePathToText, ConvertDevicePathNodeToTe...
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciEnumerator.c
index 42065738ed6194a17b19db597b51ab203f56b620..ee6656de70ca243c0234bd77ffd97ade3bb62907 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   PCI eunmeration implementation on entire PCI bus system for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -82,7 +82,11 @@ PciEnumerator (
   //\r
   // Notify the pci bus enumeration is about to begin\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginEnumeration);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginEnumeration);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Start the bus allocation phase\r
@@ -105,7 +109,11 @@ PciEnumerator (
   //\r
   // Notify the pci bus enumeration is about to complete\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeEndEnumeration);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeEndEnumeration);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Process P2C\r
@@ -794,7 +802,6 @@ RejectPciDevice (
     if (Temp == PciDevice) {\r
       InitializePciDevice (Temp);\r
       RemoveEntryList (CurrentLink);\r
-      FreePciDevice (Temp);\r
       return EFI_SUCCESS;\r
     }\r
 \r
@@ -1035,6 +1042,11 @@ PciHostBridgeAdjustAllocation (
     //\r
     Status = RejectPciDevice (PciResNode->PciDev);\r
     if (Status == EFI_SUCCESS) {\r
+      DEBUG ((\r
+        EFI_D_ERROR,\r
+        "PciBus: [%02x|%02x|%02x] was rejected due to resource confliction.\n",\r
+        PciResNode->PciDev->BusNumber, PciResNode->PciDev->DeviceNumber, PciResNode->PciDev->FunctionNumber\r
+        ));\r
 \r
       //\r
       // Raise the EFI_IOB_EC_RESOURCE_CONFLICT status code\r
@@ -1867,7 +1879,7 @@ NotifyPhase (
                             );\r
   }\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -2095,6 +2107,14 @@ PciHotPlugRequestNotify (
   RootBridgeHandle = Temp->Handle;\r
 \r
   if (Operation == EfiPciHotPlugRequestAdd) {\r
+    //\r
+    // Report Status Code to indicate hot plug happens\r
+    //\r
+    REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+      EFI_PROGRESS_CODE,\r
+      (EFI_IO_BUS_PCI | EFI_IOB_PC_HOTPLUG),\r
+      Temp->DevicePath\r
+      );\r
 \r
     if (NumberOfChildren != NULL) {\r
       *NumberOfChildren = 0;\r