]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Impl.c
index 2026bcc7d4d3444003b3660c52d0a26c6dd4d4ad..37e2114d01c90ab21fd45fcefe37f04758629439 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2005 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2010, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -9,30 +9,24 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-\r
-Module Name:\r
-\r
-  Ip4Impl.c\r
-\r
-Abstract:\r
-\r
-\r
 **/\r
 \r
 #include "Ip4Impl.h"\r
 \r
+EFI_IPSEC_PROTOCOL    *mIpSec = NULL;\r
+\r
 /**\r
   Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.\r
-  \r
+\r
   The GetModeData() function returns the current operational mode data for this\r
   driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This\r
   function is used optionally to retrieve the operational mode data of underlying\r
   networks or drivers.\r
 \r
-  @param  This          Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Ip4ModeData   Pointer to the EFI IPv4 Protocol mode data structure.\r
-  @param  MnpConfigData Pointer to the managed network configuration data structure.\r
-  @param  SnpModeData   Pointer to the simple network mode data structure.\r
+  @param[in]   This          Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[out]  Ip4ModeData   Pointer to the EFI IPv4 Protocol mode data structure.\r
+  @param[out]  MnpConfigData Pointer to the managed network configuration data structure.\r
+  @param[out]  SnpModeData   Pointer to the simple network mode data structure.\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -43,14 +37,14 @@ EFI_STATUS
 EFIAPI\r
 EfiIp4GetModeData (\r
   IN  CONST EFI_IP4_PROTOCOL                *This,\r
-  OUT       EFI_IP4_MODE_DATA               *Ip4ModeData,    OPTIONAL\r
-  OUT       EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData,  OPTIONAL\r
+  OUT       EFI_IP4_MODE_DATA               *Ip4ModeData     OPTIONAL,\r
+  OUT       EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData   OPTIONAL,\r
   OUT       EFI_SIMPLE_NETWORK_MODE         *SnpModeData     OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.\r
-  \r
+\r
   The Configure() function is used to set, change, or reset the operational\r
   parameters and filter settings for this EFI IPv4 Protocol instance. Until these\r
   parameters have been set, no network traffic can be sent or received by this\r
@@ -59,20 +53,20 @@ EfiIp4GetModeData (
   parameters have been set again. Each EFI IPv4 Protocol instance can be started\r
   and stopped independently of each other by enabling or disabling their receive\r
   filter settings with the Configure() function.\r
-  \r
+\r
   When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will\r
   be appended as an alias address into the addresses list in the EFI IPv4 Protocol\r
   driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL\r
   to retrieve the default IPv4 address if it is not available yet. Clients could\r
   frequently call GetModeData() to check the status to ensure that the default IPv4\r
   address is ready.\r
-  \r
+\r
   If operational parameters are reset or changed, any pending transmit and receive\r
   requests will be cancelled. Their completion token status will be set to EFI_ABORTED\r
   and their events will be signaled.\r
 \r
-  @param  This         Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  IpConfigData Pointer to the EFI IPv4 Protocol configuration data structure.\r
+  @param[in]  This              Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  IpConfigData      Pointer to the EFI IPv4 Protocol configuration data structure.\r
 \r
   @retval EFI_SUCCESS           The driver instance was successfully opened.\r
   @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
@@ -97,19 +91,19 @@ EfiIp4Configure (
   IN EFI_IP4_PROTOCOL       *This,\r
   IN EFI_IP4_CONFIG_DATA    *IpConfigData       OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Joins and leaves multicast groups.\r
-  \r
+\r
   The Groups() function is used to join and leave multicast group sessions. Joining\r
   a group will enable reception of matching multicast packets. Leaving a group will\r
   disable the multicast packet reception.\r
-  \r
+\r
   If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r
 \r
-  @param  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  JoinFlag              Set to TRUE to join the multicast group session and FALSE to leave.\r
-  @param  GroupAddress          Pointer to the IPv4 multicast address.\r
+  @param[in]  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  JoinFlag              Set to TRUE to join the multicast group session and FALSE to leave.\r
+  @param[in]  GroupAddress          Pointer to the IPv4 multicast address.\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
   @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:\r
@@ -135,38 +129,38 @@ EfiIp4Groups (
   IN BOOLEAN                JoinFlag,\r
   IN EFI_IPv4_ADDRESS       *GroupAddress     OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Adds and deletes routing table entries.\r
 \r
   The Routes() function adds a route to or deletes a route from the routing table.\r
-  \r
+\r
   Routes are determined by comparing the SubnetAddress with the destination IPv4\r
   address arithmetically AND-ed with the SubnetMask. The gateway address must be\r
   on the same subnet as the configured station address.\r
-  \r
+\r
   The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.\r
   The default route matches all destination IPv4 addresses that do not match any\r
   other routes.\r
-  \r
+\r
   A GatewayAddress that is zero is a nonroute. Packets are sent to the destination\r
   IP address if it can be found in the ARP cache or on the local subnet. One automatic\r
   nonroute entry will be inserted into the routing table for outgoing packets that\r
   are addressed to a local subnet (gateway address of 0.0.0.0).\r
-  \r
+\r
   Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI\r
   IPv4 Protocol instances that use the default IPv4 address will also have copies\r
   of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these\r
   copies will be updated whenever the EIF IPv4 Protocol driver reconfigures its\r
   instances. As a result, client modification to the routing table will be lost.\r
 \r
-  @param  This                   Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  DeleteRoute            Set to TRUE to delete this route from the routing table. Set to\r
-                                 FALSE to add this route to the routing table. SubnetAddress\r
-                                 and SubnetMask are used as the key to each route entry.\r
-  @param  SubnetAddress          The address of the subnet that needs to be routed.\r
-  @param  SubnetMask             The subnet mask of SubnetAddress.\r
-  @param  GatewayAddress         The unicast gateway IPv4 address for this route.\r
+  @param[in]  This                   Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  DeleteRoute            Set to TRUE to delete this route from the routing table. Set to\r
+                                     FALSE to add this route to the routing table. SubnetAddress\r
+                                     and SubnetMask are used as the key to each route entry.\r
+  @param[in]  SubnetAddress          The address of the subnet that needs to be routed.\r
+  @param[in]  SubnetMask             The subnet mask of SubnetAddress.\r
+  @param[in]  GatewayAddress         The unicast gateway IPv4 address for this route.\r
 \r
   @retval EFI_SUCCESS            The operation completed successfully.\r
   @retval EFI_NOT_STARTED        The driver instance has not been started.\r
@@ -184,7 +178,7 @@ EfiIp4Groups (
   @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
   @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
                                   DeleteRoute is FALSE).\r
-                                 \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -195,7 +189,7 @@ EfiIp4Routes (
   IN EFI_IPv4_ADDRESS       *SubnetMask,\r
   IN EFI_IPv4_ADDRESS       *GatewayAddress\r
   );\r
-  \r
+\r
 /**\r
   Places outgoing data packets into the transmit queue.\r
 \r
@@ -203,8 +197,8 @@ EfiIp4Routes (
   EFI IPv4 Protocol instance. Whenever the packet in the token is sent out or some\r
   errors occur, the event in the token will be signaled and the status is updated.\r
 \r
-  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Token Pointer to the transmit token.\r
+  @param[in]  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  Token Pointer to the transmit token.\r
 \r
   @retval  EFI_SUCCESS           The data has been queued for transmission.\r
   @retval  EFI_NOT_STARTED       This instance has not been started.\r
@@ -214,7 +208,7 @@ EfiIp4Routes (
   @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
                                  was already in the transmit queue.\r
   @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
-                                 queue is full. \r
+                                 queue is full.\r
   @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
   @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
   @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
@@ -231,20 +225,20 @@ EfiIp4Transmit (
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token\r
   );\r
-  \r
+\r
 /**\r
   Places a receiving request into the receiving queue.\r
-  \r
+\r
   The Receive() function places a completion token into the receive packet queue.\r
   This function is always asynchronous.\r
-  \r
+\r
   The Token.Event field in the completion token must be filled in by the caller\r
   and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol\r
   driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r
   is signaled.\r
 \r
-  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that is associated with the receive data descriptor.\r
+  @param[in]  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  Token Pointer to a token that is associated with the receive data descriptor.\r
 \r
   @retval EFI_SUCCESS           The receive completion token was cached.\r
   @retval EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.\r
@@ -270,10 +264,10 @@ EfiIp4Receive (
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token\r
   );\r
-  \r
+\r
 /**\r
   Abort an asynchronous transmit or receive request.\r
-  \r
+\r
   The Cancel() function is used to abort a pending transmit or receive request.\r
   If the token is in the transmit or receive request queues, after calling this\r
   function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r
@@ -281,12 +275,12 @@ EfiIp4Receive (
   asynchronous operation has completed, this function will not signal the token\r
   and EFI_NOT_FOUND is returned.\r
 \r
-  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that has been issued by\r
-                EFI_IP4_PROTOCOL.Transmit() or\r
-                EFI_IP4_PROTOCOL.Receive(). If NULL, all pending\r
-                tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is\r
-                defined in EFI_IP4_PROTOCOL.Transmit().\r
+  @param[in]  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  Token Pointer to a token that has been issued by\r
+                    EFI_IP4_PROTOCOL.Transmit() or\r
+                    EFI_IP4_PROTOCOL.Receive(). If NULL, all pending\r
+                    tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is\r
+                    defined in EFI_IP4_PROTOCOL.Transmit().\r
 \r
   @retval EFI_SUCCESS           The asynchronous I/O request was aborted and\r
                                 Token.->Event was signaled. When Token is NULL, all\r
@@ -306,22 +300,22 @@ EfiIp4Cancel (
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token    OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Polls for incoming data packets and processes outgoing data packets.\r
-  \r
+\r
   The Poll() function polls for incoming data packets and processes outgoing data\r
   packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()\r
   function to increase the rate that data packets are moved between the communications\r
   device and the transmit and receive queues.\r
-  \r
+\r
   In some systems the periodic timer event may not poll the underlying communications\r
   device fast enough to transmit and/or receive all data packets without missing\r
   incoming packets or dropping outgoing packets. Drivers and applications that are\r
   experiencing packet loss should try calling the EFI_IP4_PROTOCOL.Poll() function\r
   more often.\r
 \r
-  @param  This Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  This               Pointer to the EFI_IP4_PROTOCOL instance.\r
 \r
   @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
   @retval  EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.\r
@@ -354,16 +348,16 @@ mEfiIp4ProtocolTemplete = {
 \r
 /**\r
   Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.\r
-  \r
+\r
   The GetModeData() function returns the current operational mode data for this\r
   driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This\r
   function is used optionally to retrieve the operational mode data of underlying\r
   networks or drivers.\r
 \r
-  @param  This          Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Ip4ModeData   Pointer to the EFI IPv4 Protocol mode data structure.\r
-  @param  MnpConfigData Pointer to the managed network configuration data structure.\r
-  @param  SnpModeData   Pointer to the simple network mode data structure.\r
+  @param[in]   This          Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[out]  Ip4ModeData   Pointer to the EFI IPv4 Protocol mode data structure.\r
+  @param[out]  MnpConfigData Pointer to the managed network configuration data structure.\r
+  @param[out]  SnpModeData   Pointer to the simple network mode data structure.\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -374,8 +368,8 @@ EFI_STATUS
 EFIAPI\r
 EfiIp4GetModeData (\r
   IN  CONST EFI_IP4_PROTOCOL                *This,\r
-  OUT       EFI_IP4_MODE_DATA               *Ip4ModeData,    OPTIONAL\r
-  OUT       EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData,  OPTIONAL\r
+  OUT       EFI_IP4_MODE_DATA               *Ip4ModeData     OPTIONAL,\r
+  OUT       EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData   OPTIONAL,\r
   OUT       EFI_SIMPLE_NETWORK_MODE         *SnpModeData     OPTIONAL\r
   )\r
 {\r
@@ -412,6 +406,8 @@ EfiIp4GetModeData (
     Ip4ModeData->RouteTable    = NULL;\r
     Ip4ModeData->RouteCount    = 0;\r
 \r
+    Ip4ModeData->MaxPacketSize = IpSb->MaxPacketSize;\r
+\r
     //\r
     // return the current station address for this IP child. So,\r
     // the user can get the default address through this. Some\r
@@ -444,16 +440,13 @@ EfiIp4GetModeData (
     }\r
   }\r
 \r
-  if (MnpConfigData != NULL) {\r
-    CopyMem (MnpConfigData, &IpSb->MnpConfigData, sizeof (*MnpConfigData));\r
-  }\r
-\r
-  if (SnpModeData != NULL) {\r
-    CopyMem (SnpModeData, &IpSb->SnpMode, sizeof (*SnpModeData));\r
-  }\r
+  //\r
+  // Get fresh mode data from MNP, since underlying media status may change\r
+  //\r
+  Status = IpSb->Mnp->GetModeData (IpSb->Mnp, MnpConfigData, SnpModeData);\r
 \r
   gBS->RestoreTPL (OldTpl);\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 \r
@@ -468,8 +461,8 @@ EfiIp4GetModeData (
   reconfigure the MNP. If Force is TRUE, the MNP is configured no\r
   matter whether that is changed or not.\r
 \r
-  @param  IpSb                   The IP4 service instance that is to be changed.\r
-  @param  Force                  Force the configuration or not.\r
+  @param[in]  IpSb               The IP4 service instance that is to be changed.\r
+  @param[in]  Force              Force the configuration or not.\r
 \r
   @retval EFI_SUCCESS            The MNP is successfully configured/reconfigured.\r
   @retval Others                 Configuration failed.\r
@@ -547,9 +540,7 @@ Ip4ServiceConfigMnp (
   it will configure the default interface and default route table\r
   with the configuration information retrieved by IP4_CONFIGURE.\r
 \r
-  @param  Context                The IP4 service binding instance.\r
-\r
-  @return None\r
+  @param[in]  Context                The IP4 service binding instance.\r
 \r
 **/\r
 VOID\r
@@ -567,6 +558,10 @@ Ip4AutoConfigCallBackDpc (
   EFI_STATUS                Status;\r
   UINTN                     Len;\r
   UINT32                    Index;\r
+  IP4_ADDR                  StationAddress;\r
+  IP4_ADDR                  SubnetMask;\r
+  IP4_ADDR                  SubnetAddress;\r
+  IP4_ADDR                  GatewayAddress;\r
 \r
   IpSb      = (IP4_SERVICE *) Context;\r
   NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE);\r
@@ -652,11 +647,9 @@ Ip4AutoConfigCallBackDpc (
   // Set the default interface's address, then add a directed\r
   // route for it, that is, the route whose nexthop is zero.\r
   //\r
-  Status = Ip4SetAddress (\r
-             IpIf,\r
-             EFI_NTOHL (Data->StationAddress),\r
-             EFI_NTOHL (Data->SubnetMask)\r
-             );\r
+  StationAddress = EFI_NTOHL (Data->StationAddress);\r
+  SubnetMask = EFI_NTOHL (Data->SubnetMask);\r
+  Status = Ip4SetAddress (IpIf, StationAddress, SubnetMask);\r
 \r
   if (EFI_ERROR (Status)) {\r
     goto ON_EXIT;\r
@@ -664,8 +657,8 @@ Ip4AutoConfigCallBackDpc (
 \r
   Ip4AddRoute (\r
     IpSb->DefaultRouteTable,\r
-    EFI_NTOHL (Data->StationAddress),\r
-    EFI_NTOHL (Data->SubnetMask),\r
+    StationAddress,\r
+    SubnetMask,\r
     IP4_ALLZERO_ADDRESS\r
     );\r
 \r
@@ -675,12 +668,10 @@ Ip4AutoConfigCallBackDpc (
   for (Index = 0; Index < Data->RouteTableSize; Index++) {\r
     RouteEntry = &Data->RouteTable[Index];\r
 \r
-    Ip4AddRoute (\r
-      IpSb->DefaultRouteTable,\r
-      EFI_NTOHL (RouteEntry->SubnetAddress),\r
-      EFI_NTOHL (RouteEntry->SubnetMask),\r
-      EFI_NTOHL (RouteEntry->GatewayAddress)\r
-      );\r
+    SubnetAddress = EFI_NTOHL (RouteEntry->SubnetAddress);\r
+    SubnetMask = EFI_NTOHL (RouteEntry->SubnetMask);\r
+    GatewayAddress = EFI_NTOHL (RouteEntry->GatewayAddress);\r
+    Ip4AddRoute (IpSb->DefaultRouteTable, SubnetAddress, SubnetMask, GatewayAddress);\r
   }\r
 \r
   IpSb->State = IP4_SERVICE_CONFIGED;\r
@@ -688,18 +679,16 @@ Ip4AutoConfigCallBackDpc (
   Ip4SetVariableData (IpSb);\r
 \r
 ON_EXIT:\r
-  gBS->FreePool (Data);\r
+  FreePool (Data);\r
 }\r
 \r
-/*++\r
+/**\r
   Request Ip4AutoConfigCallBackDpc as a DPC at TPL_CALLBACK.\r
-  \r
+\r
   @param Event     The event that is signalled.\r
   @param Context   The IP4 service binding instance.\r
-  \r
-  @return None.\r
 \r
-++*/\r
+**/\r
 VOID\r
 EFIAPI\r
 Ip4AutoConfigCallBack (\r
@@ -715,7 +704,7 @@ Ip4AutoConfigCallBack (
   //\r
   // Request Ip4AutoConfigCallBackDpc as a DPC at TPL_CALLBACK\r
   //\r
-  NetLibQueueDpc (TPL_CALLBACK, Ip4AutoConfigCallBackDpc, Context);\r
+  QueueDpc (TPL_CALLBACK, Ip4AutoConfigCallBackDpc, Context);\r
 }\r
 \r
 \r
@@ -724,7 +713,7 @@ Ip4AutoConfigCallBack (
   It will locates the EFI_IP4_CONFIG_PROTOCOL, then start the\r
   auto configuration.\r
 \r
-  @param  IpSb                   The IP4 service instance to configure\r
+  @param[in]  IpSb               The IP4 service instance to configure\r
 \r
   @retval EFI_SUCCESS            The auto configuration is successfull started\r
   @retval Others                 Failed to start auto configuration.\r
@@ -821,8 +810,6 @@ CLOSE_DONE_EVENT:
   @param  IpSb                   The IP4 service instance.\r
   @param  IpInstance             The IP4 child instance.\r
 \r
-  @return None\r
-\r
 **/\r
 VOID\r
 Ip4InitProtocol (\r
@@ -856,8 +843,8 @@ Ip4InitProtocol (
   for the first time. The caller should validate the configuration\r
   before deliver them to it. It also don't do configure NULL.\r
 \r
-  @param  IpInstance             The IP4 child to configure.\r
-  @param  Config                 The configure data.\r
+  @param[in, out]  IpInstance         The IP4 child to configure.\r
+  @param[in]       Config             The configure data.\r
 \r
   @retval EFI_SUCCESS            The IP4 child is successfully configured.\r
   @retval EFI_DEVICE_ERROR       Failed to free the pending transive or to\r
@@ -1011,7 +998,7 @@ ON_ERROR:
 /**\r
   Clean up the IP4 child, release all the resources used by it.\r
 \r
-  @param  IpInstance             The IP4 child to clean up.\r
+  @param[in]  IpInstance         The IP4 child to clean up.\r
 \r
   @retval EFI_SUCCESS            The IP4 child is cleaned up\r
   @retval EFI_DEVICE_ERROR       Some resources failed to be released\r
@@ -1055,13 +1042,13 @@ Ip4CleanProtocol (
   }\r
 \r
   if (IpInstance->EfiRouteTable != NULL) {\r
-    gBS->FreePool (IpInstance->EfiRouteTable);\r
+    FreePool (IpInstance->EfiRouteTable);\r
     IpInstance->EfiRouteTable = NULL;\r
     IpInstance->EfiRouteCount = 0;\r
   }\r
 \r
   if (IpInstance->Groups != NULL) {\r
-    gBS->FreePool (IpInstance->Groups);\r
+    FreePool (IpInstance->Groups);\r
     IpInstance->Groups      = NULL;\r
     IpInstance->GroupCount  = 0;\r
   }\r
@@ -1079,8 +1066,8 @@ Ip4CleanProtocol (
   address. Only continuous netmasks are supported. and check\r
   that StationAddress is a unicast address on the newtwork.\r
 \r
-  @param  Ip                     The IP address to validate\r
-  @param  Netmask                The netmaks of the IP\r
+  @param[in]  Ip                 The IP address to validate\r
+  @param[in]  Netmask            The netmaks of the IP\r
 \r
   @retval TRUE                   The Ip/Netmask pair is valid\r
   @retval FALSE                  The Ip/Netmask pair is invalid\r
@@ -1136,7 +1123,7 @@ Ip4StationAddressValid (
 \r
 /**\r
   Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.\r
-  \r
+\r
   The Configure() function is used to set, change, or reset the operational\r
   parameters and filter settings for this EFI IPv4 Protocol instance. Until these\r
   parameters have been set, no network traffic can be sent or received by this\r
@@ -1145,20 +1132,20 @@ Ip4StationAddressValid (
   parameters have been set again. Each EFI IPv4 Protocol instance can be started\r
   and stopped independently of each other by enabling or disabling their receive\r
   filter settings with the Configure() function.\r
-  \r
+\r
   When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will\r
   be appended as an alias address into the addresses list in the EFI IPv4 Protocol\r
   driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL\r
   to retrieve the default IPv4 address if it is not available yet. Clients could\r
   frequently call GetModeData() to check the status to ensure that the default IPv4\r
   address is ready.\r
-  \r
+\r
   If operational parameters are reset or changed, any pending transmit and receive\r
   requests will be cancelled. Their completion token status will be set to EFI_ABORTED\r
   and their events will be signaled.\r
 \r
-  @param  This         Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  IpConfigData Pointer to the EFI IPv4 Protocol configuration data structure.\r
+  @param[in]  This              Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  IpConfigData      Pointer to the EFI IPv4 Protocol configuration data structure.\r
 \r
   @retval EFI_SUCCESS           The driver instance was successfully opened.\r
   @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
@@ -1300,9 +1287,9 @@ ON_EXIT:
   Change the IP4 child's multicast setting. The caller\r
   should make sure that the parameters is valid.\r
 \r
-  @param  IpInstance             The IP4 child to change the setting.\r
-  @param  JoinFlag               TRUE to join the group, otherwise leave it\r
-  @param  GroupAddress           The target group address\r
+  @param[in]  IpInstance             The IP4 child to change the setting.\r
+  @param[in]  JoinFlag               TRUE to join the group, otherwise leave it\r
+  @param[in]  GroupAddress           The target group address\r
 \r
   @retval EFI_ALREADY_STARTED    Want to join the group, but already a member of it\r
   @retval EFI_OUT_OF_RESOURCES   Failed to allocate some resources.\r
@@ -1328,6 +1315,10 @@ Ip4Groups (
   // host byte order\r
   //\r
   if (JoinFlag) {\r
+    //\r
+    // When JoinFlag is TRUE, GroupAddress shouldn't be NULL.\r
+    //\r
+    ASSERT (GroupAddress != NULL);\r
     CopyMem (&Group, GroupAddress, sizeof (IP4_ADDR));\r
 \r
     for (Index = 0; Index < IpInstance->GroupCount; Index++) {\r
@@ -1343,12 +1334,12 @@ Ip4Groups (
     }\r
 \r
     if (EFI_ERROR (Ip4JoinGroup (IpInstance, NTOHL (Group)))) {\r
-      gBS->FreePool (Members);\r
+      FreePool (Members);\r
       return EFI_DEVICE_ERROR;\r
     }\r
 \r
     if (IpInstance->Groups != NULL) {\r
-      gBS->FreePool (IpInstance->Groups);\r
+      FreePool (IpInstance->Groups);\r
     }\r
 \r
     IpInstance->Groups = Members;\r
@@ -1376,7 +1367,7 @@ Ip4Groups (
       if (IpInstance->GroupCount == 0) {\r
         ASSERT (Index == 1);\r
 \r
-        gBS->FreePool (IpInstance->Groups);\r
+        FreePool (IpInstance->Groups);\r
         IpInstance->Groups = NULL;\r
       }\r
 \r
@@ -1392,16 +1383,16 @@ Ip4Groups (
 \r
 /**\r
   Joins and leaves multicast groups.\r
-  \r
+\r
   The Groups() function is used to join and leave multicast group sessions. Joining\r
   a group will enable reception of matching multicast packets. Leaving a group will\r
   disable the multicast packet reception.\r
-  \r
+\r
   If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r
 \r
-  @param  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  JoinFlag              Set to TRUE to join the multicast group session and FALSE to leave.\r
-  @param  GroupAddress          Pointer to the IPv4 multicast address.\r
+  @param[in]  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  JoinFlag              Set to TRUE to join the multicast group session and FALSE to leave.\r
+  @param[in]  GroupAddress          Pointer to the IPv4 multicast address.\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
   @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:\r
@@ -1470,33 +1461,33 @@ ON_EXIT:
   Adds and deletes routing table entries.\r
 \r
   The Routes() function adds a route to or deletes a route from the routing table.\r
-  \r
+\r
   Routes are determined by comparing the SubnetAddress with the destination IPv4\r
   address arithmetically AND-ed with the SubnetMask. The gateway address must be\r
   on the same subnet as the configured station address.\r
-  \r
+\r
   The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.\r
   The default route matches all destination IPv4 addresses that do not match any\r
   other routes.\r
-  \r
+\r
   A GatewayAddress that is zero is a nonroute. Packets are sent to the destination\r
   IP address if it can be found in the ARP cache or on the local subnet. One automatic\r
   nonroute entry will be inserted into the routing table for outgoing packets that\r
   are addressed to a local subnet (gateway address of 0.0.0.0).\r
-  \r
+\r
   Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI\r
   IPv4 Protocol instances that use the default IPv4 address will also have copies\r
   of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these\r
   copies will be updated whenever the EIF IPv4 Protocol driver reconfigures its\r
   instances. As a result, client modification to the routing table will be lost.\r
 \r
-  @param  This                   Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  DeleteRoute            Set to TRUE to delete this route from the routing table. Set to\r
-                                 FALSE to add this route to the routing table. SubnetAddress\r
-                                 and SubnetMask are used as the key to each route entry.\r
-  @param  SubnetAddress          The address of the subnet that needs to be routed.\r
-  @param  SubnetMask             The subnet mask of SubnetAddress.\r
-  @param  GatewayAddress         The unicast gateway IPv4 address for this route.\r
+  @param[in]  This                   Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  DeleteRoute            Set to TRUE to delete this route from the routing table. Set to\r
+                                     FALSE to add this route to the routing table. SubnetAddress\r
+                                     and SubnetMask are used as the key to each route entry.\r
+  @param[in]  SubnetAddress          The address of the subnet that needs to be routed.\r
+  @param[in]  SubnetMask             The subnet mask of SubnetAddress.\r
+  @param[in]  GatewayAddress         The unicast gateway IPv4 address for this route.\r
 \r
   @retval EFI_SUCCESS            The operation completed successfully.\r
   @retval EFI_NOT_STARTED        The driver instance has not been started.\r
@@ -1514,7 +1505,7 @@ ON_EXIT:
   @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
   @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
                                   DeleteRoute is FALSE).\r
-                                 \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1597,10 +1588,10 @@ ON_EXIT:
   Check whether the user's token or event has already\r
   been enqueued on IP4's list.\r
 \r
-  @param  Map                    The container of either user's transmit or receive\r
-                                 token.\r
-  @param  Item                   Current item to check against\r
-  @param  Context                The Token to check againist.\r
+  @param[in]  Map                    The container of either user's transmit or receive\r
+                                     token.\r
+  @param[in]  Item                   Current item to check against\r
+  @param[in]  Context                The Token to check againist.\r
 \r
   @retval EFI_ACCESS_DENIED      The token or event has already been enqueued in IP\r
   @retval EFI_SUCCESS            The current item isn't the same token/event as the\r
@@ -1608,6 +1599,7 @@ ON_EXIT:
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 Ip4TokenExist (\r
   IN NET_MAP                *Map,\r
   IN NET_MAP_ITEM           *Item,\r
@@ -1631,8 +1623,8 @@ Ip4TokenExist (
 /**\r
   Validate the user's token against current station address.\r
 \r
-  @param  Token                  User's token to validate\r
-  @param  IpIf                   The IP4 child's interface.\r
+  @param[in]  Token                  User's token to validate\r
+  @param[in]  IpIf                   The IP4 child's interface.\r
 \r
   @retval EFI_INVALID_PARAMETER  Some parameters are invalid\r
   @retval EFI_BAD_BUFFER_SIZE    The user's option/data is too long.\r
@@ -1699,7 +1691,7 @@ Ip4TxTokenValid (
   // Check the source and gateway: they must be a valid unicast.\r
   // Gateway must also be on the connected network.\r
   //\r
-  if (TxData->OverrideData) {\r
+  if (TxData->OverrideData != NULL) {\r
     Override = TxData->OverrideData;\r
 \r
     CopyMem (&Src, &Override->SourceAddress, sizeof (IP4_ADDR));\r
@@ -1761,12 +1753,11 @@ Ip4TxTokenValid (
   are bound together. Check the comments in Ip4Output for information\r
   about IP fragmentation.\r
 \r
-  @param  Context                The token's wrap\r
-\r
-  @return None\r
+  @param[in]  Context                The token's wrap\r
 \r
 **/\r
 VOID\r
+EFIAPI\r
 Ip4FreeTxToken (\r
   IN VOID                   *Context\r
   )\r
@@ -1776,6 +1767,13 @@ Ip4FreeTxToken (
 \r
   Wrap = (IP4_TXTOKEN_WRAP *) Context;\r
 \r
+  //\r
+  // Signal IpSecRecycleEvent to inform IPsec free the memory\r
+  //\r
+  if (Wrap->IpSecRecycleSignal != NULL) {\r
+    gBS->SignalEvent (Wrap->IpSecRecycleSignal);\r
+  }\r
+\r
   //\r
   // Find the token in the instance's map. EfiIp4Transmit put the\r
   // token to the map. If that failed, NetMapFindKey will return NULL.\r
@@ -1792,10 +1790,10 @@ Ip4FreeTxToken (
     //\r
     // Dispatch the DPC queued by the NotifyFunction of Token->Event.\r
     //\r
-    NetLibDispatchDpc ();\r
+    DispatchDpc ();\r
   }\r
 \r
-  gBS->FreePool (Wrap);\r
+  FreePool (Wrap);\r
 }\r
 \r
 \r
@@ -1808,8 +1806,6 @@ Ip4FreeTxToken (
   @param  Flag                   Not used during transmission\r
   @param  Context                The token's wrap.\r
 \r
-  @return None\r
-\r
 **/\r
 VOID\r
 Ip4OnPacketSent (\r
@@ -1849,8 +1845,8 @@ Ip4OnPacketSent (
   EFI IPv4 Protocol instance. Whenever the packet in the token is sent out or some\r
   errors occur, the event in the token will be signaled and the status is updated.\r
 \r
-  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Token Pointer to the transmit token.\r
+  @param[in]  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  Token Pointer to the transmit token.\r
 \r
   @retval  EFI_SUCCESS           The data has been queued for transmission.\r
   @retval  EFI_NOT_STARTED       This instance has not been started.\r
@@ -1860,7 +1856,7 @@ Ip4OnPacketSent (
   @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
                                  was already in the transmit queue.\r
   @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
-                                 queue is full. \r
+                                 queue is full.\r
   @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
   @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
   @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
@@ -1939,7 +1935,7 @@ EfiIp4Transmit (
   CopyMem (&Head.Dst, &TxData->DestinationAddress, sizeof (IP4_ADDR));\r
   Head.Dst = NTOHL (Head.Dst);\r
 \r
-  if (TxData->OverrideData) {\r
+  if (TxData->OverrideData != NULL) {\r
     Override      = TxData->OverrideData;\r
     Head.Protocol = Override->Protocol;\r
     Head.Tos      = Override->TypeOfService;\r
@@ -1961,12 +1957,12 @@ EfiIp4Transmit (
   }\r
 \r
   Head.Fragment = IP4_HEAD_FRAGMENT_FIELD (DontFragment, FALSE, 0);\r
-  HeadLen       = sizeof (IP4_HEAD) + ((TxData->OptionsLength + 3) &~0x03);\r
+  HeadLen       = (TxData->OptionsLength + 3) & (~0x03);\r
 \r
   //\r
   // If don't fragment and fragment needed, return error\r
   //\r
-  if (DontFragment && (TxData->TotalDataLength + HeadLen > IpSb->SnpMode.MaxPacketSize)) {\r
+  if (DontFragment && (TxData->TotalDataLength + HeadLen > IpSb->MaxPacketSize)) {\r
     Status = EFI_BAD_BUFFER_SIZE;\r
     goto ON_EXIT;\r
   }\r
@@ -1976,7 +1972,7 @@ EfiIp4Transmit (
   // a IP4_TXTOKEN_WRAP and the data in a netbuf\r
   //\r
   Status = EFI_OUT_OF_RESOURCES;\r
-  Wrap   = AllocatePool (sizeof (IP4_TXTOKEN_WRAP));\r
+  Wrap   = AllocateZeroPool (sizeof (IP4_TXTOKEN_WRAP));\r
   if (Wrap == NULL) {\r
     goto ON_EXIT;\r
   }\r
@@ -1995,7 +1991,7 @@ EfiIp4Transmit (
                         );\r
 \r
   if (Wrap->Packet == NULL) {\r
-    gBS->FreePool (Wrap);\r
+    FreePool (Wrap);\r
     goto ON_EXIT;\r
   }\r
 \r
@@ -2042,17 +2038,17 @@ ON_EXIT:
 \r
 /**\r
   Places a receiving request into the receiving queue.\r
-  \r
+\r
   The Receive() function places a completion token into the receive packet queue.\r
   This function is always asynchronous.\r
-  \r
+\r
   The Token.Event field in the completion token must be filled in by the caller\r
   and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol\r
   driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r
   is signaled.\r
 \r
-  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that is associated with the receive data descriptor.\r
+  @param[in]  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  Token Pointer to a token that is associated with the receive data descriptor.\r
 \r
   @retval EFI_SUCCESS           The receive completion token was cached.\r
   @retval EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.\r
@@ -2124,7 +2120,7 @@ EfiIp4Receive (
   // Dispatch the DPC queued by the NotifyFunction of this instane's receive\r
   // event.\r
   //\r
-  NetLibDispatchDpc ();\r
+  DispatchDpc ();\r
 \r
 ON_EXIT:\r
   gBS->RestoreTPL (OldTpl);\r
@@ -2141,15 +2137,16 @@ ON_EXIT:
   Because Ip4CancelPacket and other functions are all called in\r
   line, so, after Ip4CancelPacket returns, the Item has been freed.\r
 \r
-  @param  Map                    The IP4 child's transmit queue\r
-  @param  Item                   The current transmitted packet to test.\r
-  @param  Context                The user's token to cancel.\r
+  @param[in]  Map                    The IP4 child's transmit queue\r
+  @param[in]  Item                   The current transmitted packet to test.\r
+  @param[in]  Context                The user's token to cancel.\r
 \r
   @retval EFI_SUCCESS            Continue to check the next Item.\r
   @retval EFI_ABORTED            The user's Token (Token != NULL) is cancelled.\r
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 Ip4CancelTxTokens (\r
   IN NET_MAP                *Map,\r
   IN NET_MAP_ITEM           *Item,\r
@@ -2194,9 +2191,9 @@ Ip4CancelTxTokens (
   Cancel the receive request. This is quiet simple, because\r
   it is only enqueued in our local receive map.\r
 \r
-  @param  Map                    The IP4 child's receive queue\r
-  @param  Item                   Current receive request to cancel.\r
-  @param  Context                The user's token to cancel\r
+  @param[in]  Map                    The IP4 child's receive queue\r
+  @param[in]  Item                   Current receive request to cancel.\r
+  @param[in]  Context                The user's token to cancel\r
 \r
   @retval EFI_SUCCESS            Continue to check the next receive request on the\r
                                  queue.\r
@@ -2205,6 +2202,7 @@ Ip4CancelTxTokens (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 Ip4CancelRxTokens (\r
   IN NET_MAP                *Map,\r
   IN NET_MAP_ITEM           *Item,\r
@@ -2238,8 +2236,8 @@ Ip4CancelRxTokens (
 /**\r
   Cancel the user's receive/transmit request.\r
 \r
-  @param  IpInstance             The IP4 child\r
-  @param  Token                  The token to cancel. If NULL, all token will be\r
+  @param[in]  IpInstance         The IP4 child\r
+  @param[in]  Token              The token to cancel. If NULL, all token will be\r
                                  cancelled.\r
 \r
   @retval EFI_SUCCESS            The token is cancelled\r
@@ -2280,7 +2278,7 @@ Ip4Cancel (
   // Dispatch the DPCs queued by the NotifyFunction of the canceled rx token's\r
   // events.\r
   //\r
-  NetLibDispatchDpc ();\r
+  DispatchDpc ();\r
   if (EFI_ERROR (Status)) {\r
     if ((Token != NULL) && (Status == EFI_ABORTED)) {\r
       return EFI_SUCCESS;\r
@@ -2313,7 +2311,7 @@ Ip4Cancel (
 \r
 /**\r
   Abort an asynchronous transmit or receive request.\r
-  \r
+\r
   The Cancel() function is used to abort a pending transmit or receive request.\r
   If the token is in the transmit or receive request queues, after calling this\r
   function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r
@@ -2321,12 +2319,12 @@ Ip4Cancel (
   asynchronous operation has completed, this function will not signal the token\r
   and EFI_NOT_FOUND is returned.\r
 \r
-  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that has been issued by\r
-                EFI_IP4_PROTOCOL.Transmit() or\r
-                EFI_IP4_PROTOCOL.Receive(). If NULL, all pending\r
-                tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is\r
-                defined in EFI_IP4_PROTOCOL.Transmit().\r
+  @param[in]  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  Token Pointer to a token that has been issued by\r
+                    EFI_IP4_PROTOCOL.Transmit() or\r
+                    EFI_IP4_PROTOCOL.Receive(). If NULL, all pending\r
+                    tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is\r
+                    defined in EFI_IP4_PROTOCOL.Transmit().\r
 \r
   @retval EFI_SUCCESS           The asynchronous I/O request was aborted and\r
                                 Token.->Event was signaled. When Token is NULL, all\r
@@ -2379,19 +2377,19 @@ ON_EXIT:
 \r
 /**\r
   Polls for incoming data packets and processes outgoing data packets.\r
-  \r
+\r
   The Poll() function polls for incoming data packets and processes outgoing data\r
   packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()\r
   function to increase the rate that data packets are moved between the communications\r
   device and the transmit and receive queues.\r
-  \r
+\r
   In some systems the periodic timer event may not poll the underlying communications\r
   device fast enough to transmit and/or receive all data packets without missing\r
   incoming packets or dropping outgoing packets. Drivers and applications that are\r
   experiencing packet loss should try calling the EFI_IP4_PROTOCOL.Poll() function\r
   more often.\r
 \r
-  @param  This Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param[in]  This               Pointer to the EFI_IP4_PROTOCOL instance.\r
 \r
   @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
   @retval  EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.\r
@@ -2439,14 +2437,15 @@ EfiIp4Poll (
   received-but-not-delivered and transmitted-but-not-recycle\r
   packets.\r
 \r
-  @param  Map                    The IP4 child's transmit map.\r
-  @param  Item                   Current transmitted packet\r
-  @param  Context                Not used.\r
+  @param[in]  Map                    The IP4 child's transmit map.\r
+  @param[in]  Item                   Current transmitted packet\r
+  @param[in]  Context                Not used.\r
 \r
   @retval EFI_SUCCESS            Always returns EFI_SUCCESS\r
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 Ip4SentPacketTicking (\r
   IN NET_MAP                *Map,\r
   IN NET_MAP_ITEM           *Item,\r
@@ -2472,10 +2471,8 @@ Ip4SentPacketTicking (
   transmitted-but-not-recycle packets, and provides time input\r
   for its IGMP protocol.\r
 \r
-  @param  Event                  The IP4 service instance's heart beat timer.\r
-  @param  Context                The IP4 service instance.\r
-\r
-  @return None\r
+  @param[in]  Event                  The IP4 service instance's heart beat timer.\r
+  @param[in]  Context                The IP4 service instance.\r
 \r
 **/\r
 VOID\r