From 083f7c69c171ffe2474748c5b78e913623cfd051 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Fri, 20 May 2011 02:48:59 +0000 Subject: 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 --- .../PlatformDriOverrideDxe/PlatDriOverrideDxe.c | 126 ++++++++++----------- 1 file changed, 63 insertions(+), 63 deletions(-) (limited to 'MdeModulePkg/Universal/PlatformDriOverrideDxe') 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.
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
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; } /** -- cgit v1.2.3