summaryrefslogtreecommitdiff
path: root/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-20 01:58:48 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-20 01:58:48 +0000
commit2d4df3393fa468e1bf32f032c0c98c1045a6a0b9 (patch)
treed1e09955efa563dd40b9f96c9788d54de044f75e /NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
parentd88f86f154ddbe39355fcf0aca03438f219b2660 (diff)
downloadedk2-platforms-2d4df3393fa468e1bf32f032c0c98c1045a6a0b9.tar.xz
Refine all R9 call back function to return EFI_UNSUPPORTED for all unsupported call back type.
Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11682 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/Ip6Dxe/Ip6ConfigNv.c')
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6ConfigNv.c203
1 files changed, 105 insertions, 98 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c b/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
index ef5ea2e13a..64fb25f169 100644
--- a/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
+++ b/NetworkPkg/Ip6Dxe/Ip6ConfigNv.c
@@ -1,7 +1,7 @@
/** @file
Helper functions for configuring or obtaining the parameters relating to IP6.
- 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
@@ -1775,126 +1775,133 @@ Exit:
return EFI_SUCCESS;
}
- if ((Value == NULL) || (ActionRequest == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
+ if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
- //
- // Retrieve uncommitted data from Browser
- //
+ //
+ // Retrieve uncommitted data from Browser
+ //
- BufferSize = sizeof (IP6_CONFIG_IFR_NVDATA);
- IfrNvData = AllocateZeroPool (BufferSize);
- if (IfrNvData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
+ BufferSize = sizeof (IP6_CONFIG_IFR_NVDATA);
+ IfrNvData = AllocateZeroPool (BufferSize);
+ if (IfrNvData == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
- ZeroMem (&OldIfrNvData, BufferSize);
+ ZeroMem (&OldIfrNvData, BufferSize);
- HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
+ HiiGetBrowserData (NULL, NULL, BufferSize, (UINT8 *) IfrNvData);
- CopyMem (&OldIfrNvData, IfrNvData, BufferSize);
+ 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
- );
- }
+ 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;
+ 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
- );
- }
+ 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;
+ 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
- );
- }
+ 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
- );
- }
+ 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;
+ break;
- case KEY_SAVE_CONFIG_CHANGES:
- CopyMem (&OldIfrNvData, IfrNvData, sizeof (IP6_CONFIG_IFR_NVDATA));
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
- 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_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)) {
+ case KEY_SAVE_CHANGES:
+ Status = Ip6ConvertIfrNvDataToConfigNvData (IfrNvData, Instance);
+ if (EFI_ERROR (Status)) {
+ break;
+ }
+
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
- }
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
- break;
+ default:
+ 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);
+ }
- 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);
+ FreePool (IfrNvData);
+ return Status;
}
- FreePool (IfrNvData);
- return Status;
+ //
+ // All other action return unsupported.
+ //
+ return EFI_UNSUPPORTED;
}
/**