summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-15 02:57:46 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-12-15 02:57:46 +0000
commit639a76d1912f8eb07e26b1a8f2393b682be65f2c (patch)
treeb67f5a0096541a50a24db231ca786fc0a343c140 /NetworkPkg
parent847240774030f9da79140a9d515a64ec817eb6eb (diff)
downloadedk2-platforms-639a76d1912f8eb07e26b1a8f2393b682be65f2c.tar.xz
Update for NetworkPkg.
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@12867 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiConfig.c228
-rw-r--r--NetworkPkg/IScsiDxe/IScsiConfigVfr.vfr39
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Config.vfr22
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6ConfigNv.c384
4 files changed, 345 insertions, 328 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c
index d347d8dc70..eea73a8ff1 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfig.c
+++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
@@ -1606,14 +1606,6 @@ IScsiConfigProcessDefault (
UINTN Index;
//
- // Free any attempt that is previously created but not saved to system.
- //
- if (mPrivate->NewAttempt != NULL) {
- FreePool (mPrivate->NewAttempt);
- mPrivate->NewAttempt = NULL;
- }
-
- //
// Is User creating a new attempt?
//
NewAttempt = FALSE;
@@ -1637,6 +1629,14 @@ IScsiConfigProcessDefault (
//
return EFI_SUCCESS;
}
+
+ //
+ // Free any attempt that is previously created but not saved to system.
+ //
+ if (mPrivate->NewAttempt != NULL) {
+ FreePool (mPrivate->NewAttempt);
+ mPrivate->NewAttempt = NULL;
+ }
if (NewAttempt) {
//
@@ -2103,37 +2103,75 @@ IScsiFormCallback (
return EFI_SUCCESS;
}
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
- if (This == NULL || Value == NULL || ActionRequest == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
-
+ if ((Action != EFI_BROWSER_ACTION_CHANGING) && (Action != EFI_BROWSER_ACTION_CHANGED)) {
//
- // Retrieve uncommitted data from Browser
+ // All other type return unsupported.
//
+ return EFI_UNSUPPORTED;
+ }
- BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);
- IfrNvData = AllocateZeroPool (BufferSize);
- if (IfrNvData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- IScsiName = (CHAR8 *) AllocateZeroPool (ISCSI_NAME_MAX_SIZE);
- if (IScsiName == NULL) {
- FreePool (IfrNvData);
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = EFI_SUCCESS;
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
- ZeroMem (&OldIfrNvData, BufferSize);
+ Private = ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
+
+ //
+ // Retrieve uncommitted data from Browser
+ //
+
+ BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);
+ IfrNvData = AllocateZeroPool (BufferSize);
+ if (IfrNvData == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ IScsiName = (CHAR8 *) AllocateZeroPool (ISCSI_NAME_MAX_SIZE);
+ if (IScsiName == NULL) {
+ FreePool (IfrNvData);
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ Status = EFI_SUCCESS;
+
+ ZeroMem (&OldIfrNvData, BufferSize);
+
+ HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
+
+ CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
- HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
+ if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ switch (QuestionId) {
+ case KEY_ADD_ATTEMPT:
+ Status = IScsiConfigAddAttempt ();
+ break;
- CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
+ case KEY_DELETE_ATTEMPT:
+ CopyMem (
+ OldIfrNvData.DeleteAttemptList,
+ IfrNvData->DeleteAttemptList,
+ sizeof (IfrNvData->DeleteAttemptList)
+ );
+ Status = IScsiConfigDisplayDeleteAttempts (IfrNvData);
+ break;
+ case KEY_ORDER_ATTEMPT_CONFIG:
+ //
+ // Order the attempt according to user input.
+ //
+ CopyMem (
+ OldIfrNvData.DynamicOrderedList,
+ IfrNvData->DynamicOrderedList,
+ sizeof (IfrNvData->DynamicOrderedList)
+ );
+ IScsiConfigDisplayOrderAttempts ();
+ break;
+
+ default:
+ Status = IScsiConfigProcessDefault (QuestionId, IfrNvData);
+ break;
+ }
+ } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
switch (QuestionId) {
case KEY_INITIATOR_NAME:
UnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);
@@ -2151,54 +2189,34 @@ IScsiFormCallback (
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
+ case KEY_ATTEMPT_NAME:
+ if (StrLen (IfrNvData->AttemptName) > ATTEMPT_NAME_SIZE) {
+ CopyMem (AttemptName, IfrNvData->AttemptName, ATTEMPT_NAME_SIZE * sizeof (CHAR16));
+ CopyMem (&AttemptName[ATTEMPT_NAME_SIZE], L"...", 4 * sizeof (CHAR16));
+ } else {
+ CopyMem (
+ AttemptName,
+ IfrNvData->AttemptName,
+ (StrLen (IfrNvData->AttemptName) + 1) * sizeof (CHAR16)
+ );
+ }
- case KEY_ADD_ATTEMPT:
- Status = IScsiConfigAddAttempt ();
- break;
+ UnicodeStrToAsciiStr (IfrNvData->AttemptName, Private->Current->AttemptName);
- case KEY_DELETE_ATTEMPT:
- CopyMem (
- OldIfrNvData.DeleteAttemptList,
- IfrNvData->DeleteAttemptList,
- sizeof (IfrNvData->DeleteAttemptList)
- );
- Status = IScsiConfigDisplayDeleteAttempts (IfrNvData);
- break;
+ IScsiConfigUpdateAttempt ();
- case KEY_SAVE_DELETE_ATTEMPT:
- //
- // Delete the Attempt Order from NVR
- //
- Status = IScsiConfigDeleteAttempts (IfrNvData);
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
+ break;
+
+ case KEY_SAVE_ATTEMPT_CONFIG:
+ Status = IScsiConvertIfrNvDataToAttemptConfigData (IfrNvData, Private->Current);
if (EFI_ERROR (Status)) {
break;
}
- IScsiConfigUpdateAttempt ();
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
- case KEY_IGNORE_DELETE_ATTEMPT:
- CopyMem (
- IfrNvData->DeleteAttemptList,
- OldIfrNvData.DeleteAttemptList,
- sizeof (IfrNvData->DeleteAttemptList)
- );
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;
- break;
-
- case KEY_ORDER_ATTEMPT_CONFIG:
- //
- // Order the attempt according to user input.
- //
- CopyMem (
- OldIfrNvData.DynamicOrderedList,
- IfrNvData->DynamicOrderedList,
- sizeof (IfrNvData->DynamicOrderedList)
- );
- IScsiConfigDisplayOrderAttempts ();
- break;
-
case KEY_SAVE_ORDER_CHANGES:
//
// Sync the Attempt Order to NVR.
@@ -2209,7 +2227,7 @@ IScsiFormCallback (
}
IScsiConfigUpdateAttempt ();
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
break;
case KEY_IGNORE_ORDER_CHANGES:
@@ -2218,26 +2236,29 @@ IScsiFormCallback (
OldIfrNvData.DynamicOrderedList,
sizeof (IfrNvData->DynamicOrderedList)
);
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
break;
- case KEY_ATTEMPT_NAME:
- if (StrLen (IfrNvData->AttemptName) > ATTEMPT_NAME_SIZE) {
- CopyMem (AttemptName, IfrNvData->AttemptName, ATTEMPT_NAME_SIZE * sizeof (CHAR16));
- CopyMem (&AttemptName[ATTEMPT_NAME_SIZE], L"...", 4 * sizeof (CHAR16));
- } else {
- CopyMem (
- AttemptName,
- IfrNvData->AttemptName,
- (StrLen (IfrNvData->AttemptName) + 1) * sizeof (CHAR16)
- );
+ case KEY_SAVE_DELETE_ATTEMPT:
+ //
+ // Delete the Attempt Order from NVR
+ //
+ Status = IScsiConfigDeleteAttempts (IfrNvData);
+ if (EFI_ERROR (Status)) {
+ break;
}
- UnicodeStrToAsciiStr (IfrNvData->AttemptName, Private->Current->AttemptName);
-
IScsiConfigUpdateAttempt ();
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
+ break;
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
+ case KEY_IGNORE_DELETE_ATTEMPT:
+ CopyMem (
+ IfrNvData->DeleteAttemptList,
+ OldIfrNvData.DeleteAttemptList,
+ sizeof (IfrNvData->DeleteAttemptList)
+ );
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
break;
case KEY_IP_MODE:
@@ -2409,38 +2430,23 @@ IScsiFormCallback (
break;
- case KEY_SAVE_ATTEMPT_CONFIG:
- Status = IScsiConvertIfrNvDataToAttemptConfigData (IfrNvData, Private->Current);
- if (EFI_ERROR (Status)) {
- break;
- }
-
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
- break;
-
default:
- Status = IScsiConfigProcessDefault (QuestionId, IfrNvData);
break;
}
+ }
- if (!EFI_ERROR (Status)) {
- //
- // Pass changed uncommitted data back to Form Browser.
- //
- BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);
- HiiSetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);
- }
-
- FreePool (IfrNvData);
- FreePool (IScsiName);
-
- return Status;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Pass changed uncommitted data back to Form Browser.
+ //
+ BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);
+ HiiSetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);
}
- //
- // All other action return unsupported.
- //
- return EFI_UNSUPPORTED;
+ FreePool (IfrNvData);
+ FreePool (IScsiName);
+
+ return Status;
}
diff --git a/NetworkPkg/IScsiDxe/IScsiConfigVfr.vfr b/NetworkPkg/IScsiDxe/IScsiConfigVfr.vfr
index 0cf4ffeed9..4a322cfd69 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfigVfr.vfr
+++ b/NetworkPkg/IScsiDxe/IScsiConfigVfr.vfr
@@ -85,18 +85,19 @@ formset
label ORDER_ENTRY_LABEL;
label LABEL_END;
- goto FORMID_MAIN_FORM,
- prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_SAVE_ORDER_CHANGES;
-
- goto FORMID_MAIN_FORM,
- prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+
+ text
help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_IGNORE_ORDER_CHANGES;
-
endform;
form formid = FORMID_DELETE_FORM,
@@ -105,18 +106,19 @@ formset
label DELETE_ENTRY_LABEL;
label LABEL_END;
- goto FORMID_MAIN_FORM,
- prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_SAVE_DELETE_ATTEMPT;
-
- goto FORMID_MAIN_FORM,
- prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+
+ text
help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
flags = INTERACTIVE,
key = KEY_IGNORE_DELETE_ATTEMPT;
-
endform;
form formid = FORMID_ATTEMPT_FORM,
@@ -348,12 +350,13 @@ formset
subtitle text = STRING_TOKEN(STR_NULL);
- goto FORMID_ATTEMPT_FORM,
- prompt = STRING_TOKEN (STR_SAVE_CHANGES),
- help = STRING_TOKEN (STR_SAVE_CHANGES_HELP),
- flags = INTERACTIVE,
- key = KEY_SAVE_ATTEMPT_CONFIG;
-
+ text
+ help = STRING_TOKEN (STR_SAVE_CHANGES_HELP),
+ text = STRING_TOKEN (STR_SAVE_CHANGES),
+ text = STRING_TOKEN (STR_SAVE_CHANGES),
+ flags = INTERACTIVE,
+ key = KEY_SAVE_ATTEMPT_CONFIG;
+
goto FORMID_MAIN_FORM,
prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),
help = STRING_TOKEN (STR_RETURN_MAIN_FORM),
diff --git a/NetworkPkg/Ip6Dxe/Ip6Config.vfr b/NetworkPkg/Ip6Dxe/Ip6Config.vfr
index 7639f5a0fa..de63f4dad3 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Config.vfr
+++ b/NetworkPkg/Ip6Dxe/Ip6Config.vfr
@@ -163,17 +163,19 @@ formset
maxsize = ADDRESS_STR_MAX_SIZE,
endstring;
- goto FORMID_MAIN_FORM,
- prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),
- help = STRING_TOKEN (STR_SAVE_AND_EXIT),
- flags = INTERACTIVE,
- key = KEY_SAVE_CONFIG_CHANGES;
+ text
+ help = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_SAVE_AND_EXIT),
+ flags = INTERACTIVE,
+ key = KEY_SAVE_CONFIG_CHANGES;
- goto FORMID_MAIN_FORM,
- prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
- help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
- flags = INTERACTIVE,
- key = KEY_IGNORE_CONFIG_CHANGES;
+ text
+ help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+ text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
+ flags = INTERACTIVE,
+ key = KEY_IGNORE_CONFIG_CHANGES;
endform;
diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c b/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
index b383488ffa..db2155e14c 100644
--- a/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
+++ b/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
@@ -1651,7 +1651,7 @@ Ip6FormCallback (
return EFI_SUCCESS;
}
- if (Action != EFI_BROWSER_ACTION_CHANGING) {
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
return EFI_UNSUPPORTED;
}
@@ -1677,224 +1677,230 @@ Ip6FormCallback (
CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
- switch (QuestionId) {
- case KEY_INTERFACE_ID:
- Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"Invalid Interface ID!",
- NULL
- );
- }
-
- break;
-
- case KEY_MANUAL_ADDRESS:
- Status = Ip6ParseAddressListFromString (
- IfrNvData->ManualAddress,
- &Ip6NvData->ManualAddress,
- &Ip6NvData->ManualAddressCount
- );
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"Invalid Host Addresses!",
- NULL
- );
- }
-
- break;
-
- case KEY_GATEWAY_ADDRESS:
- Status = Ip6ParseAddressListFromString (
- IfrNvData->GatewayAddress,
- &Ip6NvData->GatewayAddress,
- &Ip6NvData->GatewayAddressCount
- );
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"Invalid Gateway Addresses!",
- NULL
- );
- }
-
- break;
-
- case KEY_DNS_ADDRESS:
- Status = Ip6ParseAddressListFromString (
- IfrNvData->DnsAddress,
- &Ip6NvData->DnsAddress,
- &Ip6NvData->DnsAddressCount
- );
- if (EFI_ERROR (Status)) {
- CreatePopUp (
- EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
- &Key,
- L"Invalid DNS Addresses!",
- NULL
- );
- }
-
- break;
-
- case KEY_SAVE_CONFIG_CHANGES:
- CopyMem (&OldIfrNvData, IfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
- break;
-
- case KEY_IGNORE_CONFIG_CHANGES:
- CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;
- break;
-
- case KEY_SAVE_CHANGES:
- Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
- if (EFI_ERROR (Status)) {
- break;
- }
-
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
- break;
-
- case KEY_GET_CURRENT_SETTING:
- Ip6Config = &Instance->Ip6Config;
- HiiHandle = Instance->CallbackInfo.RegisteredHandle;
- Data = NULL;
-
- //
- // Get current interface info.
- //
- Status = Ip6ConfigNvGetData (
- Ip6Config,
- Ip6ConfigDataTypeInterfaceInfo,
- &DataSize,
- (VOID **) &Data
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Generate dynamic text opcode for host address and draw it.
- //
- IfInfo = (EFI_IP6_CONFIG_INTERFACE_INFO *) Data;
- Status = Ip6ConvertAddressListToString (
- PortString,
- HiiHandle,
- Ip6ConfigNvHostAddress,
- IfInfo->AddressInfo,
- IfInfo->AddressInfoCount
- );
- if (EFI_ERROR (Status)) {
- FreePool (Data);
- return Status;
- }
-
- //
- // Generate the dynamic text opcode for route table and draw it.
- //
- Status = Ip6ConvertAddressListToString (
- PortString,
- HiiHandle,
- Ip6ConfigNvRouteTable,
- IfInfo->RouteTable,
- IfInfo->RouteCount
- );
- if (EFI_ERROR (Status)) {
- FreePool (Data);
- return Status;
- }
+ if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ switch (QuestionId) {
+ case KEY_GET_CURRENT_SETTING:
+ Ip6Config = &Instance->Ip6Config;
+ HiiHandle = Instance->CallbackInfo.RegisteredHandle;
+ Data = NULL;
- //
- // Get DNS server list.
- //
- FreePool (Data);
- DataSize = 0;
- Data = NULL;
- Status = Ip6ConfigNvGetData (
- Ip6Config,
- Ip6ConfigDataTypeDnsServer,
- &DataSize,
- (VOID **) &Data
- );
- if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
- if (Data != NULL) {
- FreePool (Data);
+ //
+ // Get current interface info.
+ //
+ Status = Ip6ConfigNvGetData (
+ Ip6Config,
+ Ip6ConfigDataTypeInterfaceInfo,
+ &DataSize,
+ (VOID **) &Data
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
}
- return Status;
- }
- if (DataSize > 0) {
//
- // Generate the dynamic text opcode for DNS server and draw it.
+ // Generate dynamic text opcode for host address and draw it.
//
+ IfInfo = (EFI_IP6_CONFIG_INTERFACE_INFO *) Data;
Status = Ip6ConvertAddressListToString (
PortString,
HiiHandle,
- Ip6ConfigNvDnsAddress,
- Data,
- DataSize / sizeof (EFI_IPv6_ADDRESS)
+ Ip6ConfigNvHostAddress,
+ IfInfo->AddressInfo,
+ IfInfo->AddressInfoCount
);
if (EFI_ERROR (Status)) {
FreePool (Data);
return Status;
}
- }
-
- //
- // Get gateway adderss list.
- //
- if (Data != NULL) {
- FreePool (Data);
- }
-
- DataSize = 0;
- Data = NULL;
- Status = Ip6ConfigNvGetData (
- Ip6Config,
- Ip6ConfigDataTypeGateway,
- &DataSize,
- (VOID **) &Data
- );
- if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
- if (Data != NULL) {
- FreePool (Data);
- }
- return Status;
- }
- if (DataSize > 0) {
//
- // Generate the dynamic text opcode for gateway and draw it.
+ // Generate the dynamic text opcode for route table and draw it.
//
Status = Ip6ConvertAddressListToString (
PortString,
HiiHandle,
- Ip6ConfigNvGatewayAddress,
- Data,
- DataSize / sizeof (EFI_IPv6_ADDRESS)
+ Ip6ConfigNvRouteTable,
+ IfInfo->RouteTable,
+ IfInfo->RouteCount
);
if (EFI_ERROR (Status)) {
FreePool (Data);
return Status;
}
- }
- if (Data != NULL) {
+ //
+ // Get DNS server list.
+ //
FreePool (Data);
+ DataSize = 0;
+ Data = NULL;
+ Status = Ip6ConfigNvGetData (
+ Ip6Config,
+ Ip6ConfigDataTypeDnsServer,
+ &DataSize,
+ (VOID **) &Data
+ );
+ if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+ if (Data != NULL) {
+ FreePool (Data);
+ }
+ return Status;
+ }
+
+ if (DataSize > 0) {
+ //
+ // Generate the dynamic text opcode for DNS server and draw it.
+ //
+ Status = Ip6ConvertAddressListToString (
+ PortString,
+ HiiHandle,
+ Ip6ConfigNvDnsAddress,
+ Data,
+ DataSize / sizeof (EFI_IPv6_ADDRESS)
+ );
+ if (EFI_ERROR (Status)) {
+ FreePool (Data);
+ return Status;
+ }
+ }
+
+ //
+ // Get gateway adderss list.
+ //
+ if (Data != NULL) {
+ FreePool (Data);
+ }
+
+ DataSize = 0;
+ Data = NULL;
+ Status = Ip6ConfigNvGetData (
+ Ip6Config,
+ Ip6ConfigDataTypeGateway,
+ &DataSize,
+ (VOID **) &Data
+ );
+ if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+ if (Data != NULL) {
+ FreePool (Data);
+ }
+ return Status;
+ }
+
+ if (DataSize > 0) {
+ //
+ // Generate the dynamic text opcode for gateway and draw it.
+ //
+ Status = Ip6ConvertAddressListToString (
+ PortString,
+ HiiHandle,
+ Ip6ConfigNvGatewayAddress,
+ Data,
+ DataSize / sizeof (EFI_IPv6_ADDRESS)
+ );
+ if (EFI_ERROR (Status)) {
+ FreePool (Data);
+ return Status;
+ }
+ }
+
+ if (Data != NULL) {
+ FreePool (Data);
+ }
+
+ Status = EFI_SUCCESS;
+
+ break;
+
+ default:
+ break;
}
+ } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
+ switch (QuestionId) {
+ case KEY_SAVE_CONFIG_CHANGES:
+ CopyMem (&OldIfrNvData, IfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
+ break;
- Status = EFI_SUCCESS;
+ case KEY_IGNORE_CONFIG_CHANGES:
+ CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
+ break;
- break;
+ case KEY_SAVE_CHANGES:
+ Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
+ if (EFI_ERROR (Status)) {
+ break;
+ }
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
+ break;
+
+ case KEY_INTERFACE_ID:
+ Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"Invalid Interface ID!",
+ NULL
+ );
+ }
+
+ break;
+
+ case KEY_MANUAL_ADDRESS:
+ Status = Ip6ParseAddressListFromString (
+ IfrNvData->ManualAddress,
+ &Ip6NvData->ManualAddress,
+ &Ip6NvData->ManualAddressCount
+ );
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"Invalid Host Addresses!",
+ NULL
+ );
+ }
+
+ break;
+
+ case KEY_GATEWAY_ADDRESS:
+ Status = Ip6ParseAddressListFromString (
+ IfrNvData->GatewayAddress,
+ &Ip6NvData->GatewayAddress,
+ &Ip6NvData->GatewayAddressCount
+ );
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"Invalid Gateway Addresses!",
+ NULL
+ );
+ }
+
+ break;
+
+ case KEY_DNS_ADDRESS:
+ Status = Ip6ParseAddressListFromString (
+ IfrNvData->DnsAddress,
+ &Ip6NvData->DnsAddress,
+ &Ip6NvData->DnsAddressCount
+ );
+ if (EFI_ERROR (Status)) {
+ CreatePopUp (
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
+ &Key,
+ L"Invalid DNS Addresses!",
+ NULL
+ );
+ }
+
+ break;
- default:
- break;
+ default:
+ break;
+ }
}
if (!EFI_ERROR (Status)) {