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
This commit is contained in:
ydong10 2011-12-15 02:57:46 +00:00
parent 8472407740
commit 639a76d191
4 changed files with 376 additions and 359 deletions

View File

@ -1605,14 +1605,6 @@ IScsiConfigProcessDefault (
UINTN TotalNumber;
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?
//
@ -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) && (Action != EFI_BROWSER_ACTION_CHANGED)) {
//
// All other type return unsupported.
//
return EFI_UNSUPPORTED;
}
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
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);
if (Action == EFI_BROWSER_ACTION_CHANGING) {
if (This == NULL || Value == NULL || ActionRequest == NULL) {
return EFI_INVALID_PARAMETER;
switch (QuestionId) {
case KEY_ADD_ATTEMPT:
Status = IScsiConfigAddAttempt ();
break;
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;
}
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);
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
switch (QuestionId) {
case KEY_INITIATOR_NAME:
UnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);
@ -2151,76 +2189,6 @@ IScsiFormCallback (
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
case KEY_ADD_ATTEMPT:
Status = IScsiConfigAddAttempt ();
break;
case KEY_DELETE_ATTEMPT:
CopyMem (
OldIfrNvData.DeleteAttemptList,
IfrNvData->DeleteAttemptList,
sizeof (IfrNvData->DeleteAttemptList)
);
Status = IScsiConfigDisplayDeleteAttempts (IfrNvData);
break;
case KEY_SAVE_DELETE_ATTEMPT:
//
// Delete the Attempt Order from NVR
//
Status = IScsiConfigDeleteAttempts (IfrNvData);
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.
//
Status = IScsiConfigOrderAttempts (IfrNvData);
if (EFI_ERROR (Status)) {
break;
}
IScsiConfigUpdateAttempt ();
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
case KEY_IGNORE_ORDER_CHANGES:
CopyMem (
IfrNvData->DynamicOrderedList,
OldIfrNvData.DynamicOrderedList,
sizeof (IfrNvData->DynamicOrderedList)
);
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;
break;
case KEY_ATTEMPT_NAME:
if (StrLen (IfrNvData->AttemptName) > ATTEMPT_NAME_SIZE) {
CopyMem (AttemptName, IfrNvData->AttemptName, ATTEMPT_NAME_SIZE * sizeof (CHAR16));
@ -2239,6 +2207,59 @@ IScsiFormCallback (
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
case KEY_SAVE_ATTEMPT_CONFIG:
Status = IScsiConvertIfrNvDataToAttemptConfigData (IfrNvData, Private->Current);
if (EFI_ERROR (Status)) {
break;
}
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
case KEY_SAVE_ORDER_CHANGES:
//
// Sync the Attempt Order to NVR.
//
Status = IScsiConfigOrderAttempts (IfrNvData);
if (EFI_ERROR (Status)) {
break;
}
IScsiConfigUpdateAttempt ();
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
break;
case KEY_IGNORE_ORDER_CHANGES:
CopyMem (
IfrNvData->DynamicOrderedList,
OldIfrNvData.DynamicOrderedList,
sizeof (IfrNvData->DynamicOrderedList)
);
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
break;
case KEY_SAVE_DELETE_ATTEMPT:
//
// Delete the Attempt Order from NVR
//
Status = IScsiConfigDeleteAttempts (IfrNvData);
if (EFI_ERROR (Status)) {
break;
}
IScsiConfigUpdateAttempt ();
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
break;
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:
switch (Value->u8) {
@ -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;
}
//
// All other action return unsupported.
//
return EFI_UNSUPPORTED;
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;
}

View File

@ -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),

View File

@ -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;

View File

@ -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
);
}
if (Action == EFI_BROWSER_ACTION_CHANGING) {
switch (QuestionId) {
case KEY_GET_CURRENT_SETTING:
Ip6Config = &Instance->Ip6Config;
HiiHandle = Instance->CallbackInfo.RegisteredHandle;
Data = NULL;
break;
//
// Get current interface info.
//
Status = Ip6ConfigNvGetData (
Ip6Config,
Ip6ConfigDataTypeInterfaceInfo,
&DataSize,
(VOID **) &Data
);
if (EFI_ERROR (Status)) {
return Status;
}
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
);
}
//
// 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;
}
break;
//
// 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;
}
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
);
}
//
// 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;
}
break;
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;
}
}
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
);
}
//
// Get gateway adderss list.
//
if (Data != NULL) {
FreePool (Data);
}
break;
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;
}
case KEY_SAVE_CONFIG_CHANGES:
CopyMem (&OldIfrNvData, IfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
break;
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;
}
}
case KEY_IGNORE_CONFIG_CHANGES:
CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;
break;
if (Data != NULL) {
FreePool (Data);
}
case KEY_SAVE_CHANGES:
Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
if (EFI_ERROR (Status)) {
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;
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
break;
case KEY_IGNORE_CONFIG_CHANGES:
CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
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;
}
//
// 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);
case KEY_SAVE_CHANGES:
Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
if (EFI_ERROR (Status)) {
break;
}
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)
*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)) {
FreePool (Data);
return Status;
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
&Key,
L"Invalid Host Addresses!",
NULL
);
}
}
//
// 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)
break;
case KEY_GATEWAY_ADDRESS:
Status = Ip6ParseAddressListFromString (
IfrNvData->GatewayAddress,
&Ip6NvData->GatewayAddress,
&Ip6NvData->GatewayAddressCount
);
if (EFI_ERROR (Status)) {
FreePool (Data);
return 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;
}
if (Data != NULL) {
FreePool (Data);
}
Status = EFI_SUCCESS;
break;
default:
break;
}
if (!EFI_ERROR (Status)) {