]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
MdeModulePkg: exit pci function loops early if device is not multi-function
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciEnumeratorSupport.c
index f46025e2f61c54f3b32b4a3cd45792c5a0e072da..f7aea4fd80c8423723e4c3db7bf54f5442f1bdfd 100644 (file)
@@ -2,6 +2,7 @@
   PCI emumeration support functions implementation for PCI Bus module.\r
 \r
 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP<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
@@ -119,6 +120,14 @@ PciPciDeviceInfoCollector (
                  (UINT8) Device,\r
                  (UINT8) Func\r
                  );\r
+\r
+      if (EFI_ERROR (Status) && Func == 0) {\r
+        //\r
+        // go to next device if there is no Function 0\r
+        //\r
+        break;\r
+      }\r
+\r
       if (!EFI_ERROR (Status)) {\r
 \r
         //\r
@@ -2597,6 +2606,13 @@ ResetAllPpbBusNumber (
                  Func\r
                  );\r
 \r
+      if (EFI_ERROR (Status) && Func == 0) {\r
+        //\r
+        // go to next device if there is no Function 0\r
+        //\r
+        break;\r
+      }\r
+\r
       if (!EFI_ERROR (Status) && (IS_PCI_BRIDGE (&Pci))) {\r
 \r
         Register  = 0;\r