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/Network | |
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/Network')
5 files changed, 80 insertions, 72 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c index 81d9583bcd..4fdb5adf2c 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c @@ -676,20 +676,40 @@ IScsiFormCallback ( EFI_STATUS Status;
EFI_INPUT_KEY Key;
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
+ return EFI_UNSUPPORTED;
+ }
+
+ 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) {
- 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 ((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);
- switch (QuestionId) {
+ 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;
}
/**
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfigDxe.vfr b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfigDxe.vfr index 82364a8b4a..719353de29 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfigDxe.vfr +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfigDxe.vfr @@ -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),
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.vfr b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.vfr index 5b5685db42..c5d74b06df 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.vfr +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.vfr @@ -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;
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c index 59e5127b44..58c4c1a02c 100644 --- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c +++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c @@ -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));
diff --git a/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c b/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c index ea70d5e28d..f992cea07b 100644 --- a/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c +++ b/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c @@ -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;
+ }
+
+ //
+ // Get Browser data
+ //
+ Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));
+ ASSERT (Configuration != NULL);
+ HiiGetBrowserData (&gVlanConfigFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);
- VlanConfig = PrivateData->VlanConfig;
+ 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;
}
|