From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 472921A1E6F for ; Tue, 11 Oct 2016 00:31:31 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 11 Oct 2016 00:31:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,476,1473145200"; d="scan'208";a="888778930" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga003.jf.intel.com with ESMTP; 11 Oct 2016 00:31:29 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Liming Gao , Eric Dong Date: Tue, 11 Oct 2016 15:30:52 +0800 Message-Id: <1476171052-59984-2-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1476171052-59984-1-git-send-email-dandan.bi@intel.com> References: <1476171052-59984-1-git-send-email-dandan.bi@intel.com> Subject: [patch] MdeModulePkg/SetupBrowser: Send discard info to driver when fail to submit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2016 07:31:31 -0000 When fail to submit data and user discard the change, we should send the discard info to river with EFI_BROWSER_ACTION_CHANGED callback. Cc: Liming Gao Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 3f368b5..b974bd0 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -3273,10 +3273,11 @@ SubmitForForm ( ConfigInfo->SyncConfigRequest = NULL; } Status = EFI_SUCCESS; } + SendDiscardInfoToDriver (FormSet,Form); } else { Status = EFI_UNSUPPORTED; } // @@ -3334,13 +3335,15 @@ SubmitForFormSet ( FORMSET_STORAGE *FormSetStorage; FORM_BROWSER_FORM *Form; BOOLEAN HasInserted; FORM_BROWSER_STATEMENT *Question; BOOLEAN SubmitFormSetFail; + BOOLEAN DiscardChange; HasInserted = FALSE; SubmitFormSetFail = FALSE; + DiscardChange = FALSE; if (!IsNvUpdateRequiredForFormSet (FormSet)) { return EFI_SUCCESS; } @@ -3437,10 +3440,11 @@ SubmitForFormSet ( if (!SkipProcessFail) { // // 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); Storage = FormSetStorage->BrowserStorage; Link = GetNextNode (&FormSet->SaveFailStorageListHead, Link); @@ -3486,10 +3490,25 @@ SubmitForFormSet ( Status = EFI_UNSUPPORTED; } } // + // 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); // @@ -3604,10 +3623,20 @@ SubmitForSystem ( FormSetStorage->SyncConfigRequest = NULL; } } } + 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); RemoveEntryList (&LocalFormSet->SaveFailLink); DestroyFormSet (LocalFormSet); -- 1.9.5.msysgit.1