]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
MdeModulePkg/UefiBootManagerLib: Generate boot description for NVME
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmDriverHealth.c
index bffbedaf84469cb6edf55ca3c88b5f36bce52cae..ddcee8b0676f9f387b897dfe29bb9a74e9e0230d 100644 (file)
@@ -1,8 +1,9 @@
 /** @file\r
   Library functions which relates with driver health.\r
 \r
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2016 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
@@ -439,17 +440,22 @@ BmRepairAllControllers (
   BOOLEAN                             RebootRequired;\r
   EFI_HII_HANDLE                      *HiiHandles;\r
   EFI_FORM_BROWSER2_PROTOCOL          *FormBrowser2;\r
+  UINT32                              MaxRepairCount;\r
+  UINT32                              RepairCount;\r
 \r
   //\r
   // Configure PcdDriverHealthConfigureForm to ZeroGuid to disable driver health check.\r
   //\r
-  if (CompareGuid (PcdGetPtr (PcdDriverHealthConfigureForm), &gZeroGuid)) {\r
+  if (IsZeroGuid (PcdGetPtr (PcdDriverHealthConfigureForm))) {\r
     return;\r
   }\r
 \r
   Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &FormBrowser2);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  MaxRepairCount = PcdGet32 (PcdMaxRepairCount);\r
+  RepairCount = 0;\r
+\r
   do {\r
     RepairRequired        = FALSE;\r
     ConfigurationRequired = FALSE;\r
@@ -512,7 +518,8 @@ BmRepairAllControllers (
     }\r
   \r
     EfiBootManagerFreeDriverHealthInfo (DriverHealthInfo, Count);\r
-  } while (RepairRequired || ConfigurationRequired);\r
+    RepairCount++;\r
+  } while ((RepairRequired || ConfigurationRequired) && ((MaxRepairCount == 0) || (RepairCount < MaxRepairCount)));\r
 \r
   RebootRequired    = FALSE;\r
   ReconnectRequired = FALSE;\r