From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ADE691A1E20 for ; Mon, 17 Oct 2016 19:00:26 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 17 Oct 2016 19:00:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,359,1473145200"; d="scan'208";a="1046125883" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 17 Oct 2016 19:00:26 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 17 Oct 2016 19:00:25 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 17 Oct 2016 19:00:25 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Tue, 18 Oct 2016 10:00:19 +0800 From: "Gao, Liming" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Dong, Eric" Thread-Topic: [edk2] [patch] MdeModulePkg/SetupBrowser: Send discard info to driver when fail to submit Thread-Index: AQHSI5GG8IQ3104TYUmBHfQUKeAfrKCtf5rQ Date: Tue, 18 Oct 2016 02:00:18 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B49596F@shsmsx102.ccr.corp.intel.com> References: <1476171052-59984-1-git-send-email-dandan.bi@intel.com> <1476171052-59984-2-git-send-email-dandan.bi@intel.com> In-Reply-To: <1476171052-59984-2-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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, 18 Oct 2016 02:00:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Dandan Bi > Sent: Tuesday, October 11, 2016 3:31 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric ; Gao, Liming > Subject: [edk2] [patch] MdeModulePkg/SetupBrowser: Send discard info to > driver when fail to submit >=20 > When fail to submit data and user discard the change, we should send > the discard info to river with EFI_BROWSER_ACTION_CHANGED callback. >=20 > 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(+) >=20 > 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 =3D NULL; > } >=20 > Status =3D EFI_SUCCESS; > } > + SendDiscardInfoToDriver (FormSet,Form); > } else { > Status =3D EFI_UNSUPPORTED; > } >=20 > // > @@ -3334,13 +3335,15 @@ SubmitForFormSet ( > FORMSET_STORAGE *FormSetStorage; > FORM_BROWSER_FORM *Form; > BOOLEAN HasInserted; > FORM_BROWSER_STATEMENT *Question; > BOOLEAN SubmitFormSetFail; > + BOOLEAN DiscardChange; >=20 > HasInserted =3D FALSE; > SubmitFormSetFail =3D FALSE; > + DiscardChange =3D FALSE; >=20 > if (!IsNvUpdateRequiredForFormSet (FormSet)) { > return EFI_SUCCESS; > } >=20 > @@ -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) =3D=3D > BROWSER_ACTION_DISCARD) { > + DiscardChange =3D TRUE; > Link =3D GetFirstNode (&FormSet->SaveFailStorageListHead); > while (!IsNull (&FormSet->SaveFailStorageListHead, Link)) { > FormSetStorage =3D FORMSET_STORAGE_FROM_SAVE_FAIL_LINK (Link); > Storage =3D FormSetStorage->BrowserStorage; > Link =3D GetNextNode (&FormSet->SaveFailStorageListHead, Link)= ; > @@ -3486,10 +3490,25 @@ SubmitForFormSet ( > Status =3D EFI_UNSUPPORTED; > } > } >=20 > // > + // If user discard the change, send the discard info to driver. > + // > + if (DiscardChange) { > + Link =3D GetFirstNode (&FormSet->FormListHead); > + while (!IsNull (&FormSet->FormListHead, Link)) { > + Form =3D FORM_BROWSER_FORM_FROM_LINK (Link); > + Link =3D 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); >=20 > // > @@ -3604,10 +3623,20 @@ SubmitForSystem ( > FormSetStorage->SyncConfigRequest =3D NULL; > } > } > } >=20 > + Link =3D GetFirstNode (&LocalFormSet->FormListHead); > + while (!IsNull (&LocalFormSet->FormListHead, Link)) { > + Form =3D FORM_BROWSER_FORM_FROM_LINK (Link); > + Link =3D 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 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel