From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.16924.1586366937670638870 for ; Wed, 08 Apr 2020 10:28:57 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 10B1D31B; Wed, 8 Apr 2020 10:28:52 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (unknown [10.37.8.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A90E63F52E; Wed, 8 Apr 2020 10:28:49 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Zhichao Gao , Ray Ni , Jian J Wang , Hao A Wu , Dandan Bi Subject: [PATCH] MdeModulePkg/DeviceManagerUiLib: connect all before creating menu page Date: Wed, 8 Apr 2020 19:28:07 +0200 Message-Id: <20200408172807.10108-1-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 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 Cc: Ray Ni Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Signed-off-by: Ard Biesheuvel --- 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 #include #include +#include #include // 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