summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2014-02-18 10:53:57 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2014-02-18 10:53:57 +0000
commit27c304f442538e3aeb1bcc5a6e52194a577dcde0 (patch)
tree6c1332a4d30b7a17e1a5a8fc28fc87c363a753a5 /MdeModulePkg
parenta6c0ad816ac8f26d1af38f1a2c2ea538a852cb5b (diff)
downloadedk2-platforms-27c304f442538e3aeb1bcc5a6e52194a577dcde0.tar.xz
Update configrequest string at runtime for dynamic created question.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15247 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c64
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c52
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.h13
3 files changed, 32 insertions, 97 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 5ca0700bb2..488087e011 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -1958,70 +1958,6 @@ IsNvUpdateRequiredForForm (
}
/**
- Check whether the storage data for current form set is changed.
-
- @param FormSet FormSet data structure.
-
- @retval TRUE Data is changed.
- @retval FALSE Data is not changed.
-**/
-BOOLEAN
-IsStorageDataChangedForFormSet (
- IN FORM_BROWSER_FORMSET *FormSet
- )
-{
- LIST_ENTRY *Link;
- FORMSET_STORAGE *Storage;
- BROWSER_STORAGE *BrowserStorage;
- CHAR16 *ConfigRespNew;
- CHAR16 *ConfigRespOld;
- BOOLEAN RetVal;
-
- RetVal = FALSE;
- ConfigRespNew = NULL;
- ConfigRespOld = NULL;
-
- //
- // Request current settings from Configuration Driver
- //
- Link = GetFirstNode (&FormSet->StorageListHead);
- while (!IsNull (&FormSet->StorageListHead, Link)) {
- Storage = FORMSET_STORAGE_FROM_LINK (Link);
- Link = GetNextNode (&FormSet->StorageListHead, Link);
-
- BrowserStorage = Storage->BrowserStorage;
-
- if (BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE) {
- continue;
- }
-
- if (Storage->ElementCount == 0) {
- continue;
- }
-
- StorageToConfigResp (BrowserStorage, &ConfigRespNew, Storage->ConfigRequest, TRUE);
- StorageToConfigResp (BrowserStorage, &ConfigRespOld, Storage->ConfigRequest, FALSE);
- ASSERT (ConfigRespNew != NULL && ConfigRespOld != NULL);
-
- if (StrCmp (ConfigRespNew, ConfigRespOld) != 0) {
- RetVal = TRUE;
- }
-
- FreePool (ConfigRespNew);
- ConfigRespNew = NULL;
-
- FreePool (ConfigRespOld);
- ConfigRespOld = NULL;
-
- if (RetVal) {
- break;
- }
- }
-
- return RetVal;
-}
-
-/**
Find menu which will show next time.
@param Selection On input, Selection tell setup browser the information
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index d1c6961a05..5ce0b84ed6 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -417,7 +417,7 @@ SendForm (
//
// If no data is changed, don't need to save current FormSet into the maintain list.
//
- if (!IsNvUpdateRequiredForFormSet (FormSet) && !IsStorageDataChangedForFormSet(FormSet)) {
+ if (!IsNvUpdateRequiredForFormSet (FormSet)) {
CleanBrowserStorage(FormSet);
RemoveEntryList (&FormSet->Link);
DestroyFormSet (FormSet);
@@ -4081,39 +4081,51 @@ LoadStorage (
ConfigRequestAdjust(Storage);
return;
}
-
- //
- // Create the config request string to get all fields for this storage.
- // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
- // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator
- //
- StrLen = StrSize (Storage->BrowserStorage->ConfigHdr) + 20 * sizeof (CHAR16);
- ConfigRequest = AllocateZeroPool (StrLen);
- ASSERT (ConfigRequest != NULL);
- UnicodeSPrint (
- ConfigRequest,
- StrLen,
- L"%s&OFFSET=0&WIDTH=%04x",
- Storage->BrowserStorage->ConfigHdr,
- Storage->BrowserStorage->Size);
break;
case EFI_HII_VARSTORE_BUFFER:
case EFI_HII_VARSTORE_NAME_VALUE:
//
- // Skip if there is no RequestElement or data has initilized.
+ // Skip if there is no RequestElement.
//
- if (Storage->ElementCount == 0 || Storage->BrowserStorage->Initialized) {
+ if (Storage->ElementCount == 0) {
return;
}
+
+ //
+ // Just update the ConfigRequest, if storage already initialized.
+ //
+ if (Storage->BrowserStorage->Initialized) {
+ ConfigRequestAdjust(Storage);
+ return;
+ }
+
Storage->BrowserStorage->Initialized = TRUE;
- ConfigRequest = Storage->ConfigRequest;
break;
default:
return;
}
+ if (Storage->BrowserStorage->Type != EFI_HII_VARSTORE_NAME_VALUE) {
+ //
+ // Create the config request string to get all fields for this storage.
+ // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
+ // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator
+ //
+ StrLen = StrSize (Storage->BrowserStorage->ConfigHdr) + 20 * sizeof (CHAR16);
+ ConfigRequest = AllocateZeroPool (StrLen);
+ ASSERT (ConfigRequest != NULL);
+ UnicodeSPrint (
+ ConfigRequest,
+ StrLen,
+ L"%s&OFFSET=0&WIDTH=%04x",
+ Storage->BrowserStorage->ConfigHdr,
+ Storage->BrowserStorage->Size);
+ } else {
+ ConfigRequest = Storage->ConfigRequest;
+ }
+
//
// Request current settings from Configuration Driver
//
@@ -4149,7 +4161,7 @@ LoadStorage (
//
SynchronizeStorage(FormSet, Storage->BrowserStorage, NULL, TRUE);
- if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
+ if (Storage->BrowserStorage->Type != EFI_HII_VARSTORE_NAME_VALUE) {
if (ConfigRequest != NULL) {
FreePool (ConfigRequest);
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index 8fe9e98e63..cfbe348d61 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -1173,19 +1173,6 @@ IsNvUpdateRequiredForFormSet (
);
/**
- Check whether the storage data for current form set is changed.
-
- @param FormSet FormSet data structure.
-
- @retval TRUE Data is changed.
- @retval FALSE Data is not changed.
-**/
-BOOLEAN
-IsStorageDataChangedForFormSet (
- IN FORM_BROWSER_FORMSET *FormSet
- );
-
-/**
Call the call back function for the question and process the return action.
@param Selection On input, Selection tell setup browser the information