public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/DeviceManagerUiLib: connect all before creating menu page
@ 2020-04-08 17:28 Ard Biesheuvel
  2020-04-09  9:29 ` [edk2-devel] " Laszlo Ersek
  0 siblings, 1 reply; 11+ messages in thread
From: Ard Biesheuvel @ 2020-04-08 17:28 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Zhichao Gao, Ray Ni, Jian J Wang, Hao A Wu,
	Dandan Bi

The device manager UI library creates a UiApp submenu that contains a
list of network devices in the system. The logic that creates this menu
assumes that all handles have been connected to their drivers, but this
is not guaranteed in the general case.

So work around this by doing an explicit ConnectAll() before populating
the pages.

Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c        | 7 +++++++
 MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.h        | 1 +
 MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf | 1 +
 3 files changed, 9 insertions(+)

diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
index 0540e6fa8a44..3bc13d340775 100644
--- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
+++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
@@ -892,6 +892,13 @@ DeviceManagerUiLibConstructor (
                   );
   ASSERT (gDeviceManagerPrivate.HiiHandle != NULL);
 
+  //
+  // The device manager form contains a page listing all the network
+  // controllers in the system. This list can only be populated if all
+  // handles have been connected, so do it here.
+  //
+  EfiBootManagerConnectAll ();
+
   //
   // Update boot manager page
   //
diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.h b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.h
index 22fe12d2a5e8..c53c2a1a0e1a 100644
--- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.h
+++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.h
@@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/BaseLib.h>
 #include <Library/HiiLib.h>
 #include <Library/DevicePathLib.h>
+#include <Library/UefiBootManagerLib.h>
 #include <Library/UefiHiiServicesLib.h>
 
 //
diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
index cb01b3b85180..d7f833d8b23a 100644
--- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
+++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
@@ -40,6 +40,7 @@ [LibraryClasses]
   DebugLib
   PrintLib
   HiiLib
+  UefiBootManagerLib
   UefiHiiServicesLib
 
 [Guids]
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-04-30  7:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-08 17:28 [PATCH] MdeModulePkg/DeviceManagerUiLib: connect all before creating menu page Ard Biesheuvel
2020-04-09  9:29 ` [edk2-devel] " Laszlo Ersek
2020-04-09  9:37   ` Ard Biesheuvel
2020-04-09 13:30     ` Laszlo Ersek
2020-04-12  7:55     ` Dandan Bi
2020-04-12  8:11       ` Hot Tian
2020-04-14 10:02         ` Laszlo Ersek
2020-04-12  8:21       ` Ard Biesheuvel
2020-04-19  8:06         ` Dandan Bi
2020-04-24 17:59           ` Ard Biesheuvel
     [not found]           ` <1608D342B47ED79B.10837@groups.io>
2020-04-30  7:52             ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox