summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Network')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c150
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h31
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c14
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c9
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h7
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c4
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c9
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h3
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h27
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c202
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c8
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c168
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h34
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c6
14 files changed, 18 insertions, 654 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c
index 16b88aeb85..004a8bc703 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -267,151 +267,3 @@ Ip4NtohHead (
return Head;
}
-
-
-/**
- Set the Ip4 variable data.
-
- Save the list of all of the IPv4 addresses and subnet masks that are currently
- being used to volatile variable storage.
-
- @param[in] IpSb Ip4 service binding instance
-
- @retval EFI_SUCCESS Successfully set variable.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the variable.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-Ip4SetVariableData (
- IN IP4_SERVICE *IpSb
- )
-{
- UINT32 NumConfiguredInstance;
- LIST_ENTRY *Entry;
- UINTN VariableDataSize;
- EFI_IP4_VARIABLE_DATA *Ip4VariableData;
- EFI_IP4_ADDRESS_PAIR *Ip4AddressPair;
- IP4_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, IP4_PROTOCOL, Link, IP4_PROTOCOL_SIGNATURE);
-
- if (IpInstance->State == IP4_STATE_CONFIGED) {
- NumConfiguredInstance++;
- }
- }
-
- //
- // Calculate the size of the Ip4VariableData. 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_IP4_VARIABLE_DATA);
-
- if (NumConfiguredInstance > 1) {
- VariableDataSize += sizeof (EFI_IP4_ADDRESS_PAIR) * (NumConfiguredInstance - 1);
- }
-
- Ip4VariableData = AllocatePool (VariableDataSize);
- if (Ip4VariableData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Ip4VariableData->DriverHandle = IpSb->Image;
- Ip4VariableData->AddressCount = NumConfiguredInstance;
-
- Ip4AddressPair = &Ip4VariableData->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, IP4_PROTOCOL, Link, IP4_PROTOCOL_SIGNATURE);
-
- if (IpInstance->State == IP4_STATE_CONFIGED) {
- Ip4AddressPair->InstanceHandle = IpInstance->Handle;
- EFI_IP4 (Ip4AddressPair->Ip4Address) = NTOHL (IpInstance->Interface->Ip);
- EFI_IP4 (Ip4AddressPair->SubnetMask) = NTOHL (IpInstance->Interface->SubnetMask);
-
- Ip4AddressPair++;
- }
- }
-
- //
- // Get the mac string.
- //
- Status = NetLibGetMacString (IpSb->Controller, IpSb->Image, &NewMacString);
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
- 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,
- &gEfiIp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
- }
-
- FreePool (IpSb->MacString);
- }
-
- IpSb->MacString = NewMacString;
-
- Status = gRT->SetVariable (
- IpSb->MacString,
- &gEfiIp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- VariableDataSize,
- (VOID *) Ip4VariableData
- );
-
-ON_ERROR:
-
- FreePool (Ip4VariableData);
-
- return Status;
-}
-
-
-/**
- Clear the variable and free the resource.
-
- @param[in] IpSb Ip4 service binding instance
-
-**/
-VOID
-Ip4ClearVariableData (
- IN IP4_SERVICE *IpSb
- )
-{
- ASSERT (IpSb->MacString != NULL);
-
- gRT->SetVariable (
- IpSb->MacString,
- &gEfiIp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
-
- FreePool (IpSb->MacString);
- IpSb->MacString = NULL;
-}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
index 64049303e4..d38857c677 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.h
@@ -1,7 +1,7 @@
/** @file
Common definition for IP4.
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -201,33 +201,4 @@ Ip4NtohHead (
IN IP4_HEAD *Head
);
-/**
- Set the Ip4 variable data.
-
- Save the list of all of the IPv4 addresses and subnet masks that are currently
- being used to volatile variable storage.
-
- @param[in] IpSb Ip4 service binding instance
-
- @retval EFI_SUCCESS Successfully set variable.
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the variable.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-Ip4SetVariableData (
- IN IP4_SERVICE *IpSb
- );
-
-/**
- Clear the variable and free the resource.
-
- @param[in] IpSb Ip4 service binding instance
-
-**/
-VOID
-Ip4ClearVariableData (
- IN IP4_SERVICE *IpSb
- );
-
#endif
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
index 73b4e246e0..4944113e46 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for IP4 driver.
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -297,8 +297,6 @@ Ip4CreateService (
IpSb->MaxPacketSize -= NET_VLAN_TAG_LEN;
}
IpSb->OldMaxPacketSize = IpSb->MaxPacketSize;
- IpSb->MacString = NULL;
-
*Service = IpSb;
return EFI_SUCCESS;
@@ -519,8 +517,6 @@ Ip4DriverBindingStart (
//
mIp4Id = (UINT16)NET_RANDOM (NetRandomInitSeed ());
- Ip4SetVariableData (IpSb);
-
return Status;
UNINSTALL_PROTOCOL:
@@ -717,11 +713,6 @@ Ip4DriverBindingStop (
IpSb->State = IP4_SERVICE_DESTROY;
//
- // Clear the variable data.
- //
- Ip4ClearVariableData (IpSb);
-
- //
// OK, clean other resources then uninstall the service binding protocol.
//
Status = Ip4CleanService (IpSb);
@@ -975,9 +966,6 @@ Ip4ServiceBindingDestroyChild (
}
Status = Ip4CleanProtocol (IpInstance);
-
- Ip4SetVariableData (IpSb);
-
if (EFI_ERROR (Status)) {
gBS->InstallMultipleProtocolInterfaces (
&ChildHandle,
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
index cd01685a30..06a56e1294 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -701,8 +701,6 @@ Ip4AutoConfigCallBackDpc (
IpSb->State = IP4_SERVICE_CONFIGED;
- Ip4SetVariableData (IpSb);
-
ON_EXIT:
FreePool (Data);
}
@@ -1312,11 +1310,6 @@ EfiIp4Configure (
//
Ip4ServiceConfigMnp (IpInstance->Service, FALSE);
- //
- // Update the variable data.
- //
- Ip4SetVariableData (IpInstance->Service);
-
ON_EXIT:
gBS->RestoreTPL (OldTpl);
return Status;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
index ad8a9276bd..c49e013c8f 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
@@ -1,7 +1,7 @@
/** @file
Ip4 internal functions and type defintions.
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -202,11 +202,6 @@ struct _IP4_SERVICE {
EFI_EVENT ReconfigEvent;
EFI_EVENT ActiveEvent;
- //
- // The string representation of the current mac address of the
- // NIC this IP4_SERVICE works on.
- //
- CHAR16 *MacString;
UINT32 MaxPacketSize;
UINT32 OldMaxPacketSize; ///< The MTU before IPsec enable.
};
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
index 93d10c9eb2..e09d2c9e57 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
@@ -1,7 +1,7 @@
/** @file
Tcp request dispatcher implementation.
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -237,8 +237,6 @@ Tcp4FlushPcb (
);
FreePool (Sock->DevicePath);
}
-
- TcpSetVariableData (TcpProto->TcpService);
}
NetbufFreeList (&Tcb->SndQue);
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
index 29a0cf76c2..30e9406161 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
@@ -1,7 +1,7 @@
/** @file
Tcp driver function.
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -418,8 +418,6 @@ Tcp4DriverBindingStart (
InitializeListHead (&TcpServiceData->SocketList);
- TcpSetVariableData (TcpServiceData);
-
return EFI_SUCCESS;
ON_ERROR:
@@ -539,11 +537,6 @@ Tcp4DriverBindingStop (
//
Tcp4DestroyTimer ();
- //
- // Clear the variable.
- //
- TcpClearVariableData (TcpServiceData);
-
if (gTcpControllerNameTable != NULL) {
FreeUnicodeStringTable (gTcpControllerNameTable);
gTcpControllerNameTable = NULL;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
index 0a106a46fb..5fe98d4068 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
@@ -1,7 +1,7 @@
/** @file
Tcp driver function header.
-Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -48,7 +48,6 @@ typedef struct _TCP4_SERVICE_DATA {
IP_IO *IpIo; // IP Io consumed by TCP4
EFI_SERVICE_BINDING_PROTOCOL Tcp4ServiceBinding;
EFI_HANDLE DriverBindingHandle;
- CHAR16 *MacString;
LIST_ENTRY SocketList;
} TCP4_SERVICE_DATA;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
index 24e9b5146f..53b7aac8ae 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
@@ -1,7 +1,7 @@
/** @file
Tcp function header file.
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -765,31 +765,6 @@ TcpBackoffRto (
);
/**
- Set the Tdp4 variable data.
-
- @param Tcp4Service Pointer to Tcp4 service data.
-
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the variable.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-TcpSetVariableData (
- IN TCP4_SERVICE_DATA *Tcp4Service
- );
-
-/**
- Clear the variable and free the resource.
-
- @param Tcp4Service Pointer to Tcp4 service data.
-
-**/
-VOID
-TcpClearVariableData (
- IN TCP4_SERVICE_DATA *Tcp4Service
- );
-
-/**
Install the device path protocol on the TCP instance.
@param Sock Pointer to the socket representing the TCP instance.
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
index bf04b5a55b..5b18d20497 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
@@ -1,7 +1,7 @@
/** @file
Misc support routines for tcp.
-Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 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
@@ -392,7 +392,6 @@ TcpInsertTcb (
InsertHeadList (Head, &Tcb->List);
TcpProto = (TCP4_PROTO_DATA *) Tcb->Sk->ProtoReserved;
- TcpSetVariableData (TcpProto->TcpService);
return 0;
}
@@ -878,205 +877,6 @@ TcpOnAppAbort (
TcpSetState (Tcb, TCP_CLOSED);
}
-
-/**
- Set the Tdp4 variable data.
-
- @param Tcp4Service Pointer to Tcp4 service data.
-
- @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the variable.
- @retval other Set variable failed.
-
-**/
-EFI_STATUS
-TcpSetVariableData (
- IN TCP4_SERVICE_DATA *Tcp4Service
- )
-{
- UINT32 NumConfiguredInstance;
- LIST_ENTRY *Entry;
- TCP_CB *TcpPcb;
- TCP4_PROTO_DATA *TcpProto;
- UINTN VariableDataSize;
- EFI_TCP4_VARIABLE_DATA *Tcp4VariableData;
- EFI_TCP4_SERVICE_POINT *Tcp4ServicePoint;
- CHAR16 *NewMacString;
- EFI_STATUS Status;
-
- NumConfiguredInstance = 0;
-
- //
- // Go through the running queue to count the instances.
- //
- NET_LIST_FOR_EACH (Entry, &mTcpRunQue) {
- TcpPcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
-
- TcpProto = (TCP4_PROTO_DATA *) TcpPcb->Sk->ProtoReserved;
-
- if (TcpProto->TcpService == Tcp4Service) {
- //
- // This tcp instance belongs to the Tcp4Service.
- //
- NumConfiguredInstance++;
- }
- }
-
- //
- // Go through the listening queue to count the instances.
- //
- NET_LIST_FOR_EACH (Entry, &mTcpListenQue) {
- TcpPcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
-
- TcpProto = (TCP4_PROTO_DATA *) TcpPcb->Sk->ProtoReserved;
-
- if (TcpProto->TcpService == Tcp4Service) {
- //
- // This tcp instance belongs to the Tcp4Service.
- //
- NumConfiguredInstance++;
- }
- }
-
- //
- // Calculate the size of the Tcp4VariableData. As there may be no Tcp4 child,
- // we should add extra buffer for the service points only if the number of configured
- // children is more than 1.
- //
- VariableDataSize = sizeof (EFI_TCP4_VARIABLE_DATA);
-
- if (NumConfiguredInstance > 1) {
- VariableDataSize += sizeof (EFI_TCP4_SERVICE_POINT) * (NumConfiguredInstance - 1);
- }
-
- Tcp4VariableData = AllocatePool (VariableDataSize);
- if (Tcp4VariableData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Tcp4VariableData->DriverHandle = Tcp4Service->DriverBindingHandle;
- Tcp4VariableData->ServiceCount = NumConfiguredInstance;
-
- Tcp4ServicePoint = &Tcp4VariableData->Services[0];
-
- //
- // Go through the running queue to fill the service points.
- //
- NET_LIST_FOR_EACH (Entry, &mTcpRunQue) {
- TcpPcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
-
- TcpProto = (TCP4_PROTO_DATA *) TcpPcb->Sk->ProtoReserved;
-
- if (TcpProto->TcpService == Tcp4Service) {
- //
- // This tcp instance belongs to the Tcp4Service.
- //
- Tcp4ServicePoint->InstanceHandle = TcpPcb->Sk->SockHandle;
- CopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
- Tcp4ServicePoint->LocalPort = NTOHS (TcpPcb->LocalEnd.Port);
- CopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
- Tcp4ServicePoint->RemotePort = NTOHS (TcpPcb->RemoteEnd.Port);
-
- Tcp4ServicePoint++;
- }
- }
-
- //
- // Go through the listening queue to fill the service points.
- //
- NET_LIST_FOR_EACH (Entry, &mTcpListenQue) {
- TcpPcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
-
- TcpProto = (TCP4_PROTO_DATA *) TcpPcb->Sk->ProtoReserved;
-
- if (TcpProto->TcpService == Tcp4Service) {
- //
- // This tcp instance belongs to the Tcp4Service.
- //
- Tcp4ServicePoint->InstanceHandle = TcpPcb->Sk->SockHandle;
- CopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
- Tcp4ServicePoint->LocalPort = NTOHS (TcpPcb->LocalEnd.Port);
- CopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
- Tcp4ServicePoint->RemotePort = NTOHS (TcpPcb->RemoteEnd.Port);
-
- Tcp4ServicePoint++;
- }
- }
-
- //
- // Get the mac string.
- //
- Status = NetLibGetMacString (
- Tcp4Service->ControllerHandle,
- Tcp4Service->DriverBindingHandle,
- &NewMacString
- );
- if (EFI_ERROR (Status)) {
- goto ON_ERROR;
- }
-
- if (Tcp4Service->MacString != NULL) {
- //
- // The variable is set already, we're going to update it.
- //
- if (StrCmp (Tcp4Service->MacString, NewMacString) != 0) {
- //
- // The mac address is changed, delete the previous variable first.
- //
- gRT->SetVariable (
- Tcp4Service->MacString,
- &gEfiTcp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
- }
-
- FreePool (Tcp4Service->MacString);
- }
-
- Tcp4Service->MacString = NewMacString;
-
- Status = gRT->SetVariable (
- Tcp4Service->MacString,
- &gEfiTcp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- VariableDataSize,
- (VOID *) Tcp4VariableData
- );
-
-ON_ERROR:
-
- FreePool (Tcp4VariableData);
-
- return Status;
-}
-
-
-/**
- Clear the variable and free the resource.
-
- @param Tcp4Service Pointer to Tcp4 service data.
-
-**/
-VOID
-TcpClearVariableData (
- IN TCP4_SERVICE_DATA *Tcp4Service
- )
-{
- ASSERT (Tcp4Service->MacString != NULL);
-
- gRT->SetVariable (
- Tcp4Service->MacString,
- &gEfiTcp4ServiceBindingProtocolGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
-
- FreePool (Tcp4Service->MacString);
- Tcp4Service->MacString = NULL;
-}
-
/**
Install the device path protocol on the TCP instance.
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
index 34e15da432..faf9ca5e28 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
@@ -1,6 +1,6 @@
/** @file
-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
@@ -181,8 +181,6 @@ Udp4DriverBindingStart (
if (EFI_ERROR (Status)) {
Udp4CleanService (Udp4Service);
FreePool (Udp4Service);
- } else {
- Udp4SetVariableData (Udp4Service);
}
return Status;
@@ -268,9 +266,7 @@ Udp4DriverBindingStop (
&Udp4Service->ServiceBinding,
NULL
);
-
- Udp4ClearVariableData (Udp4Service);
-
+
Udp4CleanService (Udp4Service);
if (gUdpControllerNameTable != NULL) {
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
index 8bba3572a2..ce952b1e2d 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
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
index 8142a4640f..31edfbda43 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
@@ -1,7 +1,7 @@
/** @file
EFI UDPv4 protocol implementation.
-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
@@ -72,8 +72,6 @@ typedef struct _UDP4_SERVICE_DATA_ {
IP_IO *IpIo;
EFI_EVENT TimeoutEvent;
-
- CHAR16 *MacString;
} UDP4_SERVICE_DATA;
#define UDP4_INSTANCE_DATA_SIGNATURE SIGNATURE_32('U', 'd', 'p', 'I')
@@ -693,33 +691,5 @@ EFIAPI
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
- );
-
-/**
- Clear the variable and free the resource.
-
- @param[[in] Udp4Service Udp4 service data.
-
-**/
-VOID
-Udp4ClearVariableData (
- IN UDP4_SERVICE_DATA *Udp4Service
- );
-
+
#endif
-
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
index db1c4fdb87..d33402078f 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2009, 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
@@ -280,9 +280,7 @@ Udp4Configure (
ASSERT (IsListEmpty (&Instance->DeliveredDgramQue));
}
-
- Udp4SetVariableData (Instance->Udp4Service);
-
+
ON_EXIT:
gBS->RestoreTPL (OldTpl);