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/IScsiDxe | |
parent | 3531262f5f4afd8b3873fb8b592437b27f9db4c9 (diff) | |
download | edk2-3a4e7a3e73a40eecbb0a977a0e7421ff5743c353.zip edk2-3a4e7a3e73a40eecbb0a977a0e7421ff5743c353.tar.gz edk2-3a4e7a3e73a40eecbb0a977a0e7421ff5743c353.tar.bz2 |
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/IScsiDxe')
-rw-r--r-- | MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c | 85 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfigDxe.vfr | 13 |
2 files changed, 49 insertions, 49 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c index 81d9583..4fdb5ad 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 82364a8..719353d 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),
|