summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/PlatformDriOverrideDxe
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-20 02:48:59 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-20 02:48:59 +0000
commit083f7c69c171ffe2474748c5b78e913623cfd051 (patch)
treebf9f61f5743d51328654c11a6f0e75bc8642a3b0 /MdeModulePkg/Universal/PlatformDriOverrideDxe
parent4fdb97fa6eecb7a7750c54fd402996cf2354ef88 (diff)
downloadedk2-platforms-083f7c69c171ffe2474748c5b78e913623cfd051.tar.xz
Refine some call back function to return EFI_UNSUPPORTED for all unsupported call back type.
Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11686 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/PlatformDriOverrideDxe')
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
index 70f29998ba..865ff3265b 100644
--- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
@@ -13,7 +13,7 @@
4. It save all the mapping info in NV variables which will be consumed
by platform override protocol driver to publish the platform override protocol.
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1335,81 +1335,81 @@ PlatOverMngrCallback (
EFI_INPUT_KEY Key;
PLAT_OVER_MNGR_DATA *FakeNvData;
- if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {
- //
- // Do nothing for UEFI OPEN/CLOSE Action
- //
- return EFI_SUCCESS;
- }
-
- Private = EFI_CALLBACK_INFO_FROM_THIS (This);
- FakeNvData = &Private->FakeNvData;
- if (!HiiGetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData)) {
- return EFI_NOT_FOUND;
- }
-
- if (KeyValue == KEY_VALUE_DEVICE_REFRESH ||
- KeyValue == KEY_VALUE_DEVICE_FILTER ||
- KeyValue == KEY_VALUE_DRIVER_GOTO_PREVIOUS
- ) {
- 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);
+ if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ Private = EFI_CALLBACK_INFO_FROM_THIS (This);
+ FakeNvData = &Private->FakeNvData;
+ if (!HiiGetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData)) {
+ return EFI_NOT_FOUND;
}
- }
- if (((KeyValue >= KEY_VALUE_DEVICE_OFFSET) && (KeyValue < KEY_VALUE_DEVICE_MAX)) || (KeyValue == KEY_VALUE_ORDER_GOTO_PREVIOUS)) {
- if (KeyValue == KEY_VALUE_ORDER_GOTO_PREVIOUS) {
- KeyValue = (EFI_QUESTION_ID) (mSelectedCtrIndex + KEY_VALUE_DEVICE_OFFSET);
+ if (KeyValue == KEY_VALUE_DEVICE_REFRESH ||
+ KeyValue == KEY_VALUE_DEVICE_FILTER ||
+ KeyValue == KEY_VALUE_DRIVER_GOTO_PREVIOUS
+ ) {
+ 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);
+ }
}
- UpdateBindingDriverSelectPage (Private, KeyValue, FakeNvData);
- //
- // Update page title string
- //
- NewStringToken = STRING_TOKEN (STR_TITLE);
- if (HiiSetString (Private->RegisteredHandle, NewStringToken, L"Second, Select drivers for the previous selected controller", NULL) == 0) {
- ASSERT (FALSE);
+
+ if (((KeyValue >= KEY_VALUE_DEVICE_OFFSET) && (KeyValue < KEY_VALUE_DEVICE_MAX)) || (KeyValue == KEY_VALUE_ORDER_GOTO_PREVIOUS)) {
+ if (KeyValue == KEY_VALUE_ORDER_GOTO_PREVIOUS) {
+ KeyValue = (EFI_QUESTION_ID) (mSelectedCtrIndex + KEY_VALUE_DEVICE_OFFSET);
+ }
+ UpdateBindingDriverSelectPage (Private, KeyValue, FakeNvData);
+ //
+ // Update page title string
+ //
+ NewStringToken = STRING_TOKEN (STR_TITLE);
+ if (HiiSetString (Private->RegisteredHandle, NewStringToken, L"Second, Select drivers for the previous selected controller", NULL) == 0) {
+ ASSERT (FALSE);
+ }
}
- }
- if (KeyValue == KEY_VALUE_DRIVER_GOTO_ORDER) {
- UpdatePrioritySelectPage (Private, KeyValue, FakeNvData);
- //
- // Update page title string
- //
- NewStringToken = STRING_TOKEN (STR_TITLE);
- if (HiiSetString (Private->RegisteredHandle, NewStringToken, L"Finally, Set the priority order for the drivers and save them", NULL) == 0) {
- ASSERT (FALSE);
+ if (KeyValue == KEY_VALUE_DRIVER_GOTO_ORDER) {
+ UpdatePrioritySelectPage (Private, KeyValue, FakeNvData);
+ //
+ // Update page title string
+ //
+ NewStringToken = STRING_TOKEN (STR_TITLE);
+ if (HiiSetString (Private->RegisteredHandle, NewStringToken, L"Finally, Set the priority order for the drivers and save them", NULL) == 0) {
+ ASSERT (FALSE);
+ }
}
- }
- 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_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) {
+ if (KeyValue == KEY_VALUE_DEVICE_CLEAR) {
+ //
+ // Deletes all environment variable(s) that contain the override mappings info
+ //
+ FreeMappingDatabase (&mMappingDataBase);
+ Status = SaveOverridesMapping (&mMappingDataBase);
+ UpdateDeviceSelectPage (Private, KeyValue, FakeNvData);
+ }
//
- // Deletes all environment variable(s) that contain the override mappings info
+ // Pass changed uncommitted data back to Form Browser
//
- FreeMappingDatabase (&mMappingDataBase);
- Status = SaveOverridesMapping (&mMappingDataBase);
- UpdateDeviceSelectPage (Private, KeyValue, FakeNvData);
- }
+ HiiSetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData, NULL);
+
+ return EFI_SUCCESS;
+ }
+
//
- // Pass changed uncommitted data back to Form Browser
+ // All other action return unsupported.
//
- HiiSetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData, NULL);
-
- return EFI_SUCCESS;
+ return EFI_UNSUPPORTED;
}
/**