public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [patch] MdeModulePkg/SetupBrowser: Send discard info to driver when fail to submit
Date: Tue, 18 Oct 2016 02:00:18 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B49596F@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1476171052-59984-2-git-send-email-dandan.bi@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----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 <eric.dong@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [patch] 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 river 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>
> ---
>  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
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2016-10-18  2:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11  7:30 [patch] MdeModulePkg/BootMaintenanceUi: Enhance the codes logic Dandan Bi
2016-10-11  7:30 ` [patch] MdeModulePkg/SetupBrowser: Send discard info to driver when fail to submit Dandan Bi
2016-10-18  2:00   ` Gao, Liming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14B49596F@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox