summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Config.vfr13
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6ConfigNv.c301
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6DxeStrings.unibin9694 -> 10226 bytes
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6NvData.h4
4 files changed, 169 insertions, 149 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6Config.vfr b/NetworkPkg/Ip6Dxe/Ip6Config.vfr
index 902cef6209..7639f5a0fa 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 64fb25f169..d3efaa8e06 100644
--- a/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
+++ b/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
@@ -1649,20 +1649,127 @@ 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;
+ if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)){
+ return EFI_SUCCESS;
+ }
+
+ if (Action != EFI_BROWSER_ACTION_CHANGING) {
+ return EFI_UNSUPPORTED;
+ }
+
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Retrieve uncommitted data from Browser
+ //
+
+ BufferSize = sizeof (IP6_CONFIG_IFR_NVDATA);
+ IfrNvData = AllocateZeroPool (BufferSize);
+ if (IfrNvData == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ Status = EFI_SUCCESS;
+
+ ZeroMem (&OldIfrNvData, BufferSize);
+
+ HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
+
+ 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_SUBMIT;
+ break;
+
+ case KEY_IGNORE_CONFIG_CHANGES:
+ CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
+ break;
+
+ case KEY_SAVE_CHANGES:
+ Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
+ if (EFI_ERROR (Status)) {
+ break;
+ }
+
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+ break;
+
+ case KEY_GET_CURRENT_SETTING:
Ip6Config = &Instance->Ip6Config;
HiiHandle = Instance->CallbackInfo.RegisteredHandle;
+ Data = NULL;
//
- // Get the current interface info.
+ // Get current interface info.
//
Status = Ip6ConfigNvGetData (
Ip6Config,
@@ -1671,11 +1778,11 @@ Ip6FormCallback (
(VOID **) &Data
);
if (EFI_ERROR (Status)) {
- goto Exit;
+ return Status;
}
//
- // Generate the dynamic text opcode for host address and draw it.
+ // Generate dynamic text opcode for host address and draw it.
//
IfInfo = (EFI_IP6_CONFIG_INTERFACE_INFO *) Data;
Status = Ip6ConvertAddressListToString (
@@ -1686,7 +1793,8 @@ Ip6FormCallback (
IfInfo->AddressInfoCount
);
if (EFI_ERROR (Status)) {
- goto Exit;
+ FreePool (Data);
+ return Status;
}
//
@@ -1700,13 +1808,16 @@ Ip6FormCallback (
IfInfo->RouteCount
);
if (EFI_ERROR (Status)) {
- goto Exit;
+ FreePool (Data);
+ return Status;
}
//
// Get DNS server list.
//
+ FreePool (Data);
DataSize = 0;
+ Data = NULL;
Status = Ip6ConfigNvGetData (
Ip6Config,
Ip6ConfigDataTypeDnsServer,
@@ -1714,7 +1825,10 @@ Ip6FormCallback (
(VOID **) &Data
);
if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
- goto Exit;
+ if (Data != NULL) {
+ FreePool (Data);
+ }
+ return Status;
}
if (DataSize > 0) {
@@ -1729,14 +1843,20 @@ Ip6FormCallback (
DataSize / sizeof (EFI_IPv6_ADDRESS)
);
if (EFI_ERROR (Status)) {
- goto Exit;
+ FreePool (Data);
+ return Status;
}
}
//
// Get gateway adderss list.
//
+ if (Data != NULL) {
+ FreePool (Data);
+ }
+
DataSize = 0;
+ Data = NULL;
Status = Ip6ConfigNvGetData (
Ip6Config,
Ip6ConfigDataTypeGateway,
@@ -1744,7 +1864,10 @@ Ip6FormCallback (
(VOID **) &Data
);
if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
- goto Exit;
+ if (Data != NULL) {
+ FreePool (Data);
+ }
+ return Status;
}
if (DataSize > 0) {
@@ -1759,149 +1882,33 @@ Ip6FormCallback (
DataSize / sizeof (EFI_IPv6_ADDRESS)
);
if (EFI_ERROR (Status)) {
- goto Exit;
+ FreePool (Data);
+ return Status;
}
}
-Exit:
- FreePool (Data);
- return Status;
- }
-
- if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {
- //
- // Do nothing for UEFI FORM_CLOSE action
- //
- return EFI_SUCCESS;
- }
-
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
- if ((Value == NULL) || (ActionRequest == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Retrieve uncommitted data from Browser
- //
-
- BufferSize = sizeof (IP6_CONFIG_IFR_NVDATA);
- IfrNvData = AllocateZeroPool (BufferSize);
- if (IfrNvData == NULL) {
- return EFI_OUT_OF_RESOURCES;
+ if (Data != NULL) {
+ FreePool (Data);
}
Status = EFI_SUCCESS;
- ZeroMem (&OldIfrNvData, BufferSize);
-
- HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
-
- 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;
+ 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_SUBMIT;
- break;
-
- case KEY_IGNORE_CONFIG_CHANGES:
- CopyMem (IfrNvData, &OldIfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
- break;
-
- case KEY_SAVE_CHANGES:
- Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
- if (EFI_ERROR (Status)) {
- break;
- }
-
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
- break;
-
- default:
- break;
- }
-
- if (!EFI_ERROR (Status)) {
- //
- // Pass changed uncommitted data back to Form Browser.
- //
- BufferSize = sizeof (IP6_CONFIG_IFR_NVDATA);
- HiiSetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);
- }
+ default:
+ break;
+ }
- FreePool (IfrNvData);
- return Status;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Pass changed uncommitted data back to Form Browser.
+ //
+ BufferSize = sizeof (IP6_CONFIG_IFR_NVDATA);
+ HiiSetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData, NULL);
}
- //
- // All other action return unsupported.
- //
- return EFI_UNSUPPORTED;
+ FreePool (IfrNvData);
+ return Status;
}
/**
diff --git a/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni b/NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni
index e95f2f9c23..01f3e996b8 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 715473fde3..6c981d2aa7 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