Update for IntelFrameworkModulePkg.

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.

Signed-off-by: ydong10
Reviewed-by: lgao4

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12866 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10
2011-12-15 02:56:46 +00:00
parent 3a4e7a3e73
commit 8472407740
10 changed files with 152 additions and 158 deletions

View File

@@ -286,31 +286,36 @@ BootMaintCallback (
UINT8 *NewLegacyDev;
UINT8 *DisMap;
EFI_FORM_ID FormId;
Status = EFI_SUCCESS;
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
//
// All other action return unsupported.
//
return EFI_UNSUPPORTED;
}
Status = EFI_SUCCESS;
OldValue = 0;
NewValue = 0;
Number = 0;
OldLegacyDev = NULL;
NewLegacyDev = NULL;
NewValuePos = 0;
DisMap = NULL;
Private = BMM_CALLBACK_DATA_FROM_THIS (This);
//
// Retrive uncommitted data from Form Browser
//
CurrentFakeNVMap = &Private->BmmFakeNvData;
HiiGetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap);
if (Action == EFI_BROWSER_ACTION_CHANGING) {
if ((Value == NULL) || (ActionRequest == NULL)) {
if (Value == NULL) {
return EFI_INVALID_PARAMETER;
}
OldValue = 0;
NewValue = 0;
Number = 0;
OldLegacyDev = NULL;
NewLegacyDev = NULL;
NewValuePos = 0;
DisMap = NULL;
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
Private = BMM_CALLBACK_DATA_FROM_THIS (This);
UpdatePageId (Private, QuestionId);
//
// Retrive uncommitted data from Form Browser
//
CurrentFakeNVMap = &Private->BmmFakeNvData;
HiiGetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap);
//
// need to be subtituded.
//
@@ -488,29 +493,14 @@ BootMaintCallback (
switch (QuestionId) {
case KEY_VALUE_BOOT_FROM_FILE:
Private->FeCurrentState = FileExplorerStateBootFromFile;
//
// Exit Bmm main formset to send File Explorer formset.
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_BOOT_ADD_ID:
Private->FeCurrentState = FileExplorerStateAddBootOption;
//
// Exit Bmm main formset to send File Explorer formset.
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_DRV_ADD_FILE_ID:
Private->FeCurrentState = FileExplorerStateAddDriverOptionState;
//
// Exit Bmm main formset to send File Explorer formset.
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_DRV_ADD_HANDLE_ID:
@@ -543,10 +533,6 @@ BootMaintCallback (
UpdateTimeOutPage (Private);
break;
case FORM_RESET:
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
return EFI_UNSUPPORTED;
case FORM_CON_IN_ID:
case FORM_CON_OUT_ID:
case FORM_CON_ERR_ID:
@@ -572,25 +558,6 @@ BootMaintCallback (
UpdateSetLegacyDeviceOrderPage (QuestionId, Private);
break;
case KEY_VALUE_SAVE_AND_EXIT:
case KEY_VALUE_NO_SAVE_AND_EXIT:
if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
if (EFI_ERROR (Status)) {
return Status;
}
} else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
DiscardChangeHandler (Private, CurrentFakeNVMap);
}
//
// Tell browser not to ask for confirmation of changes,
// since we have already applied or discarded.
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
default:
break;
}
@@ -616,18 +583,44 @@ BootMaintCallback (
UpdateDriverAddHandleDescPage (Private);
}
}
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
switch (QuestionId) {
case KEY_VALUE_SAVE_AND_EXIT:
case KEY_VALUE_NO_SAVE_AND_EXIT:
if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
if (EFI_ERROR (Status)) {
return Status;
}
} else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
DiscardChangeHandler (Private, CurrentFakeNVMap);
}
//
// Pass changed uncommitted data back to Form Browser
//
Status = HiiSetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
return Status;
//
// Tell browser not to ask for confirmation of changes,
// since we have already applied or discarded.
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
break;
case FORM_RESET:
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
return EFI_UNSUPPORTED;
default:
break;
}
}
//
// All other action return unsupported.
// Pass changed uncommitted data back to Form Browser
//
return EFI_UNSUPPORTED;
HiiSetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
return EFI_SUCCESS;
}
/**