diff options
author | Dandan Bi <dandan.bi@intel.com> | 2016-02-23 10:59:10 +0800 |
---|---|---|
committer | Feng Tian <feng.tian@intel.com> | 2016-02-25 14:42:24 +0800 |
commit | 3cb44c207cdc21a9d4b0f06d689e00eba43ed361 (patch) | |
tree | ff7ab6175ab0dc83bc182b5addbe9d8b13c6bbe1 | |
parent | 426982abc9e9e840409c9ea4a9a212c791b09c42 (diff) | |
download | edk2-platforms-3cb44c207cdc21a9d4b0f06d689e00eba43ed361.tar.xz |
MdeModulePkg: Add new HII action type EFI_BROWSER_ACTION_SUBMITTED
Add new HII action type EFI_BROWSER_ACTION_SUBMITTED
to notify HII driver when its question values are submitted.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 89869ed4c7..b357e29b3c 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -2449,6 +2449,94 @@ SendDiscardInfoToDriver ( }
/**
+ When submit the question value, call the callback function with Submitted type
+ to inform the hii driver.
+
+ @param FormSet FormSet data structure.
+ @param Form Form data structure.
+
+**/
+VOID
+SubmitCallbackForForm (
+ IN FORM_BROWSER_FORMSET *FormSet,
+ IN FORM_BROWSER_FORM *Form
+ )
+{
+ LIST_ENTRY *Link;
+ FORM_BROWSER_STATEMENT *Question;
+ EFI_IFR_TYPE_VALUE *TypeValue;
+ EFI_BROWSER_ACTION_REQUEST ActionRequest;
+
+ if (FormSet->ConfigAccess == NULL) {
+ return;
+ }
+
+ Link = GetFirstNode (&Form->StatementListHead);
+ while (!IsNull (&Form->StatementListHead, Link)) {
+ Question = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
+ Link = GetNextNode (&Form->StatementListHead, Link);
+
+ if (Question->Storage == NULL || Question->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE) {
+ continue;
+ }
+
+ if ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != EFI_IFR_FLAG_CALLBACK) {
+ continue;
+ }
+
+ if (Question->Operand == EFI_IFR_PASSWORD_OP) {
+ continue;
+ }
+
+ if (Question->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
+ TypeValue = (EFI_IFR_TYPE_VALUE *) Question->BufferValue;
+ } else {
+ TypeValue = &Question->HiiValue.Value;
+ }
+
+ ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
+ FormSet->ConfigAccess->Callback (
+ FormSet->ConfigAccess,
+ EFI_BROWSER_ACTION_SUBMITTED,
+ Question->QuestionId,
+ Question->HiiValue.Type,
+ TypeValue,
+ &ActionRequest
+ );
+ }
+}
+
+/**
+ When value set Success, call the submit callback function.
+
+ @param FormSet FormSet data structure.
+ @param Form Form data structure.
+
+**/
+VOID
+SubmitCallback (
+ IN FORM_BROWSER_FORMSET *FormSet,
+ IN FORM_BROWSER_FORM *Form
+ )
+{
+ FORM_BROWSER_FORM *CurrentForm;
+ LIST_ENTRY *Link;
+
+ if (Form != NULL) {
+ SubmitCallbackForForm(FormSet, Form);
+ return;
+ }
+
+ Link = GetFirstNode (&FormSet->FormListHead);
+ while (!IsNull (&FormSet->FormListHead, Link)) {
+ CurrentForm = FORM_BROWSER_FORM_FROM_LINK (Link);
+ Link = GetNextNode (&FormSet->FormListHead, Link);
+
+ SubmitCallbackForForm(FormSet, CurrentForm);
+ }
+}
+
+/**
Validate the HiiHandle.
@param HiiHandle The input HiiHandle which need to validate.
@@ -3081,6 +3169,11 @@ SubmitForForm ( //
ValueChangeResetFlagUpdate(TRUE, FormSet, Form);
+ //
+ // 6 Call callback with Submitted type to inform the driver.
+ //
+ SubmitCallback (FormSet, Form);
+
return Status;
}
@@ -3255,6 +3348,11 @@ SubmitForFormSet ( //
ValueChangeResetFlagUpdate(TRUE, FormSet, NULL);
+ //
+ // 6. Call callback with Submitted type to inform the driver.
+ //
+ SubmitCallback (FormSet, NULL);
+
return Status;
}
|