mirror of https://github.com/acidanthera/audk.git
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:
parent
8472407740
commit
639a76d191
|
@ -1605,14 +1605,6 @@ IScsiConfigProcessDefault (
|
||||||
UINTN TotalNumber;
|
UINTN TotalNumber;
|
||||||
UINTN Index;
|
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?
|
// Is User creating a new attempt?
|
||||||
//
|
//
|
||||||
|
@ -1637,6 +1629,14 @@ IScsiConfigProcessDefault (
|
||||||
//
|
//
|
||||||
return EFI_SUCCESS;
|
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) {
|
if (NewAttempt) {
|
||||||
//
|
//
|
||||||
|
@ -2103,37 +2103,75 @@ IScsiFormCallback (
|
||||||
return EFI_SUCCESS;
|
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 (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||||
if (This == NULL || Value == NULL || ActionRequest == NULL) {
|
switch (QuestionId) {
|
||||||
return EFI_INVALID_PARAMETER;
|
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;
|
||||||
}
|
}
|
||||||
|
} else if (Action == EFI_BROWSER_ACTION_CHANGED) {
|
||||||
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);
|
|
||||||
|
|
||||||
switch (QuestionId) {
|
switch (QuestionId) {
|
||||||
case KEY_INITIATOR_NAME:
|
case KEY_INITIATOR_NAME:
|
||||||
UnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);
|
UnicodeStrToAsciiStr (IfrNvData->InitiatorName, IScsiName);
|
||||||
|
@ -2151,76 +2189,6 @@ IScsiFormCallback (
|
||||||
|
|
||||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
|
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
|
||||||
break;
|
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:
|
case KEY_ATTEMPT_NAME:
|
||||||
if (StrLen (IfrNvData->AttemptName) > ATTEMPT_NAME_SIZE) {
|
if (StrLen (IfrNvData->AttemptName) > ATTEMPT_NAME_SIZE) {
|
||||||
CopyMem (AttemptName, IfrNvData->AttemptName, ATTEMPT_NAME_SIZE * sizeof (CHAR16));
|
CopyMem (AttemptName, IfrNvData->AttemptName, ATTEMPT_NAME_SIZE * sizeof (CHAR16));
|
||||||
|
@ -2239,6 +2207,59 @@ IScsiFormCallback (
|
||||||
|
|
||||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
|
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
|
||||||
break;
|
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:
|
case KEY_IP_MODE:
|
||||||
switch (Value->u8) {
|
switch (Value->u8) {
|
||||||
|
@ -2409,38 +2430,23 @@ IScsiFormCallback (
|
||||||
|
|
||||||
break;
|
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:
|
default:
|
||||||
Status = IScsiConfigProcessDefault (QuestionId, IfrNvData);
|
|
||||||
break;
|
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)) {
|
||||||
// All other action return unsupported.
|
//
|
||||||
//
|
// Pass changed uncommitted data back to Form Browser.
|
||||||
return EFI_UNSUPPORTED;
|
//
|
||||||
|
BufferSize = sizeof (ISCSI_CONFIG_IFR_NVDATA);
|
||||||
|
HiiSetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
FreePool (IfrNvData);
|
||||||
|
FreePool (IScsiName);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,18 +85,19 @@ formset
|
||||||
label ORDER_ENTRY_LABEL;
|
label ORDER_ENTRY_LABEL;
|
||||||
label LABEL_END;
|
label LABEL_END;
|
||||||
|
|
||||||
goto FORMID_MAIN_FORM,
|
text
|
||||||
prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
|
||||||
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
|
text = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
|
text = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
flags = INTERACTIVE,
|
flags = INTERACTIVE,
|
||||||
key = KEY_SAVE_ORDER_CHANGES;
|
key = KEY_SAVE_ORDER_CHANGES;
|
||||||
|
|
||||||
goto FORMID_MAIN_FORM,
|
text
|
||||||
prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
|
||||||
help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
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,
|
flags = INTERACTIVE,
|
||||||
key = KEY_IGNORE_ORDER_CHANGES;
|
key = KEY_IGNORE_ORDER_CHANGES;
|
||||||
|
|
||||||
endform;
|
endform;
|
||||||
|
|
||||||
form formid = FORMID_DELETE_FORM,
|
form formid = FORMID_DELETE_FORM,
|
||||||
|
@ -105,18 +106,19 @@ formset
|
||||||
label DELETE_ENTRY_LABEL;
|
label DELETE_ENTRY_LABEL;
|
||||||
label LABEL_END;
|
label LABEL_END;
|
||||||
|
|
||||||
goto FORMID_MAIN_FORM,
|
text
|
||||||
prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
|
||||||
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
|
text = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
|
text = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
flags = INTERACTIVE,
|
flags = INTERACTIVE,
|
||||||
key = KEY_SAVE_DELETE_ATTEMPT;
|
key = KEY_SAVE_DELETE_ATTEMPT;
|
||||||
|
|
||||||
goto FORMID_MAIN_FORM,
|
text
|
||||||
prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
|
||||||
help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
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,
|
flags = INTERACTIVE,
|
||||||
key = KEY_IGNORE_DELETE_ATTEMPT;
|
key = KEY_IGNORE_DELETE_ATTEMPT;
|
||||||
|
|
||||||
endform;
|
endform;
|
||||||
|
|
||||||
form formid = FORMID_ATTEMPT_FORM,
|
form formid = FORMID_ATTEMPT_FORM,
|
||||||
|
@ -348,12 +350,13 @@ formset
|
||||||
|
|
||||||
subtitle text = STRING_TOKEN(STR_NULL);
|
subtitle text = STRING_TOKEN(STR_NULL);
|
||||||
|
|
||||||
goto FORMID_ATTEMPT_FORM,
|
text
|
||||||
prompt = STRING_TOKEN (STR_SAVE_CHANGES),
|
help = STRING_TOKEN (STR_SAVE_CHANGES_HELP),
|
||||||
help = STRING_TOKEN (STR_SAVE_CHANGES_HELP),
|
text = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||||
flags = INTERACTIVE,
|
text = STRING_TOKEN (STR_SAVE_CHANGES),
|
||||||
key = KEY_SAVE_ATTEMPT_CONFIG;
|
flags = INTERACTIVE,
|
||||||
|
key = KEY_SAVE_ATTEMPT_CONFIG;
|
||||||
|
|
||||||
goto FORMID_MAIN_FORM,
|
goto FORMID_MAIN_FORM,
|
||||||
prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),
|
prompt = STRING_TOKEN (STR_RETURN_MAIN_FORM),
|
||||||
help = STRING_TOKEN (STR_RETURN_MAIN_FORM),
|
help = STRING_TOKEN (STR_RETURN_MAIN_FORM),
|
||||||
|
|
|
@ -163,17 +163,19 @@ formset
|
||||||
maxsize = ADDRESS_STR_MAX_SIZE,
|
maxsize = ADDRESS_STR_MAX_SIZE,
|
||||||
endstring;
|
endstring;
|
||||||
|
|
||||||
goto FORMID_MAIN_FORM,
|
text
|
||||||
prompt = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
help = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
text = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
flags = INTERACTIVE,
|
text = STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
key = KEY_SAVE_CONFIG_CHANGES;
|
flags = INTERACTIVE,
|
||||||
|
key = KEY_SAVE_CONFIG_CHANGES;
|
||||||
|
|
||||||
goto FORMID_MAIN_FORM,
|
text
|
||||||
prompt = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
||||||
help = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
||||||
flags = INTERACTIVE,
|
text = STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
||||||
key = KEY_IGNORE_CONFIG_CHANGES;
|
flags = INTERACTIVE,
|
||||||
|
key = KEY_IGNORE_CONFIG_CHANGES;
|
||||||
|
|
||||||
endform;
|
endform;
|
||||||
|
|
||||||
|
|
|
@ -1651,7 +1651,7 @@ Ip6FormCallback (
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Action != EFI_BROWSER_ACTION_CHANGING) {
|
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1677,224 +1677,230 @@ Ip6FormCallback (
|
||||||
|
|
||||||
CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
|
CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
|
||||||
|
|
||||||
switch (QuestionId) {
|
if (Action == EFI_BROWSER_ACTION_CHANGING) {
|
||||||
case KEY_INTERFACE_ID:
|
switch (QuestionId) {
|
||||||
Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);
|
case KEY_GET_CURRENT_SETTING:
|
||||||
if (EFI_ERROR (Status)) {
|
Ip6Config = &Instance->Ip6Config;
|
||||||
CreatePopUp (
|
HiiHandle = Instance->CallbackInfo.RegisteredHandle;
|
||||||
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
Data = NULL;
|
||||||
&Key,
|
|
||||||
L"Invalid Interface ID!",
|
|
||||||
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 (
|
// Generate dynamic text opcode for host address and draw it.
|
||||||
IfrNvData->ManualAddress,
|
//
|
||||||
&Ip6NvData->ManualAddress,
|
IfInfo = (EFI_IP6_CONFIG_INTERFACE_INFO *) Data;
|
||||||
&Ip6NvData->ManualAddressCount
|
Status = Ip6ConvertAddressListToString (
|
||||||
);
|
PortString,
|
||||||
if (EFI_ERROR (Status)) {
|
HiiHandle,
|
||||||
CreatePopUp (
|
Ip6ConfigNvHostAddress,
|
||||||
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
IfInfo->AddressInfo,
|
||||||
&Key,
|
IfInfo->AddressInfoCount
|
||||||
L"Invalid Host Addresses!",
|
);
|
||||||
NULL
|
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 (
|
// Get DNS server list.
|
||||||
IfrNvData->GatewayAddress,
|
//
|
||||||
&Ip6NvData->GatewayAddress,
|
FreePool (Data);
|
||||||
&Ip6NvData->GatewayAddressCount
|
DataSize = 0;
|
||||||
);
|
Data = NULL;
|
||||||
if (EFI_ERROR (Status)) {
|
Status = Ip6ConfigNvGetData (
|
||||||
CreatePopUp (
|
Ip6Config,
|
||||||
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
Ip6ConfigDataTypeDnsServer,
|
||||||
&Key,
|
&DataSize,
|
||||||
L"Invalid Gateway Addresses!",
|
(VOID **) &Data
|
||||||
NULL
|
);
|
||||||
);
|
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 (
|
// Get gateway adderss list.
|
||||||
IfrNvData->DnsAddress,
|
//
|
||||||
&Ip6NvData->DnsAddress,
|
if (Data != NULL) {
|
||||||
&Ip6NvData->DnsAddressCount
|
FreePool (Data);
|
||||||
);
|
}
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
CreatePopUp (
|
|
||||||
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
|
||||||
&Key,
|
|
||||||
L"Invalid DNS Addresses!",
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
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:
|
if (DataSize > 0) {
|
||||||
CopyMem (&OldIfrNvData, IfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
|
//
|
||||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
|
// Generate the dynamic text opcode for gateway and draw it.
|
||||||
break;
|
//
|
||||||
|
Status = Ip6ConvertAddressListToString (
|
||||||
|
PortString,
|
||||||
|
HiiHandle,
|
||||||
|
Ip6ConfigNvGatewayAddress,
|
||||||
|
Data,
|
||||||
|
DataSize / sizeof (EFI_IPv6_ADDRESS)
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
FreePool (Data);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case KEY_IGNORE_CONFIG_CHANGES:
|
if (Data != NULL) {
|
||||||
CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
|
FreePool (Data);
|
||||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case KEY_SAVE_CHANGES:
|
Status = EFI_SUCCESS;
|
||||||
Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
|
|
||||||
if (EFI_ERROR (Status)) {
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
break;
|
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;
|
case KEY_IGNORE_CONFIG_CHANGES:
|
||||||
break;
|
CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
|
||||||
|
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
|
||||||
|
break;
|
||||||
|
|
||||||
case KEY_GET_CURRENT_SETTING:
|
case KEY_SAVE_CHANGES:
|
||||||
Ip6Config = &Instance->Ip6Config;
|
Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
|
||||||
HiiHandle = Instance->CallbackInfo.RegisteredHandle;
|
if (EFI_ERROR (Status)) {
|
||||||
Data = NULL;
|
break;
|
||||||
|
|
||||||
//
|
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
return Status;
|
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (DataSize > 0) {
|
case KEY_INTERFACE_ID:
|
||||||
//
|
Status = Ip6ParseInterfaceIdFromString (IfrNvData->InterfaceId, &Ip6NvData->InterfaceId);
|
||||||
// Generate the dynamic text opcode for DNS server and draw it.
|
if (EFI_ERROR (Status)) {
|
||||||
//
|
CreatePopUp (
|
||||||
Status = Ip6ConvertAddressListToString (
|
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
||||||
PortString,
|
&Key,
|
||||||
HiiHandle,
|
L"Invalid Interface ID!",
|
||||||
Ip6ConfigNvDnsAddress,
|
NULL
|
||||||
Data,
|
);
|
||||||
DataSize / sizeof (EFI_IPv6_ADDRESS)
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KEY_MANUAL_ADDRESS:
|
||||||
|
Status = Ip6ParseAddressListFromString (
|
||||||
|
IfrNvData->ManualAddress,
|
||||||
|
&Ip6NvData->ManualAddress,
|
||||||
|
&Ip6NvData->ManualAddressCount
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
FreePool (Data);
|
CreatePopUp (
|
||||||
return Status;
|
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
||||||
|
&Key,
|
||||||
|
L"Invalid Host Addresses!",
|
||||||
|
NULL
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
break;
|
||||||
//
|
|
||||||
// Get gateway adderss list.
|
case KEY_GATEWAY_ADDRESS:
|
||||||
//
|
Status = Ip6ParseAddressListFromString (
|
||||||
if (Data != NULL) {
|
IfrNvData->GatewayAddress,
|
||||||
FreePool (Data);
|
&Ip6NvData->GatewayAddress,
|
||||||
}
|
&Ip6NvData->GatewayAddressCount
|
||||||
|
|
||||||
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)) {
|
if (EFI_ERROR (Status)) {
|
||||||
FreePool (Data);
|
CreatePopUp (
|
||||||
return Status;
|
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)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
|
|
Loading…
Reference in New Issue