diff options
author | Dandan Bi <dandan.bi@intel.com> | 2016-09-06 18:14:58 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-10-19 11:37:10 +0800 |
commit | b6f07bdd2af6d28178d6c23bd1931c9baec89107 (patch) | |
tree | 23289b7045f41f19b795c946bb8395dd8dd70792 | |
parent | dff49edc2b9526a721a4fa863bbbf6e4977b58cb (diff) | |
download | edk2-platforms-b6f07bdd2af6d28178d6c23bd1931c9baec89107.tar.xz |
MdeModulePkg/SetupBrowser: Send discard info to driver when fail to submit
When fail to submit data and user discard the change, we should send
the discard info to driver with EFI_BROWSER_ACTION_CHANGED callback.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 2aded895af..7547814575 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -3275,6 +3275,7 @@ SubmitForForm ( Status = EFI_SUCCESS;
}
+ SendDiscardInfoToDriver (FormSet,Form);
} else {
Status = EFI_UNSUPPORTED;
}
@@ -3336,9 +3337,11 @@ SubmitForFormSet ( BOOLEAN HasInserted;
FORM_BROWSER_STATEMENT *Question;
BOOLEAN SubmitFormSetFail;
+ BOOLEAN DiscardChange;
HasInserted = FALSE;
SubmitFormSetFail = FALSE;
+ DiscardChange = FALSE;
if (!IsNvUpdateRequiredForFormSet (FormSet)) {
return EFI_SUCCESS;
@@ -3439,6 +3442,7 @@ SubmitForFormSet ( // If not in system level, just handl the save failed storage here.
//
if (ConfirmSaveFail (Form->FormTitle, FormSet->HiiHandle) == BROWSER_ACTION_DISCARD) {
+ DiscardChange = TRUE;
Link = GetFirstNode (&FormSet->SaveFailStorageListHead);
while (!IsNull (&FormSet->SaveFailStorageListHead, Link)) {
FormSetStorage = FORMSET_STORAGE_FROM_SAVE_FAIL_LINK (Link);
@@ -3488,6 +3492,21 @@ SubmitForFormSet ( }
//
+ // If user discard the change, send the discard info to driver.
+ //
+ if (DiscardChange) {
+ Link = GetFirstNode (&FormSet->FormListHead);
+ while (!IsNull (&FormSet->FormListHead, Link)) {
+ Form = FORM_BROWSER_FORM_FROM_LINK (Link);
+ Link = GetNextNode (&FormSet->FormListHead, Link);
+ //
+ // Call callback with Changed type to inform the driver.
+ //
+ SendDiscardInfoToDriver (FormSet, Form);
+ }
+ }
+
+ //
// 5. Update the NV flag.
//
ValueChangeResetFlagUpdate(TRUE, FormSet, NULL);
@@ -3606,6 +3625,16 @@ SubmitForSystem ( }
}
+ Link = GetFirstNode (&LocalFormSet->FormListHead);
+ while (!IsNull (&LocalFormSet->FormListHead, Link)) {
+ Form = FORM_BROWSER_FORM_FROM_LINK (Link);
+ Link = GetNextNode (&LocalFormSet->FormListHead, Link);
+ //
+ // Call callback with Changed type to inform the driver.
+ //
+ SendDiscardInfoToDriver (LocalFormSet, Form);
+ }
+
if (!IsHiiHandleInBrowserContext (LocalFormSet->HiiHandle)) {
CleanBrowserStorage(LocalFormSet);
RemoveEntryList (&LocalFormSet->Link);
|