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 /MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.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 'MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c')
-rw-r--r-- | MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c | 168 |
1 files changed, 2 insertions, 166 deletions
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c index 8bba357..ce952b1 100644 --- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c +++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c @@ -1,7 +1,7 @@ /** @file
The implementation of the Udp4 protocol.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 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
which accompanies this distribution. The full text of the license may be found at
@@ -1633,8 +1633,6 @@ Udp4Demultiplex ( }
}
- gRT->GetTime (&RxData.TimeStamp, NULL);
-
Udp4Session = &RxData.UdpSession;
Udp4Session->SourcePort = NTOHS (Udp4Header->SrcPort);
Udp4Session->DestinationPort = NTOHS (Udp4Header->DstPort);
@@ -1896,166 +1894,4 @@ Udp4NetVectorExtFree ( VOID *Context
)
{
-}
-
-
-/**
- Set the Udp4 variable data.
-
- @param[in] Udp4Service Udp4 service data.
-
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the
- variable.
- @retval EFI_SUCCESS Set variable successfully.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-Udp4SetVariableData (
- IN UDP4_SERVICE_DATA *Udp4Service
- )
-{
- UINT32 NumConfiguredInstance;
- LIST_ENTRY *Entry;
- UINTN VariableDataSize;
- EFI_UDP4_VARIABLE_DATA *Udp4VariableData;
- EFI_UDP4_SERVICE_POINT *Udp4ServicePoint;
- UDP4_INSTANCE_DATA *Udp4Instance;
- CHAR16 *NewMacString;
- EFI_STATUS Status;
-
- NumConfiguredInstance = 0;
-
- //
- // Go through the children list to count the configured children.
- //
- NET_LIST_FOR_EACH (Entry, &Udp4Service->ChildrenList) {
- Udp4Instance = NET_LIST_USER_STRUCT_S (
- Entry,
- UDP4_INSTANCE_DATA,
- Link,
- UDP4_INSTANCE_DATA_SIGNATURE
- );
-
- if (Udp4Instance->Configured) {
- NumConfiguredInstance++;
- }
- }
-
- //
- // Calculate the size of the Udp4VariableData. As there may be no Udp4 child,
- // we should add extra buffer for the service points only if the number of configured
- // children is more than 1.
- //
- VariableDataSize = sizeof (EFI_UDP4_VARIABLE_DATA);
-
- if (NumConfiguredInstance > 1) {
- VariableDataSize += sizeof (EFI_UDP4_SERVICE_POINT) * (NumConfiguredInstance - 1);
- }
-
- Udp4VariableData = AllocatePool (VariableDataSize);
- if (Udp4VariableData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Udp4VariableData->DriverHandle = Udp4Service->ImageHandle;
- Udp4VariableData->ServiceCount = NumConfiguredInstance;
-
- Udp4ServicePoint = &Udp4VariableData->Services[0];
-
- //
- // Go through the children list to fill the configured children's address pairs.
- //
- NET_LIST_FOR_EACH (Entry, &Udp4Service->ChildrenList) {
- Udp4Instance = NET_LIST_USER_STRUCT_S (
- Entry,
- UDP4_INSTANCE_DATA,
- Link,
- UDP4_INSTANCE_DATA_SIGNATURE
- );
-
- if (Udp4Instance->Configured) {
- Udp4ServicePoint->InstanceHandle = Udp4Instance->ChildHandle;
- Udp4ServicePoint->LocalAddress = Udp4Instance->ConfigData.StationAddress;
- Udp4ServicePoint->LocalPort = Udp4Instance->ConfigData.StationPort;
- Udp4ServicePoint->RemoteAddress = Udp4Instance->ConfigData.RemoteAddress;
- Udp4ServicePoint->RemotePort = Udp4Instance->ConfigData.RemotePort;
-
- Udp4ServicePoint++;
- }
- }
-
- //
- // Get the mac string.
- //
- Status = NetLibGetMacString (
- Udp4Service->ControllerHandle,
- Udp4Service->ImageHandle,
- &NewMacString
- );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
- if (Udp4Service->MacString != NULL) {
- //
- // The variable is set already, we're going to update it.
- //
- if (StrCmp (Udp4Service->MacString, NewMacString) != 0) {
- //
- // The mac address is changed, delete the previous variable first.
- //
- gRT->SetVariable (
- Udp4Service->MacString,
- &gEfiUdp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
- }
-
- FreePool (Udp4Service->MacString);
- }
-
- Udp4Service->MacString = NewMacString;
-
- Status = gRT->SetVariable (
- Udp4Service->MacString,
- &gEfiUdp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- VariableDataSize,
- (VOID *) Udp4VariableData
- );
-
-ON_ERROR:
-
- FreePool (Udp4VariableData);
-
- return Status;
-}
-
-
-/**
- Clear the variable and free the resource.
-
- @param[[in] Udp4Service Udp4 service data.
-
-**/
-VOID
-Udp4ClearVariableData (
- IN UDP4_SERVICE_DATA *Udp4Service
- )
-{
- ASSERT (Udp4Service->MacString != NULL);
-
- gRT->SetVariable (
- Udp4Service->MacString,
- &gEfiUdp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
-
- FreePool (Udp4Service->MacString);
- Udp4Service->MacString = NULL;
-}
+}
\ No newline at end of file |