]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SetupBrowserDxe:Follow spec'd way to reconnect driver
authorWalon Li <walon.li@hpe.com>
Fri, 24 Jun 2022 06:07:47 +0000 (14:07 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 22 Jul 2022 06:19:53 +0000 (06:19 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3952

In UEFI spec, it defines reconnect timing that will be activated upon
exiting of the formset or the browser. However, we did't use this kind
of way to check reconnect conditioncode. Code only blocks reconnect if
page is updated dynamically. That's not matched spec'd way. We should
check current formset whether is exiting, then reconnect driver.

Signed-off-by: Walon Li <walon.li@hpe.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

index 9587b08d6d82be5a771451d67bb76bd82a446f44..babef214974ea7c62a7c79d371982a9f7b12c921 100644 (file)
@@ -2,7 +2,7 @@
 Utility functions for UI presentation.\r
 \r
 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2015 - 2022 Hewlett Packard Enterprise Development LP<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -21,7 +21,6 @@ LIST_ENTRY                mRefreshEventList  = INITIALIZE_LIST_HEAD_VARIABLE (mR
 UINT16                    mCurFakeQestId;\r
 FORM_DISPLAY_ENGINE_FORM  gDisplayFormData;\r
 BOOLEAN                   mFinishRetrieveCall = FALSE;\r
-BOOLEAN                   mDynamicFormUpdated = FALSE;\r
 \r
 /**\r
   Check whether the ConfigAccess protocol is available.\r
@@ -1791,7 +1790,6 @@ FormUpdateNotify (
   )\r
 {\r
   mHiiPackageListUpdated = TRUE;\r
-  mDynamicFormUpdated    = TRUE;\r
 \r
   return EFI_SUCCESS;\r
 }\r
index fe0d46d93ff201b6780eaabb97b0e59e0042750c..5158baf5bd55e9cd9c87c7c7744aed4aee012e3f 100644 (file)
@@ -2,7 +2,7 @@
 Entry and initialization module for the browser.\r
 \r
 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2020 - 2022 Hewlett Packard Enterprise Development LP<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -68,7 +68,6 @@ extern EFI_GUID                  mCurrentFormSetGuid;
 extern EFI_HII_HANDLE            mCurrentHiiHandle;\r
 extern UINT16                    mCurrentFormId;\r
 extern FORM_DISPLAY_ENGINE_FORM  gDisplayFormData;\r
-extern BOOLEAN                   mDynamicFormUpdated;\r
 \r
 /**\r
   Create a menu with specified formset GUID and form ID, and add it as a child\r
@@ -539,7 +538,6 @@ SendForm (
 \r
       Selection->FormSet  = FormSet;\r
       mSystemLevelFormSet = FormSet;\r
-      mDynamicFormUpdated = FALSE;\r
 \r
       //\r
       // Display this formset\r
@@ -552,10 +550,9 @@ SendForm (
       mSystemLevelFormSet = NULL;\r
 \r
       //\r
-      // If callback update form dynamically, it's not exiting of the formset for user so system do not reconnect driver hanlde\r
-      // this time.\r
+      // Check incoming formset whether is same with previous. If yes, that means action is not exiting of formset so do not reconnect controller.\r
       //\r
-      if (!mDynamicFormUpdated && (gFlagReconnect || gCallbackReconnect)) {\r
+      if ((gFlagReconnect || gCallbackReconnect) && !CompareGuid (&FormSet->Guid, &Selection->FormSetGuid)) {\r
         RetVal = ReconnectController (FormSet->DriverHandle);\r
         if (!RetVal) {\r
           PopupErrorMessage (BROWSER_RECONNECT_FAIL, NULL, NULL, NULL);\r