]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
MdeModulePkg/Bus: Fix typos in comments
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciBus.c
index 517250abe1735a9f5fb0637f9b1790ee1fd493dc..f3be47a496dbb81048e097a3abfe02ede3e007c9 100644 (file)
@@ -8,7 +8,7 @@
   PCI Root Bridges. So it means platform needs install PCI Root Bridge IO protocol for each\r
   PCI Root Bus and install PCI Host Bridge Resource Allocation Protocol.\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, 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
@@ -34,7 +34,7 @@ EFI_DRIVER_BINDING_PROTOCOL                   gPciBusDriverBinding = {
 };\r
 \r
 EFI_HANDLE                                    gPciHostBrigeHandles[PCI_MAX_HOST_BRIDGE_NUM];\r
-EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL  *gEfiIncompatiblePciDeviceSupport = NULL;\r
+EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL  *gIncompatiblePciDeviceSupport = NULL;\r
 UINTN                                         gPciHostBridgeNumber = 0;\r
 BOOLEAN                                       gFullEnumeration     = TRUE;\r
 UINT64                                        gAllOne              = 0xFFFFFFFFFFFFFFFFULL;\r
@@ -113,7 +113,7 @@ PciBusEntryPoint (
 \r
   @param  This                Protocol instance pointer.\r
   @param  Controller          Handle of device to test.\r
-  @param  RemainingDevicePath Optional parameter use to pick a specific child.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
                               device to start.\r
 \r
   @retval EFI_SUCCESS         This driver supports this device.\r
@@ -223,7 +223,7 @@ PciBusDriverBindingSupported (
 \r
   @param  This                 Protocol instance pointer.\r
   @param  Controller           Handle of device to bind driver to.\r
-  @param  RemainingDevicePath  Optional parameter use to pick a specific child.\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
                                device to start.\r
 \r
   @retval EFI_SUCCESS          This driver is added to ControllerHandle.\r
@@ -239,7 +239,8 @@ PciBusDriverBindingStart (
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   )\r
 {\r
-  EFI_STATUS  Status;\r
+  EFI_STATUS                Status;\r
+  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
 \r
   //\r
   // Check RemainingDevicePath validation\r
@@ -254,11 +255,11 @@ PciBusDriverBindingStart (
     }\r
   }\r
 \r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiIncompatiblePciDeviceSupportProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) &gEfiIncompatiblePciDeviceSupport\r
-                  );\r
+  gBS->LocateProtocol (\r
+         &gEfiIncompatiblePciDeviceSupportProtocolGuid,\r
+         NULL,\r
+         (VOID **) &gIncompatiblePciDeviceSupport\r
+         );\r
 \r
   //\r
   // If PCI Platform protocol is available, get it now.\r
@@ -283,7 +284,33 @@ PciBusDriverBindingStart (
           );\r
   }  \r
 \r
-  gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));\r
+  if (PcdGetBool (PcdPciDisableBusEnumeration)) {\r
+    gFullEnumeration = FALSE;\r
+  } else {\r
+    gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));\r
+  }\r
+\r
+  //\r
+  // Open Device Path Protocol for PCI root bridge\r
+  //\r
+  Status = gBS->OpenProtocol (\r
+                  Controller,\r
+                  &gEfiDevicePathProtocolGuid,\r
+                  (VOID **) &ParentDevicePath,\r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+                  );  \r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Report Status Code to indicate PCI bus starts\r
+  //\r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_PROGRESS_CODE,\r
+    (EFI_IO_BUS_PCI | EFI_IOB_PC_INIT),\r
+    ParentDevicePath\r
+    );\r
 \r
   //\r
   // Enumerate the entire host bridge\r
@@ -305,7 +332,7 @@ PciBusDriverBindingStart (
 }\r
 \r
 /**\r
-  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  Stop this driver on ControllerHandle. Support stopping any child handles\r
   created by this driver.\r
 \r
   @param  This              Protocol instance pointer.\r