diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-12-15 02:54:49 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-12-15 02:54:49 +0000 |
commit | 3a4e7a3e73a40eecbb0a977a0e7421ff5743c353 (patch) | |
tree | 7a8a392f34967475ad54c929a8928e0a50a8211e /MdeModulePkg/Universal/PlatformDriOverrideDxe | |
parent | 3531262f5f4afd8b3873fb8b592437b27f9db4c9 (diff) | |
download | edk2-platforms-3a4e7a3e73a40eecbb0a977a0e7421ff5743c353.tar.xz |
Per UEFI spec, on CallBack action EFI_BROWSER_ACTION_CHANGING, the return value of ActionRequest will be ignored, but on CallBack action EFI_BROWSER_ACTION_CHANGED, the return value of ActionRequest will be used.
But, EDKII browser still processes the got ActionRequest. And, all HII drivers in EDKII project also returns their expected ActionRequest value on action EFI_BROWSER_ACTION_CHANGING.
Now update the browser to follow the spec, and update all core Hii drivers to keep old working modal.
Update for MdeModulePkg.
Signed-off-by: ydong10
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12865 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/PlatformDriOverrideDxe')
-rw-r--r-- | MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c | 73 | ||||
-rw-r--r-- | MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr | 11 |
2 files changed, 53 insertions, 31 deletions
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c index 20bc43c345..ab8a000f13 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c @@ -1334,17 +1334,25 @@ PlatOverMngrCallback ( EFI_INPUT_KEY Key;
PLAT_OVER_MNGR_DATA *FakeNvData;
+ if ((Action != EFI_BROWSER_ACTION_CHANGING) && (Action != EFI_BROWSER_ACTION_CHANGED)) {
+ //
+ // All other action return unsupported.
+ //
+ return EFI_UNSUPPORTED;
+ }
+
+ Private = EFI_CALLBACK_INFO_FROM_THIS (This);
+ FakeNvData = &Private->FakeNvData;
+ if (!HiiGetBrowserData (&gPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData)) {
+ return EFI_NOT_FOUND;
+ }
+
if (Action == EFI_BROWSER_ACTION_CHANGING) {
- Private = EFI_CALLBACK_INFO_FROM_THIS (This);
- FakeNvData = &Private->FakeNvData;
- if (!HiiGetBrowserData (&gPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData)) {
- return EFI_NOT_FOUND;
+ if (Value == NULL) {
+ return EFI_INVALID_PARAMETER;
}
-
- if (KeyValue == KEY_VALUE_DEVICE_REFRESH ||
- KeyValue == KEY_VALUE_DEVICE_FILTER ||
- KeyValue == KEY_VALUE_DRIVER_GOTO_PREVIOUS
- ) {
+
+ if (KeyValue == KEY_VALUE_DRIVER_GOTO_PREVIOUS) {
UpdateDeviceSelectPage (Private, KeyValue, FakeNvData);
//
// Update page title string
@@ -1380,15 +1388,6 @@ PlatOverMngrCallback ( }
}
- if (KeyValue == KEY_VALUE_ORDER_SAVE_AND_EXIT) {
- Status = CommintChanges (Private, KeyValue, FakeNvData);
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
- if (EFI_ERROR (Status)) {
- CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Single Override Info too large, Saving Error!", NULL);
- return EFI_DEVICE_ERROR;
- }
- }
-
if (KeyValue == KEY_VALUE_DEVICE_CLEAR) {
//
// Deletes all environment variable(s) that contain the override mappings info
@@ -1397,18 +1396,40 @@ PlatOverMngrCallback ( Status = SaveOverridesMapping (&mMappingDataBase);
UpdateDeviceSelectPage (Private, KeyValue, FakeNvData);
}
- //
- // Pass changed uncommitted data back to Form Browser
- //
- HiiSetBrowserData (&gPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData, NULL);
+ } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
+ switch (KeyValue) {
+ case KEY_VALUE_DEVICE_REFRESH:
+ case KEY_VALUE_DEVICE_FILTER:
+ UpdateDeviceSelectPage (Private, KeyValue, FakeNvData);
+ //
+ // Update page title string
+ //
+ NewStringToken = STRING_TOKEN (STR_TITLE);
+ if (HiiSetString (Private->RegisteredHandle, NewStringToken, L"First, Select the controller by device path", NULL) == 0) {
+ ASSERT (FALSE);
+ }
+ break;
+
+ case KEY_VALUE_ORDER_SAVE_AND_EXIT:
+ Status = CommintChanges (Private, KeyValue, FakeNvData);
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Single Override Info too large, Saving Error!", NULL);
+ return EFI_DEVICE_ERROR;
+ }
+ break;
- return EFI_SUCCESS;
- }
+ default:
+ break;
+ }
+ }
//
- // All other action return unsupported.
+ // Pass changed uncommitted data back to Form Browser
//
- return EFI_UNSUPPORTED;
+ HiiSetBrowserData (&gPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData, NULL);
+
+ return EFI_SUCCESS;
}
/**
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr b/MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr index 0f50645948..a4eede18d0 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr @@ -99,11 +99,12 @@ formset subtitle text = STRING_TOKEN(STR_NULL_STRING);
- goto FORM_ID_ORDER,
- prompt = STRING_TOKEN(STR_SAVE_AND_EXIT),
- help = STRING_TOKEN(STR_NULL_STRING),
- flags = INTERACTIVE | RESET_REQUIRED,
- key = KEY_VALUE_ORDER_SAVE_AND_EXIT;
+ text
+ help = STRING_TOKEN (STR_NULL_STRING),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ flags = INTERACTIVE | RESET_REQUIRED,
+ key = KEY_VALUE_ORDER_SAVE_AND_EXIT;
endform;
endformset;
|