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
This commit is contained in:
@@ -676,20 +676,40 @@ IScsiFormCallback (
|
||||
EFI_STATUS Status;
|
||||
EFI_INPUT_KEY Key;
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||
Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
|
||||
//
|
||||
// Retrive uncommitted data from Browser
|
||||
//
|
||||
IfrNvData = AllocateZeroPool (sizeof (ISCSI_CONFIG_IFR_NVDATA));
|
||||
ASSERT (IfrNvData != NULL);
|
||||
if (!HiiGetBrowserData (&gIp4IScsiConfigGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData)) {
|
||||
FreePool (IfrNvData);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
Status = EFI_SUCCESS;
|
||||
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
switch (QuestionId) {
|
||||
Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
|
||||
//
|
||||
// Retrive uncommitted data from Browser
|
||||
//
|
||||
IfrNvData = AllocateZeroPool (sizeof (ISCSI_CONFIG_IFR_NVDATA));
|
||||
ASSERT (IfrNvData != NULL);
|
||||
if (!HiiGetBrowserData (&gIp4IScsiConfigGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData)) {
|
||||
FreePool (IfrNvData);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||
if ((QuestionId >= KEY_DEVICE_ENTRY_BASE) && (QuestionId < (mNumberOfIScsiDevices + KEY_DEVICE_ENTRY_BASE))) {
|
||||
//
|
||||
// In case goto the device configuration form, update the device form title.
|
||||
//
|
||||
ConfigFormEntry = IScsiGetConfigFormEntryByIndex ((UINT32) (QuestionId - KEY_DEVICE_ENTRY_BASE));
|
||||
ASSERT (ConfigFormEntry != NULL);
|
||||
|
||||
UnicodeSPrint (PortString, (UINTN) 128, L"Port %s", ConfigFormEntry->MacString);
|
||||
DeviceFormTitleToken = (EFI_STRING_ID) STR_ISCSI_DEVICE_FORM_TITLE;
|
||||
HiiSetString (Private->RegisteredHandle, DeviceFormTitleToken, PortString, NULL);
|
||||
|
||||
IScsiConvertDeviceConfigDataToIfrNvData (ConfigFormEntry, IfrNvData);
|
||||
|
||||
Private->Current = ConfigFormEntry;
|
||||
}
|
||||
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
|
||||
switch (QuestionId) {
|
||||
case KEY_INITIATOR_NAME:
|
||||
IScsiUnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);
|
||||
BufferSize = AsciiStrSize (IScsiName);
|
||||
@@ -889,41 +909,20 @@ IScsiFormCallback (
|
||||
break;
|
||||
|
||||
default:
|
||||
if ((QuestionId >= KEY_DEVICE_ENTRY_BASE) && (QuestionId < (mNumberOfIScsiDevices + KEY_DEVICE_ENTRY_BASE))) {
|
||||
//
|
||||
// In case goto the device configuration form, update the device form title.
|
||||
//
|
||||
ConfigFormEntry = IScsiGetConfigFormEntryByIndex ((UINT32) (QuestionId - KEY_DEVICE_ENTRY_BASE));
|
||||
ASSERT (ConfigFormEntry != NULL);
|
||||
|
||||
UnicodeSPrint (PortString, (UINTN) 128, L"Port %s", ConfigFormEntry->MacString);
|
||||
DeviceFormTitleToken = (EFI_STRING_ID) STR_ISCSI_DEVICE_FORM_TITLE;
|
||||
HiiSetString (Private->RegisteredHandle, DeviceFormTitleToken, PortString, NULL);
|
||||
|
||||
IScsiConvertDeviceConfigDataToIfrNvData (ConfigFormEntry, IfrNvData);
|
||||
|
||||
Private->Current = ConfigFormEntry;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Pass changed uncommitted data back to Form Browser
|
||||
//
|
||||
HiiSetBrowserData (&gIp4IScsiConfigGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData, NULL);
|
||||
}
|
||||
|
||||
FreePool (IfrNvData);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// All other action return unsupported.
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Pass changed uncommitted data back to Form Browser
|
||||
//
|
||||
HiiSetBrowserData (&gIp4IScsiConfigGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData, NULL);
|
||||
}
|
||||
|
||||
FreePool (IfrNvData);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -204,12 +204,13 @@ formset
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_NULL);
|
||||
|
||||
goto FORMID_DEVICE_FORM,
|
||||
prompt = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||
help = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_SAVE_CHANGES;
|
||||
|
||||
text
|
||||
help = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||
text = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||
text = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_SAVE_CHANGES;
|
||||
|
||||
goto FORMID_MAIN_FORM,
|
||||
prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),
|
||||
help = STRING_TOKEN (STR_RETURN_MAIN_FORM),
|
||||
|
@@ -78,13 +78,14 @@ formset
|
||||
endif;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_NULL);
|
||||
|
||||
goto FORMID_DEVICE_FORM,
|
||||
prompt = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||
help = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_SAVE_CHANGES;
|
||||
|
||||
|
||||
text
|
||||
help = STRING_TOKEN(STR_SAVE_CHANGES),
|
||||
text = STRING_TOKEN(STR_SAVE_CHANGES),
|
||||
text = STRING_TOKEN(STR_SAVE_CHANGES),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_SAVE_CHANGES;
|
||||
|
||||
endform;
|
||||
|
||||
endformset;
|
||||
|
@@ -689,7 +689,7 @@ Ip4FormCallback (
|
||||
EFI_STATUS Status;
|
||||
EFI_INPUT_KEY Key;
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGED) {
|
||||
Ip4ConfigInstance = IP4_CONFIG_INSTANCE_FROM_CONFIG_ACCESS (This);
|
||||
|
||||
IfrFormNvData = AllocateZeroPool (sizeof (IP4_CONFIG_IFR_NVDATA));
|
||||
|
@@ -239,16 +239,23 @@ VlanCallback (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||
if ((Action != EFI_BROWSER_ACTION_CHANGED) && (Action != EFI_BROWSER_ACTION_CHANGING)) {
|
||||
//
|
||||
// Get Browser data
|
||||
// All other action return unsupported.
|
||||
//
|
||||
Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));
|
||||
ASSERT (Configuration != NULL);
|
||||
HiiGetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
VlanConfig = PrivateData->VlanConfig;
|
||||
//
|
||||
// Get Browser data
|
||||
//
|
||||
Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));
|
||||
ASSERT (Configuration != NULL);
|
||||
HiiGetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);
|
||||
|
||||
VlanConfig = PrivateData->VlanConfig;
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGED) {
|
||||
switch (QuestionId) {
|
||||
case VLAN_ADD_QUESTION_ID:
|
||||
//
|
||||
@@ -304,6 +311,11 @@ VlanCallback (
|
||||
ZeroMem (Configuration->VlanList, MAX_VLAN_NUMBER);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||
switch (QuestionId) {
|
||||
case VLAN_UPDATE_QUESTION_ID:
|
||||
//
|
||||
// Update current VLAN list into Form.
|
||||
@@ -314,16 +326,11 @@ VlanCallback (
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
HiiSetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);
|
||||
FreePool (Configuration);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// All other action return unsupported.
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
|
||||
HiiSetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);
|
||||
FreePool (Configuration);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user