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

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



  reply	other threads:[~2016-10-11  7:31 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 ` Dandan Bi [this message]
2016-10-18  2:00   ` [patch] MdeModulePkg/SetupBrowser: Send discard info to driver when fail to submit Gao, Liming

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=1476171052-59984-2-git-send-email-dandan.bi@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