diff options
author | Fu Siyuan <siyuan.fu@intel.com> | 2014-05-07 06:17:31 +0000 |
---|---|---|
committer | sfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-05-07 06:17:31 +0000 |
commit | d551cc64cdf1f943744294819220b78a60b10822 (patch) | |
tree | 2d101c7186e6cda17743a85dda99c975e3d33d01 /NetworkPkg/Udp6Dxe/Udp6Impl.c | |
parent | 5966402ed51c5b611bf437c812047dc9c432a47e (diff) | |
download | edk2-d551cc64cdf1f943744294819220b78a60b10822.zip edk2-d551cc64cdf1f943744294819220b78a60b10822.tar.gz edk2-d551cc64cdf1f943744294819220b78a60b10822.tar.bz2 |
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/Udp6Dxe/Udp6Impl.c')
-rw-r--r-- | NetworkPkg/Udp6Dxe/Udp6Impl.c | 174 |
1 files changed, 2 insertions, 172 deletions
diff --git a/NetworkPkg/Udp6Dxe/Udp6Impl.c b/NetworkPkg/Udp6Dxe/Udp6Impl.c index 3830b14..40e3aff 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Impl.c +++ b/NetworkPkg/Udp6Dxe/Udp6Impl.c @@ -1,7 +1,7 @@ /** @file
Udp6 driver's whole implementation.
- 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
@@ -1623,8 +1623,6 @@ Udp6Demultiplex ( }
}
- gRT->GetTime (&RxData.TimeStamp, NULL);
-
Udp6Session = &RxData.UdpSession;
Udp6Session->SourcePort = NTOHS (Udp6Header->SrcPort);
Udp6Session->DestinationPort = NTOHS (Udp6Header->DstPort);
@@ -1933,175 +1931,7 @@ Udp6NetVectorExtFree ( IN VOID *Context
)
{
-}
-
-
-/**
- Set the Udp6 variable data.
-
- @param[in] Udp6Service Udp6 service data.
-
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the
- variable.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-Udp6SetVariableData (
- IN UDP6_SERVICE_DATA *Udp6Service
- )
-{
- UINT32 NumConfiguredInstance;
- LIST_ENTRY *Entry;
- UINTN VariableDataSize;
- EFI_UDP6_VARIABLE_DATA *Udp6VariableData;
- EFI_UDP6_SERVICE_POINT *Udp6ServicePoint;
- UDP6_INSTANCE_DATA *Udp6Instance;
- CHAR16 *NewMacString;
- EFI_STATUS Status;
-
- NumConfiguredInstance = 0;
-
- //
- // Go through the children list to count the configured children.
- //
- NET_LIST_FOR_EACH (Entry, &Udp6Service->ChildrenList) {
- Udp6Instance = NET_LIST_USER_STRUCT_S (
- Entry,
- UDP6_INSTANCE_DATA,
- Link,
- UDP6_INSTANCE_DATA_SIGNATURE
- );
-
- if (Udp6Instance->Configured) {
- NumConfiguredInstance++;
- }
- }
-
- //
- // Calculate the size of the Udp6VariableData. As there may be no Udp6 child,
- // we should add extra buffer for the service points only if the number of configured
- // children is more than 1.
- //
- VariableDataSize = sizeof (EFI_UDP6_VARIABLE_DATA);
-
- if (NumConfiguredInstance > 1) {
- VariableDataSize += sizeof (EFI_UDP6_SERVICE_POINT) * (NumConfiguredInstance - 1);
- }
-
- Udp6VariableData = AllocateZeroPool (VariableDataSize);
- if (Udp6VariableData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Udp6VariableData->DriverHandle = Udp6Service->ImageHandle;
- Udp6VariableData->ServiceCount = NumConfiguredInstance;
-
- Udp6ServicePoint = &Udp6VariableData->Services[0];
-
- //
- // Go through the children list to fill the configured children's address pairs.
- //
- NET_LIST_FOR_EACH (Entry, &Udp6Service->ChildrenList) {
- Udp6Instance = NET_LIST_USER_STRUCT_S (
- Entry,
- UDP6_INSTANCE_DATA,
- Link,
- UDP6_INSTANCE_DATA_SIGNATURE
- );
-
- if (Udp6Instance->Configured) {
- Udp6ServicePoint->InstanceHandle = Udp6Instance->ChildHandle;
- Udp6ServicePoint->LocalPort = Udp6Instance->ConfigData.StationPort;
- Udp6ServicePoint->RemotePort = Udp6Instance->ConfigData.RemotePort;
-
- IP6_COPY_ADDRESS (
- &Udp6ServicePoint->LocalAddress,
- &Udp6Instance->ConfigData.StationAddress
- );
- IP6_COPY_ADDRESS (
- &Udp6ServicePoint->RemoteAddress,
- &Udp6Instance->ConfigData.RemoteAddress
- );
- Udp6ServicePoint++;
- }
- }
-
- //
- // Get the MAC string.
- //
- Status = NetLibGetMacString (
- Udp6Service->ControllerHandle,
- Udp6Service->ImageHandle,
- &NewMacString
- );
- if (EFI_ERROR (Status)) {
- goto EXIT;
- }
-
- if (Udp6Service->MacString != NULL) {
- //
- // The variable is set already, we're going to update it.
- //
- if (StrCmp (Udp6Service->MacString, NewMacString) != 0) {
- //
- // The MAC address is changed, delete the previous variable first.
- //
- gRT->SetVariable (
- Udp6Service->MacString,
- &gEfiUdp6ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
- }
-
- FreePool (Udp6Service->MacString);
- }
-
- Udp6Service->MacString = NewMacString;
-
- Status = gRT->SetVariable (
- Udp6Service->MacString,
- &gEfiUdp6ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- VariableDataSize,
- (VOID *) Udp6VariableData
- );
-
-EXIT:
-
- FreePool (Udp6VariableData);
-
- return Status;
-}
-
-
-/**
- Clear the variable and free the resource.
-
- @param[in, out] Udp6Service Udp6 service data.
-
-**/
-VOID
-Udp6ClearVariableData (
- IN OUT UDP6_SERVICE_DATA *Udp6Service
- )
-{
- ASSERT (Udp6Service->MacString != NULL);
-
- gRT->SetVariable (
- Udp6Service->MacString,
- &gEfiUdp6ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
-
- FreePool (Udp6Service->MacString);
- Udp6Service->MacString = NULL;
-}
-
+}
/**
Find the key in the netmap.
|