NetworkPkg/TlsAuthConfigDxe: Use HiiPopUp() instead of CreatePopUp()
authorKeysound Chang <Keysound_Chang@phoenix.com>
Thu, 9 Apr 2020 06:56:41 +0000 (14:56 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 17 Apr 2020 17:34:33 +0000 (17:34 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2635

According to EDK2 Driver Writer's Guide For UEFI 2.3.1, 4.2.18 Offer
alternatives to function keys. Configuration of drivers should be
accomplished via HII and via OS-present interfaces.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h

index 3fc924a..0ada835 100644 (file)
@@ -52,6 +52,7 @@
 [Protocols]\r
   gEfiDevicePathProtocolGuid                    ## PRODUCES\r
   gEfiHiiConfigAccessProtocolGuid               ## PRODUCES\r
+  gEfiHiiPopupProtocolGuid                      ## CONSUMES\r
 \r
 [Guids]\r
   gTlsAuthConfigGuid                            ## PRODUCES  ## GUID\r
index 973b8b7..2b4a27d 100644 (file)
@@ -28,6 +28,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #string STR_TLS_AUTH_CONFIG_SAVE_AND_EXIT            #language en-US "Commit Changes and Exit"\r
 #string STR_TLS_AUTH_CONFIG_NO_SAVE_AND_EXIT         #language en-US "Discard Changes and Exit"\r
 \r
+#string STR_TLS_AUTH_ENROLL_CERT_FAILURE             #language en-US "Enroll Cert Failure!"\r
+\r
 #string STR_CERT_TYPE_PCKS_GUID                      #language en-US "GUID for CERT"\r
 \r
 #string STR_NULL                                     #language en-US ""\r
index 2481d10..110fe87 100644 (file)
@@ -1383,7 +1383,6 @@ TlsAuthConfigAccessCallback (
   OUT    EFI_BROWSER_ACTION_REQUEST             *ActionRequest\r
   )\r
 {\r
-  EFI_INPUT_KEY                   Key;\r
   EFI_STATUS                      Status;\r
   RETURN_STATUS                   RStatus;\r
   TLS_AUTH_CONFIG_PRIVATE_DATA    *Private;\r
@@ -1391,6 +1390,8 @@ TlsAuthConfigAccessCallback (
   TLS_AUTH_CONFIG_IFR_NVDATA      *IfrNvData;\r
   UINT16                          LabelId;\r
   EFI_DEVICE_PATH_PROTOCOL        *File;\r
+  EFI_HII_POPUP_PROTOCOL          *HiiPopUp;\r
+  EFI_HII_POPUP_SELECTION         PopUpSelect;\r
 \r
   Status           = EFI_SUCCESS;\r
   File             = NULL;\r
@@ -1402,6 +1403,11 @@ TlsAuthConfigAccessCallback (
   Private = TLS_AUTH_CONFIG_PRIVATE_FROM_THIS (This);\r
 \r
   mTlsAuthPrivateData = Private;\r
+  Status = gBS->LocateProtocol (&gEfiHiiPopupProtocolGuid, NULL, (VOID**) &HiiPopUp);\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((DEBUG_ERROR, "Can't find Form PopUp protocol. Exit (%r)\n", Status));\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Retrieve uncommitted data from Browser\r
@@ -1460,11 +1466,13 @@ TlsAuthConfigAccessCallback (
       if (EFI_ERROR (Status)) {\r
         CleanFileContext (Private);\r
 \r
-        CreatePopUp (\r
-          EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
-          &Key,\r
-          L"ERROR: Enroll Cert Failure!",\r
-          NULL\r
+        HiiPopUp->CreatePopup (\r
+          HiiPopUp,\r
+          EfiHiiPopupStyleError,\r
+          EfiHiiPopupTypeOk,\r
+          Private->RegisteredHandle,\r
+          STRING_TOKEN (STR_TLS_AUTH_ENROLL_CERT_FAILURE),\r
+          &PopUpSelect\r
           );\r
       }\r
       break;\r
index e9af492..68c1684 100644 (file)
@@ -14,6 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 \r
 #include <Protocol/HiiConfigAccess.h>\r
 #include <Protocol/SimpleFileSystem.h>\r
+#include <Protocol/HiiPopup.h>\r
 \r
 //\r
 // Libraries\r