]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
code scrub fix
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4If.c
index 1a47fa947884bcce6f73358fb0de840238d089c8..d5a46082277a1a0f01340fa40b98bb427345ccdc 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
-\r
-Copyright (c) 2005 - 2007, Intel Corporation\r
+  Implement IP4 pesudo interface.\r
+  \r
+Copyright (c) 2005 - 2007, Intel Corporation.<BR>\r
 All rights reserved. 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
@@ -9,16 +10,6 @@ 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
-  Ip4If.c\r
-\r
-Abstract:\r
-\r
-  Implement IP4 pesudo interface.\r
-\r
-\r
 **/\r
 \r
 #include "Ip4Impl.h"\r
@@ -33,9 +24,7 @@ EFI_MAC_ADDRESS  mZeroMacAddress;
   Callback funtion when frame transmission is finished. It will\r
   call the frame owner's callback function to tell it the result.\r
 \r
-  @param  Context               Context which is point to the token.\r
-\r
-  @return None.\r
+  @param[in]  Context            Context which is point to the token.\r
 \r
 **/\r
 VOID\r
@@ -47,10 +36,8 @@ Ip4OnFrameSentDpc (
 /**\r
   Request Ip4OnFrameSentDpc as a DPC at TPL_CALLBACK.\r
 \r
-  @param  Event                 The transmit token's event.\r
-  @param  Context               Context which is point to the token.\r
-\r
-  @return None\r
+  @param[in]  Event              The transmit token's event.\r
+  @param[in]  Context            Context which is point to the token.\r
 \r
 **/\r
 VOID\r
@@ -65,11 +52,9 @@ Ip4OnFrameSent (
   all the queued frame if the ARP requests failed. Or transmit them\r
   if the request succeed.\r
 \r
-  @param  Context               The context of the callback, a point to the ARP\r
+  @param[in]  Context           The context of the callback, a point to the ARP\r
                                 queue\r
 \r
-  @return None\r
-\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -80,12 +65,10 @@ Ip4OnArpResolvedDpc (
 /**\r
   Request Ip4OnArpResolvedDpc as a DPC at TPL_CALLBACK.\r
 \r
-  @param  Event                 The Arp request event.\r
-  @param  Context               The context of the callback, a point to the ARP\r
-                                queue.\r
-\r
-  @return None\r
-\r
+  @param  Event             The Arp request event.\r
+  @param  Context           The context of the callback, a point to the ARP\r
+                            queue.\r
+                                \r
 **/\r
 VOID\r
 EFIAPI\r
@@ -104,8 +87,6 @@ Ip4OnArpResolved (
 \r
   @param  Context               Context for the callback.\r
 \r
-  @return None.\r
-\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -114,13 +95,10 @@ Ip4OnFrameReceivedDpc (
   );\r
 \r
 /**\r
-\r
   Request Ip4OnFrameReceivedDpc as a DPC at TPL_CALLBACK.\r
 \r
   @param Event      The receive event delivered to MNP for receive.\r
   @param Context    Context for the callback.\r
-  \r
-  @return None.\r
 \r
 **/\r
 VOID\r
@@ -134,13 +112,11 @@ Ip4OnFrameReceived (
   Remove all the frames on the ARP queue that pass the FrameToCancel,\r
   that is, either FrameToCancel is NULL or it returns true for the frame.\r
 \r
-  @param  ArpQue                ARP frame to remove the frames from.\r
-  @param  IoStatus              The status returned to the cancelled frames'\r
+  @param[in]  ArpQue            ARP frame to remove the frames from.\r
+  @param[in]  IoStatus          The status returned to the cancelled frames'\r
                                 callback function.\r
-  @param  FrameToCancel         Function to select which frame to cancel.\r
-  @param  Context               Opaque parameter to the FrameToCancel.\r
-\r
-  @return NONE\r
+  @param[in]  FrameToCancel     Function to select which frame to cancel.\r
+  @param[in]  Context           Opaque parameter to the FrameToCancel.\r
 \r
 **/\r
 VOID\r
@@ -155,15 +131,16 @@ Ip4CancelFrameArp (
 /**\r
   Wrap a transmit request into a newly allocated IP4_LINK_TX_TOKEN.\r
 \r
-  @param  Interface             The interface to send out to.\r
-  @param  IpInstance            The IpInstance that transmit the packet.  NULL if\r
+  @param[in]  Interface         The interface to send out to.\r
+  @param[in]  IpInstance        The IpInstance that transmit the packet.  NULL if\r
                                 the packet is sent by the IP4 driver itself.\r
-  @param  Packet                The packet to transmit\r
-  @param  CallBack              Call back function to execute if transmission\r
+  @param[in]  Packet            The packet to transmit\r
+  @param[in]  CallBack          Call back function to execute if transmission\r
                                 finished.\r
-  @param  Context               Opaque parameter to the call back.\r
+  @param[in]  Context           Opaque parameter to the call back.\r
 \r
-  @return The wrapped token if succeed or NULL\r
+  @retval   Token               The wrapped token if succeed \r
+  @retval   NULL                The wrapped token if NULL\r
 \r
 **/\r
 IP4_LINK_TX_TOKEN *\r
@@ -237,9 +214,7 @@ Ip4WrapLinkTxToken (
   Free the link layer transmit token. It will close the event\r
   then free the memory used.\r
 \r
-  @param  Token                 Token to free\r
-\r
-  @return NONE\r
+  @param[in]  Token                 Token to free\r
 \r
 **/\r
 VOID\r
@@ -257,8 +232,8 @@ Ip4FreeLinkTxToken (
 /**\r
   Create an IP_ARP_QUE structure to request ARP service.\r
 \r
-  @param  Interface             The interface to send ARP from.\r
-  @param  DestIp                The destination IP (host byte order) to request MAC\r
+  @param[in]  Interface         The interface to send ARP from.\r
+  @param[in]  DestIp            The destination IP (host byte order) to request MAC\r
                                 for\r
 \r
   @return Point to newly created IP4_ARP_QUE if succeed, otherwise NULL.\r
@@ -308,12 +283,10 @@ Ip4CreateArpQue (
 /**\r
   Remove all the transmit requests queued on the ARP queue, then free it.\r
 \r
-  @param  ArpQue                Arp queue to free\r
-  @param  IoStatus              The transmit status returned to transmit requests'\r
+  @param[in]  ArpQue            Arp queue to free\r
+  @param[in]  IoStatus          The transmit status returned to transmit requests'\r
                                 callback.\r
 \r
-  @return NONE\r
-\r
 **/\r
 VOID\r
 Ip4FreeArpQue (\r
@@ -336,11 +309,11 @@ Ip4FreeArpQue (
 /**\r
   Create a link layer receive token to wrap the receive request\r
 \r
-  @param  Interface             The interface to receive from\r
-  @param  IpInstance            The instance that request the receive (NULL for IP4\r
+  @param[in]  Interface         The interface to receive from\r
+  @param[in]  IpInstance        The instance that request the receive (NULL for IP4\r
                                 driver itself)\r
-  @param  CallBack              Call back function to execute when finished.\r
-  @param  Context               Opaque parameters to the callback\r
+  @param[in]  CallBack          Call back function to execute when finished.\r
+  @param[in]  Context           Opaque parameters to the callback\r
 \r
   @return Point to created IP4_LINK_RX_TOKEN if succeed, otherwise NULL.\r
 \r
@@ -393,9 +366,7 @@ Ip4CreateLinkRxToken (
   Free the link layer request token. It will close the event\r
   then free the memory used.\r
 \r
-  @param  Token                 Request token to free\r
-\r
-  @return NONE\r
+  @param[in]  Token                 Request token to free.\r
 \r
 **/\r
 VOID\r
@@ -415,13 +386,11 @@ Ip4FreeFrameRxToken (
   Remove all the frames on the ARP queue that pass the FrameToCancel,\r
   that is, either FrameToCancel is NULL or it returns true for the frame.\r
 \r
-  @param  ArpQue                ARP frame to remove the frames from.\r
-  @param  IoStatus              The status returned to the cancelled frames'\r
+  @param[in]  ArpQue            ARP frame to remove the frames from.\r
+  @param[in]  IoStatus          The status returned to the cancelled frames'\r
                                 callback function.\r
-  @param  FrameToCancel         Function to select which frame to cancel.\r
-  @param  Context               Opaque parameter to the FrameToCancel.\r
-\r
-  @return NONE\r
+  @param[in]  FrameToCancel     Function to select which frame to cancel.\r
+  @param[in]  Context           Opaque parameter to the FrameToCancel.\r
 \r
 **/\r
 VOID\r
@@ -454,14 +423,12 @@ Ip4CancelFrameArp (
   either queued on ARP queues or that have already been delivered to\r
   MNP and not yet recycled.\r
 \r
-  @param  Interface             Interface to remove the frames from\r
-  @param  IoStatus              The transmit status returned to the frames'\r
+  @param[in]  Interface         Interface to remove the frames from\r
+  @param[in]  IoStatus          The transmit status returned to the frames'\r
                                 callback\r
-  @param  FrameToCancel         Function to select the frame to cancel, NULL to\r
+  @param[in]  FrameToCancel     Function to select the frame to cancel, NULL to\r
                                 select all\r
-  @param  Context               Opaque parameters passed to FrameToCancel\r
-\r
-  @return NONE\r
+  @param[in]  Context           Opaque parameters passed to FrameToCancel\r
 \r
 **/\r
 VOID\r
@@ -508,11 +475,11 @@ Ip4CancelFrames (
   Create an IP4_INTERFACE. Delay the creation of ARP instance until\r
   the interface is configured.\r
 \r
-  @param  Mnp                   The shared MNP child of this IP4 service binding\r
+  @param[in]  Mnp               The shared MNP child of this IP4 service binding\r
                                 instance\r
-  @param  Controller            The controller this IP4 service binding instance\r
+  @param[in]  Controller        The controller this IP4 service binding instance\r
                                 is installed. Most like the UNDI handle.\r
-  @param  ImageHandle           This driver's image handle\r
+  @param[in]  ImageHandle       This driver's image handle\r
 \r
   @return Point to the created IP4_INTERFACE, otherwise NULL.\r
 \r
@@ -575,9 +542,9 @@ Ip4CreateInterface (
   Set the interface's address, create and configure\r
   the ARP child if necessary.\r
 \r
-  @param  Interface             The interface to set the address\r
-  @param  IpAddr                The interface's IP address\r
-  @param  SubnetMask            The interface's netmask\r
+  @param  Interface         The interface to set the address\r
+  @param  IpAddr            The interface's IP address\r
+  @param  SubnetMask        The interface's netmask\r
 \r
   @retval EFI_SUCCESS           The interface is configured with Ip/netmask pair,\r
                                 and a ARP is created for it.\r
@@ -690,8 +657,8 @@ ON_ERROR:
 /**\r
   Filter function to cancel all the frame related to an IP instance.\r
 \r
-  @param  Frame                 The transmit request to test whether to cancel\r
-  @param  Context               The context which is the Ip instance that issued\r
+  @param[in]  Frame             The transmit request to test whether to cancel\r
+  @param[in]  Context           The context which is the Ip instance that issued\r
                                 the transmit.\r
 \r
   @retval TRUE                  The frame belongs to this instance and is to be\r
@@ -723,9 +690,7 @@ Ip4CancelInstanceFrame (
   packet and update the upper layer's transmit request status, say\r
   that from the UDP.\r
 \r
-  @param  Interface             The interface used by the IpInstance\r
-\r
-  @return None\r
+  @param[in]  Interface         The interface used by the IpInstance\r
 \r
 **/\r
 VOID\r
@@ -754,8 +719,8 @@ Ip4CancelReceive (
   Because the IpInstance is optional, the caller must remove\r
   IpInstance from the interface's instance list itself.\r
 \r
-  @param  Interface             The interface used by the IpInstance\r
-  @param  IpInstance            The Ip instance that free the interface. NULL if\r
+  @param[in]  Interface         The interface used by the IpInstance\r
+  @param[in]  IpInstance        The Ip instance that free the interface. NULL if\r
                                 the Ip driver is releasing the default interface.\r
 \r
   @retval EFI_SUCCESS           The interface use IpInstance is freed.\r
@@ -820,11 +785,9 @@ Ip4FreeInterface (
   all the queued frame if the ARP requests failed. Or transmit them\r
   if the request succeed.\r
 \r
-  @param  Context               The context of the callback, a point to the ARP\r
+  @param[in]  Context           The context of the callback, a point to the ARP\r
                                 queue\r
 \r
-  @return None\r
-\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -893,12 +856,10 @@ Ip4OnArpResolvedDpc (
 /**\r
   Request Ip4OnArpResolvedDpc as a DPC at TPL_CALLBACK.\r
 \r
-  @param  Event                 The Arp request event.\r
-  @param  Context               The context of the callback, a point to the ARP\r
-                                queue.\r
-\r
-  @return None\r
-\r
+  @param  Event             The Arp request event.\r
+  @param  Context           The context of the callback, a point to the ARP\r
+                            queue.\r
+                                \r
 **/\r
 VOID\r
 EFIAPI\r
@@ -919,9 +880,7 @@ Ip4OnArpResolved (
   Callback funtion when frame transmission is finished. It will\r
   call the frame owner's callback function to tell it the result.\r
 \r
-  @param  Context               Context which is point to the token.\r
-\r
-  @return None.\r
+  @param[in]  Context            Context which is point to the token.\r
 \r
 **/\r
 VOID\r
@@ -951,10 +910,8 @@ Ip4OnFrameSentDpc (
 /**\r
   Request Ip4OnFrameSentDpc as a DPC at TPL_CALLBACK.\r
 \r
-  @param  Event                 The transmit token's event.\r
-  @param  Context               Context which is point to the token.\r
-\r
-  @return None\r
+  @param[in]  Event              The transmit token's event.\r
+  @param[in]  Context            Context which is point to the token.\r
 \r
 **/\r
 VOID\r
@@ -979,14 +936,14 @@ Ip4OnFrameSent (
   If some error happened, the CallBack won't be called. So, the caller\r
   must test the return value, and take action when there is an error.\r
 \r
-  @param  Interface             The interface to send the frame from\r
-  @param  IpInstance            The IP child that request the transmission.  NULL\r
+  @param[in]  Interface         The interface to send the frame from\r
+  @param[in]  IpInstance        The IP child that request the transmission.  NULL\r
                                 if it is the IP4 driver itself.\r
-  @param  Packet                The packet to transmit.\r
-  @param  NextHop               The immediate destination to transmit the packet\r
+  @param[in]  Packet            The packet to transmit.\r
+  @param[in]  NextHop           The immediate destination to transmit the packet\r
                                 to.\r
-  @param  CallBack              Function to call back when transmit finished.\r
-  @param  Context               Opaque parameter to the call back.\r
+  @param[in]  CallBack          Function to call back when transmit finished.\r
+  @param[in]  Context           Opaque parameter to the call back.\r
 \r
   @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource to send the frame\r
   @retval EFI_NO_MAPPING        Can't resolve the MAC for the nexthop\r
@@ -1127,9 +1084,7 @@ ON_ERROR:
   Call back function when the received packet is freed.\r
   Check Ip4OnFrameReceived for information.\r
 \r
-  @param  Context               Context, which is the IP4_LINK_RX_TOKEN.\r
-\r
-  @return None.\r
+  @param  Context          Context, which is the IP4_LINK_RX_TOKEN.\r
 \r
 **/\r
 VOID\r
@@ -1157,8 +1112,6 @@ Ip4RecycleFrame (
 \r
   @param  Context               Context for the callback.\r
 \r
-  @return None.\r
-\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -1218,13 +1171,10 @@ Ip4OnFrameReceivedDpc (
 }\r
 \r
 /**\r
-\r
   Request Ip4OnFrameReceivedDpc as a DPC at TPL_CALLBACK.\r
 \r
   @param Event      The receive event delivered to MNP for receive.\r
   @param Context    Context for the callback.\r
-  \r
-  @return None.\r
 \r
 **/\r
 VOID\r
@@ -1244,11 +1194,11 @@ Ip4OnFrameReceived (
 /**\r
   Request to receive the packet from the interface.\r
 \r
-  @param  Interface             The interface to receive the frames from\r
-  @param  IpInstance            The instance that requests the receive. NULL for\r
+  @param[in]  Interface         The interface to receive the frames from\r
+  @param[in]  IpInstance        The instance that requests the receive. NULL for\r
                                 the driver itself.\r
-  @param  CallBack              Function to call when receive finished.\r
-  @param  Context               Opaque parameter to the callback\r
+  @param[in]  CallBack          Function to call when receive finished.\r
+  @param[in]  Context           Opaque parameter to the callback\r
 \r
   @retval EFI_ALREADY_STARTED   There is already a pending receive request.\r
   @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource to receive\r