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