summaryrefslogtreecommitdiff
path: root/NetworkPkg/Ip6Dxe
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2014-05-07 06:17:31 +0000
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>2014-05-07 06:17:31 +0000
commitd551cc64cdf1f943744294819220b78a60b10822 (patch)
tree2d101c7186e6cda17743a85dda99c975e3d33d01 /NetworkPkg/Ip6Dxe
parent5966402ed51c5b611bf437c812047dc9c432a47e (diff)
downloadedk2-platforms-d551cc64cdf1f943744294819220b78a60b10822.tar.xz
1. Mark the network volatile variables as deprecated in code comments and remove related code to set/get these variable.
2. Remove the GetTime() call when receiving Udp4/6 packets. Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye, Ting <ting.ye@intel.com> Reviewed-by: Wu, Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15497 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/Ip6Dxe')
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Common.c142
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Common.h27
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Driver.c12
-rw-r--r--NetworkPkg/Ip6Dxe/Ip6Impl.c7
4 files changed, 4 insertions, 184 deletions
diff --git a/NetworkPkg/Ip6Dxe/Ip6Common.c b/NetworkPkg/Ip6Dxe/Ip6Common.c
index 18ec012a1e..4f71d052bf 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Common.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Common.c
@@ -1,7 +1,7 @@
/** @file
The implementation of common functions shared by IP6 driver.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, 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
@@ -651,146 +651,6 @@ Ip6GetMulticastMac (
}
/**
- Set the Ip6 variable data.
-
- @param[in] IpSb Points to an IP6 service binding instance.
-
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the variable.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-Ip6SetVariableData (
- IN IP6_SERVICE *IpSb
- )
-{
- UINT32 NumConfiguredInstance;
- LIST_ENTRY *Entry;
- UINTN VariableDataSize;
- EFI_IP6_VARIABLE_DATA *Ip6VariableData;
- EFI_IP6_ADDRESS_PAIR *Ip6AddressPair;
- IP6_PROTOCOL *IpInstance;
- CHAR16 *NewMacString;
- EFI_STATUS Status;
-
- NumConfiguredInstance = 0;
-
- //
- // Go through the children list to count the configured children.
- //
- NET_LIST_FOR_EACH (Entry, &IpSb->Children) {
- IpInstance = NET_LIST_USER_STRUCT_S (Entry, IP6_PROTOCOL, Link, IP6_PROTOCOL_SIGNATURE);
-
- if (IpInstance->State == IP6_STATE_CONFIGED) {
- NumConfiguredInstance++;
- }
- }
-
- //
- // Calculate the size of the Ip6VariableData. As there may be no IP child,
- // we should add extra buffer for the address paris only if the number of configured
- // children is more than 1.
- //
- VariableDataSize = sizeof (EFI_IP6_VARIABLE_DATA);
-
- if (NumConfiguredInstance > 1) {
- VariableDataSize += sizeof (EFI_IP6_ADDRESS_PAIR) * (NumConfiguredInstance - 1);
- }
-
- Ip6VariableData = AllocatePool (VariableDataSize);
- if (Ip6VariableData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Ip6VariableData->DriverHandle = IpSb->Image;
- Ip6VariableData->AddressCount = NumConfiguredInstance;
-
- Ip6AddressPair = &Ip6VariableData->AddressPairs[0];
-
- //
- // Go through the children list to fill the configured children's address pairs.
- //
- NET_LIST_FOR_EACH (Entry, &IpSb->Children) {
- IpInstance = NET_LIST_USER_STRUCT_S (Entry, IP6_PROTOCOL, Link, IP6_PROTOCOL_SIGNATURE);
-
- if (IpInstance->State == IP6_STATE_CONFIGED) {
- Ip6AddressPair->InstanceHandle = IpInstance->Handle;
- Ip6AddressPair->PrefixLength = IpInstance->PrefixLength;
- IP6_COPY_ADDRESS (&Ip6AddressPair->Ip6Address, &IpInstance->ConfigData.StationAddress);
-
- Ip6AddressPair++;
- }
- }
-
- //
- // Get the mac string.
- //
- Status = NetLibGetMacString (IpSb->Controller, IpSb->Image, &NewMacString);
- if (EFI_ERROR (Status)) {
- goto Exit;
- }
-
- if (IpSb->MacString != NULL) {
- //
- // The variable is set already, we're going to update it.
- //
- if (StrCmp (IpSb->MacString, NewMacString) != 0) {
- //
- // The mac address is changed, delete the previous variable first.
- //
- gRT->SetVariable (
- IpSb->MacString,
- &gEfiIp6ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
- }
-
- FreePool (IpSb->MacString);
- }
-
- IpSb->MacString = NewMacString;
-
- Status = gRT->SetVariable (
- IpSb->MacString,
- &gEfiIp6ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- VariableDataSize,
- (VOID *) Ip6VariableData
- );
-
-Exit:
- FreePool (Ip6VariableData);
- return Status;
-}
-
-/**
- Clear the variable and free the resource.
-
- @param[in] IpSb Ip6 service binding instance.
-
-**/
-VOID
-Ip6ClearVariableData (
- IN IP6_SERVICE *IpSb
- )
-{
- ASSERT (IpSb->MacString != NULL);
-
- gRT->SetVariable (
- IpSb->MacString,
- &gEfiIp6ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
-
- FreePool (IpSb->MacString);
- IpSb->MacString = NULL;
-}
-
-/**
Convert the multibyte field in IP header's byter order.
In spite of its name, it can also be used to convert from
host to network byte order.
diff --git a/NetworkPkg/Ip6Dxe/Ip6Common.h b/NetworkPkg/Ip6Dxe/Ip6Common.h
index 9c2ddf4d4e..488c5b23b7 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Common.h
+++ b/NetworkPkg/Ip6Dxe/Ip6Common.h
@@ -1,7 +1,7 @@
/** @file
Common definition and functions for IP6 driver.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, 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
@@ -280,31 +280,6 @@ Ip6RemoveAddr (
);
/**
- Set the Ip6 variable data.
-
- @param[in] IpSb Points to an IP6 service binding instance
-
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the variable.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-Ip6SetVariableData (
- IN IP6_SERVICE *IpSb
- );
-
-/**
- Clear the variable and free the resource.
-
- @param[in] IpSb Ip6 service binding instance.
-
-**/
-VOID
-Ip6ClearVariableData (
- IN IP6_SERVICE *IpSb
- );
-
-/**
Get the MAC address for a multicast IP address. Call
Mnp's McastIpToMac to find the MAC address instead of
hard-coding the NIC to be Ethernet.
diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
index b9a64a80f8..69587849cc 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for IP6 driver.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, 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
@@ -573,8 +573,6 @@ Ip6DriverBindingStart (
//
mIp6Id = NET_RANDOM (NetRandomInitSeed ());
- Ip6SetVariableData (IpSb);
-
return EFI_SUCCESS;
}
@@ -701,11 +699,6 @@ Ip6DriverBindingStop (
State = IpSb->State;
IpSb->State = IP6_SERVICE_DESTROY;
- //
- // Clear the variable data.
- //
- Ip6ClearVariableData (IpSb);
-
Status = Ip6CleanService (IpSb);
if (EFI_ERROR (Status)) {
IpSb->State = State;
@@ -943,9 +936,6 @@ Ip6ServiceBindingDestroyChild (
}
Status = Ip6CleanProtocol (IpInstance);
-
- Ip6SetVariableData (IpSb);
-
if (EFI_ERROR (Status)) {
gBS->InstallMultipleProtocolInterfaces (
&ChildHandle,
diff --git a/NetworkPkg/Ip6Dxe/Ip6Impl.c b/NetworkPkg/Ip6Dxe/Ip6Impl.c
index 365495a5e4..621879b1ea 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Impl.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Impl.c
@@ -1,7 +1,7 @@
/** @file
Implementation of EFI_IP6_PROTOCOL protocol interfaces.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, 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
@@ -705,11 +705,6 @@ EfiIp6Configure (
//
Ip6ServiceConfigMnp (IpInstance->Service, FALSE);
- //
- // Update the variable data.
- //
- Ip6SetVariableData (IpInstance->Service);
-
Exit:
gBS->RestoreTPL (OldTpl);
return Status;