public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 0/3] Add support of EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY
@ 2024-01-02  3:27 Tan, Ming
  2024-01-02  3:27 ` [edk2-devel] [PATCH 1/3] MdePkg: Add EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tan, Ming @ 2024-01-02  3:27 UTC (permalink / raw)
  To: devel

*** BLURB HERE ***

Ming Tan (3):
  MdePkg: Add EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY
  MdeModulePkg/SetupBrowserDxe:
    EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY
  MdeModulePkg/DriverSampleDxe:
    EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY

 .../Universal/DriverSampleDxe/DriverSample.c       | 14 ++++++++++++++
 .../Universal/DriverSampleDxe/NVDataStruc.h        |  1 +
 MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr     | 10 ++++++++++
 .../Universal/DriverSampleDxe/VfrStrings.uni       |  4 ++++
 .../Universal/SetupBrowserDxe/Presentation.c       |  9 +++++++++
 MdePkg/Include/Protocol/FormBrowser2.h             |  1 +
 6 files changed, 39 insertions(+)

-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113023): https://edk2.groups.io/g/devel/message/113023
Mute This Topic: https://groups.io/mt/103475993/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* [edk2-devel] [PATCH 1/3] MdePkg: Add EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY
  2024-01-02  3:27 [edk2-devel] [PATCH 0/3] Add support of EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
@ 2024-01-02  3:27 ` Tan, Ming
  2024-01-02  3:27 ` [edk2-devel] [PATCH 2/3] MdeModulePkg/SetupBrowserDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
  2024-01-02  3:27 ` [edk2-devel] [PATCH 3/3] MdeModulePkg/DriverSampleDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
  2 siblings, 0 replies; 4+ messages in thread
From: Tan, Ming @ 2024-01-02  3:27 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Dandan Bi

REF: UEFI_Spec_2_10_Aug29.pdf page 1694

In 35.5.4 EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack() parameter
ActionRequest, add EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY.

Signed-off-by: Ming Tan <ming.tan@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
---
 MdePkg/Include/Protocol/FormBrowser2.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdePkg/Include/Protocol/FormBrowser2.h b/MdePkg/Include/Protocol/FormBrowser2.h
index 436a7723c1..7498dc2a07 100644
--- a/MdePkg/Include/Protocol/FormBrowser2.h
+++ b/MdePkg/Include/Protocol/FormBrowser2.h
@@ -55,6 +55,7 @@ typedef UINTN EFI_BROWSER_ACTION_REQUEST;
 #define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY         6
 #define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD       7
 #define EFI_BROWSER_ACTION_REQUEST_RECONNECT          8
+#define EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY     9
 
 /**
   Initialize the browser to display the specified configuration forms.
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113022): https://edk2.groups.io/g/devel/message/113022
Mute This Topic: https://groups.io/mt/103475992/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* [edk2-devel] [PATCH 2/3] MdeModulePkg/SetupBrowserDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY
  2024-01-02  3:27 [edk2-devel] [PATCH 0/3] Add support of EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
  2024-01-02  3:27 ` [edk2-devel] [PATCH 1/3] MdePkg: Add EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
@ 2024-01-02  3:27 ` Tan, Ming
  2024-01-02  3:27 ` [edk2-devel] [PATCH 3/3] MdeModulePkg/DriverSampleDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
  2 siblings, 0 replies; 4+ messages in thread
From: Tan, Ming @ 2024-01-02  3:27 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Dandan Bi

REF: UEFI_Spec_2_10_Aug29.pdf page 1695.

In 35.5.4 EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack():
If the callback function returns with the ActionRequest set to
_QUESTION_APPLY, then the Forms Browser will write the current modified
question value on the selected form to storage.

Update the SetupBrowserDxe, if callback function return
EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY, then call SetQuestionValue
with GetSetValueWithHiiDriver to apply the change immediately.

Signed-off-by: Ming Tan <ming.tan@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index babef21497..de7e79e8ab 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -2145,6 +2145,15 @@ ProcessCallBackFunction (
               gCallbackReconnect = TRUE;
               break;
 
+            case EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY:
+              Status = SetQuestionValue (
+                         gCurrentSelection->FormSet,
+                         gCurrentSelection->Form,
+                         Statement,
+                         GetSetValueWithHiiDriver
+                         );
+              break;
+
             default:
               break;
           }
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113024): https://edk2.groups.io/g/devel/message/113024
Mute This Topic: https://groups.io/mt/103475994/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* [edk2-devel] [PATCH 3/3] MdeModulePkg/DriverSampleDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY
  2024-01-02  3:27 [edk2-devel] [PATCH 0/3] Add support of EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
  2024-01-02  3:27 ` [edk2-devel] [PATCH 1/3] MdePkg: Add EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
  2024-01-02  3:27 ` [edk2-devel] [PATCH 2/3] MdeModulePkg/SetupBrowserDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
@ 2024-01-02  3:27 ` Tan, Ming
  2 siblings, 0 replies; 4+ messages in thread
From: Tan, Ming @ 2024-01-02  3:27 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Dandan Bi

REF: UEFI_Spec_2_10_Aug29.pdf page 1695.

In 35.5.4 EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack():
If the callback function returns with the ActionRequest set to
_QUESTION_APPLY, then the Forms Browser will write the current modified
question value on the selected form to storage.

Update the DriverSampleDxe, add a new question "Question apply test".

Signed-off-by: Ming Tan <ming.tan@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
---
 .../Universal/DriverSampleDxe/DriverSample.c       | 14 ++++++++++++++
 .../Universal/DriverSampleDxe/NVDataStruc.h        |  1 +
 MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr     | 10 ++++++++++
 .../Universal/DriverSampleDxe/VfrStrings.uni       |  4 ++++
 4 files changed, 29 insertions(+)

diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index 62ba52e940..cbc8900eb9 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -858,6 +858,7 @@ ExtractConfig (
   @retval EFI_INVALID_PARAMETER  Configuration is NULL.
   @retval EFI_NOT_FOUND          Routing data doesn't match any storage in this
                                  driver.
+  @retval EFI_DEVICE_ERROR       If value is 44, return error for testing.
 
 **/
 EFI_STATUS
@@ -1065,6 +1066,12 @@ RouteConfig (
     return Status;
   }
 
+
+  if (PrivateData->Configuration.QuestionApply == 44) {
+    // Return error for verify the error handling of caller.
+    return EFI_DEVICE_ERROR;
+  }
+
   //
   // Store Buffer Storage back to EFI variable
   //
@@ -1599,6 +1606,13 @@ DriverCallback (
           *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
           break;
 
+        case 0x1253:
+          //
+          // User change the value of "Question apply test".
+          //
+          *ActionRequest = EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY;
+          break;
+
         case 0x1231:
           //
           // 1. Check to see whether system support keyword.
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
index 489d7bcbf3..3f5388946d 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
+++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
@@ -95,6 +95,7 @@ typedef struct {
   MY_EFI_UNION_DATA    MyUnionData;
   UINT8                QuestionXUefiKeywordRestStyle;
   UINT8                QuestionNonXUefiKeywordRestStyle;
+  UINT8                QuestionApply;
 } DRIVER_SAMPLE_CONFIGURATION;
 
 //
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
index 5323e2b411..0c376fe9b7 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
+++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
@@ -513,6 +513,16 @@ formset
             default = 18,
     endnumeric;
 
+    numeric varid   = MyIfrNVData.QuestionApply,
+            questionid = 0x1253,
+            prompt  = STRING_TOKEN(STR_QUESTION_APPLY_TEST_PROMPT),
+            help    = STRING_TOKEN(STR_QUESTION_APPLY_TEST_HELP),
+            flags   = INTERACTIVE,
+            minimum = 0,
+            maximum = 255,
+            default = 19,
+    endnumeric;
+
     text
       help  = STRING_TOKEN(STR_POPUP_TEST_HELP),
       text  = STRING_TOKEN(STR_POPUP_TEST_PROMPT),
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
index 8a3e286bec..ed906045fd 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
+++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
@@ -269,6 +269,10 @@
                                                      #language fr-FR "Submitted callback test"
 #string STR_SUBMITTED_CALLBACK_TEST_HELP             #language en-US "Change the value and press F10 to submit will pop up a dialogue to show SUBMITTED Callback has been triggered"
                                                      #language fr-FR "Change the value and press F10 to submit will pop up a dialogue to show SUBMITTED Callback has been triggered"
+#string STR_QUESTION_APPLY_TEST_PROMPT               #language en-US "Question apply test"
+                                                     #language fr-FR "Question apply test"
+#string STR_QUESTION_APPLY_TEST_HELP                 #language en-US "Change the value and it will be applied automaticlly. If set to 44, then return failed."
+                                                     #language fr-FR "Change the value and it will be applied automaticlly. If set to 44, then return failed."
 #string STR_POPUP_TEST_PROMPT                        #language en-US "Select it to invoke Hii Popup Protocol"
                                                      #language fr-FR "Select it to invoke Hii Popup Protocol"
 #string STR_POPUP_TEST_HELP                          #language en-US "Select this question will pop up a message box, then user can decide whether exit current form or not"
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113025): https://edk2.groups.io/g/devel/message/113025
Mute This Topic: https://groups.io/mt/103475995/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

end of thread, other threads:[~2024-01-02  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-02  3:27 [edk2-devel] [PATCH 0/3] Add support of EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
2024-01-02  3:27 ` [edk2-devel] [PATCH 1/3] MdePkg: Add EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
2024-01-02  3:27 ` [edk2-devel] [PATCH 2/3] MdeModulePkg/SetupBrowserDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming
2024-01-02  3:27 ` [edk2-devel] [PATCH 3/3] MdeModulePkg/DriverSampleDxe: EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY Tan, Ming

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