summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-19 07:31:18 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-19 07:31:18 +0000
commit9120f7a58dd892ffd9bfe8f4e77e09049d341061 (patch)
tree8a44cb798774ad2eac7947cc4523a531d78ffca0
parentfcfe2a572ef2495c03d3378a29a840e02bf1473a (diff)
downloadedk2-9120f7a58dd892ffd9bfe8f4e77e09049d341061.zip
edk2-9120f7a58dd892ffd9bfe8f4e77e09049d341061.tar.gz
edk2-9120f7a58dd892ffd9bfe8f4e77e09049d341061.tar.bz2
Sync patch r12198 from main trunk.
Update to NOT to use EFI_BROWSER_ACTION_FORM_OPEN in Callback function thus able to function properly in UEFI2.1 platform. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UDK2010@12942 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Config.vfr13
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6ConfigNv.c258
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6DxeStrings.unibin9694 -> 10226 bytes
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6NvData.h4
4 files changed, 151 insertions, 124 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6Config.vfr b/NetworkPkg/Ip6Dxe/Ip6Config.vfr
index 902cef6..7639f5a 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Config.vfr
+++ b/NetworkPkg/Ip6Dxe/Ip6Config.vfr
@@ -1,7 +1,7 @@
/** @file
VFR file used by the IP6 configuration component.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -28,6 +28,17 @@ formset
name = IP6_CONFIG_IFR_NVDATA,
guid = IP6_CONFIG_NVDATA_GUID;
+ form formid = FORMID_HEAD_FORM,
+ title = STRING_TOKEN(STR_IP6_DEVICE_FORM_TITLE);
+
+ goto FORMID_MAIN_FORM,
+ prompt = STRING_TOKEN (STR_GET_CURRENT_SETTING),
+ help = STRING_TOKEN (STR_GET_CURRENT_SETTING_HELP),
+ flags = INTERACTIVE,
+ key = KEY_GET_CURRENT_SETTING;
+
+ endform;
+
form formid = FORMID_MAIN_FORM,
title = STRING_TOKEN(STR_IP6_DEVICE_FORM_TITLE);
diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c b/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
index ef5ea2e..a6eb347 100644
--- a/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
+++ b/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
@@ -1649,130 +1649,12 @@ Ip6FormCallback (
Instance = IP6_CONFIG_INSTANCE_FROM_FORM_CALLBACK (Private);
Ip6NvData = &Instance->Ip6NvData;
- if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
- //
- // Update main Form when main Form is opened.
- // This will be done only in FORM_OPEN CallBack of question with KEY_INTERFACE_ID from main Form.
- //
- if (QuestionId != KEY_INTERFACE_ID) {
- return EFI_SUCCESS;
- }
-
- Ip6Config = &Instance->Ip6Config;
- HiiHandle = Instance->CallbackInfo.RegisteredHandle;
-
- //
- // Get the current interface info.
- //
- Status = Ip6ConfigNvGetData (
- Ip6Config,
- Ip6ConfigDataTypeInterfaceInfo,
- &DataSize,
- (VOID **) &Data
- );
- if (EFI_ERROR (Status)) {
- goto Exit;
- }
-
- //
- // Generate the 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)) {
- goto Exit;
- }
-
- //
- // Generate the dynamic text opcode for route table and draw it.
- //
- Status = Ip6ConvertAddressListToString (
- PortString,
- HiiHandle,
- Ip6ConfigNvRouteTable,
- IfInfo->RouteTable,
- IfInfo->RouteCount
- );
- if (EFI_ERROR (Status)) {
- goto Exit;
- }
-
- //
- // Get DNS server list.
- //
- DataSize = 0;
- Status = Ip6ConfigNvGetData (
- Ip6Config,
- Ip6ConfigDataTypeDnsServer,
- &DataSize,
- (VOID **) &Data
- );
- if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
- goto Exit;
- }
-
- 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)) {
- goto Exit;
- }
- }
-
- //
- // Get gateway adderss list.
- //
- DataSize = 0;
- Status = Ip6ConfigNvGetData (
- Ip6Config,
- Ip6ConfigDataTypeGateway,
- &DataSize,
- (VOID **) &Data
- );
- if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
- goto Exit;
- }
-
- 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)) {
- goto Exit;
- }
- }
-
-Exit:
- FreePool (Data);
- return Status;
+ if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)){
+ return EFI_SUCCESS;
}
- if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {
- //
- // Do nothing for UEFI FORM_CLOSE action
- //
- return EFI_SUCCESS;
+ if (Action != EFI_BROWSER_ACTION_CHANGING) {
+ return EFI_UNSUPPORTED;
}
if ((Value == NULL) || (ActionRequest == NULL)) {
@@ -1881,6 +1763,138 @@ Exit:
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_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);
+ }
+ 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;
}
diff --git a/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni b/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni
index e95f2f9..01f3e99 100644
--- a/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni
+++ b/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni
Binary files differ
diff --git a/NetworkPkg/Ip6Dxe/Ip6NvData.h b/NetworkPkg/Ip6Dxe/Ip6NvData.h
index 715473f..6c981d2 100644
--- a/NetworkPkg/Ip6Dxe/Ip6NvData.h
+++ b/NetworkPkg/Ip6Dxe/Ip6NvData.h
@@ -1,7 +1,7 @@
/** @file
NVData structure used by the IP6 configuration component.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -23,6 +23,7 @@
#define FORMID_MAIN_FORM 1
#define FORMID_MANUAL_CONFIG_FORM 2
+#define FORMID_HEAD_FORM 3
#define IP6_POLICY_AUTO 0
#define IP6_POLICY_MANUAL 1
@@ -35,6 +36,7 @@
#define KEY_SAVE_CHANGES 0x105
#define KEY_SAVE_CONFIG_CHANGES 0x106
#define KEY_IGNORE_CONFIG_CHANGES 0x107
+#define KEY_GET_CURRENT_SETTING 0x108
#define HOST_ADDRESS_LABEL 0x9000
#define ROUTE_TABLE_LABEL 0xa000