]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
fix some checklist issues
[mirror_edk2.git] / MdeModulePkg / Universal / Network / MnpDxe / MnpIo.c
index b5d1785cb1fe5f6547333b567d34703983917885..a96303945a649507a17487342c59ff71c200cc87 100644 (file)
@@ -1,8 +1,7 @@
 /** @file\r
   Implementation of Managed Network Protocol I/O functions.\r
-  \r
-Copyright (c) 2005 - 2007, Intel Corporation.<BR>\r
-\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
@@ -14,17 +13,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 #include "MnpImpl.h"\r
-#include <Library/NetLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
 \r
 /**\r
   Validates the Mnp transmit token.\r
 \r
-  @param[in]  Instance              Pointer to the Mnp instance context data.\r
-  @param[in]  Token                 Pointer to the transmit token to check.\r
+  @param[in]  Instance            Pointer to the Mnp instance context data.\r
+  @param[in]  Token               Pointer to the transmit token to check.\r
 \r
   @return The Token is valid or not.\r
 \r
@@ -110,13 +104,13 @@ MnpIsValidTxToken (
 /**\r
   Build the packet to transmit from the TxData passed in.\r
 \r
-  @param  MnpServiceData        Pointer to the mnp service context data.\r
-  @param  TxData                Pointer to the transmit data containing the\r
-                                information to build the packet.\r
-  @param  PktBuf                Pointer to record the address of the packet.\r
-  @param  PktLen                Pointer to a UINT32 variable used to record the\r
-                                packet's length.\r
-   \r
+  @param[in]   MnpServiceData      Pointer to the mnp service context data.\r
+  @param[in]   TxData              Pointer to the transmit data containing the information \r
+                                   to build the packet.\r
+  @param[out]  PktBuf              Pointer to record the address of the packet.\r
+  @param[out]  PktLen              Pointer to a UINT32 variable used to record the packet's \r
+                                   length.\r
+\r
 **/\r
 VOID\r
 MnpBuildTxPacket (\r
@@ -180,22 +174,22 @@ MnpBuildTxPacket (
 /**\r
   Synchronously send out the packet.\r
 \r
-  @param[in]  MnpServiceData        Pointer to the mnp service context data.\r
-  @param[in]  Packet                Pointer to the pakcet buffer.\r
-  @param[in]  Length                The length of the packet.\r
-  @param[in]  Token                 Pointer to the token the packet generated from.\r
+  @param[in]       MnpServiceData      Pointer to the mnp service context data.\r
+  @param[in]       Packet              Pointer to the pakcet buffer.\r
+  @param[in]       Length              The length of the packet.\r
+  @param[in, out]  Token               Pointer to the token the packet generated from.\r
 \r
-  @retval EFI_SUCCESS           The packet is sent out.\r
-  @retval EFI_TIMEOUT           Time out occurs, the packet isn't sent.\r
-  @retval EFI_DEVICE_ERROR      An unexpected network error occurs.\r
+  @retval EFI_SUCCESS                  The packet is sent out.\r
+  @retval EFI_TIMEOUT                  Time out occurs, the packet isn't sent.\r
+  @retval EFI_DEVICE_ERROR             An unexpected network error occurs.\r
 \r
 **/\r
 EFI_STATUS\r
 MnpSyncSendPacket (\r
-  IN MNP_SERVICE_DATA                      *MnpServiceData,\r
-  IN UINT8                                 *Packet,\r
-  IN UINT32                                Length,\r
-  IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token\r
+  IN MNP_SERVICE_DATA                          *MnpServiceData,\r
+  IN UINT8                                     *Packet,\r
+  IN UINT32                                    Length,\r
+  IN OUT EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token\r
   )\r
 {\r
   EFI_STATUS                        Status;\r
@@ -297,7 +291,7 @@ SIGNAL_TOKEN:
 /**\r
   Try to deliver the received packet to the instance.\r
 \r
-  @param[in]  Instance          Pointer to the mnp instance context data.\r
+  @param[in, out]  Instance     Pointer to the mnp instance context data.\r
 \r
   @retval EFI_SUCCESS           The received packet is delivered, or there is no\r
                                 packet to deliver, or there is no available receive\r
@@ -307,7 +301,7 @@ SIGNAL_TOKEN:
 **/\r
 EFI_STATUS\r
 MnpInstanceDeliverPacket (\r
-  IN MNP_INSTANCE_DATA  *Instance\r
+  IN OUT MNP_INSTANCE_DATA  *Instance\r
   )\r
 {\r
   MNP_SERVICE_DATA                      *MnpServiceData;\r
@@ -391,7 +385,7 @@ MnpInstanceDeliverPacket (
 /**\r
   Deliver the received packet for the instances belonging to the MnpServiceData.\r
 \r
-  @param  MnpServiceData        Pointer to the mnp service context data.\r
+  @param[in]  MnpServiceData        Pointer to the mnp service context data.\r
 \r
 **/\r
 VOID\r
@@ -420,9 +414,9 @@ MnpDeliverPacket (
   Recycle the RxData and other resources used to hold and deliver the received\r
   packet.\r
 \r
-  @param  Event             The event this notify function registered to.\r
-  @param  Context           Pointer to the context data registerd to the Event.\r
-  \r
+  @param[in]  Event               The event this notify function registered to.\r
+  @param[in]  Context             Pointer to the context data registerd to the Event.\r
+\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -467,15 +461,14 @@ MnpRecycleRxData (
 /**\r
   Queue the received packet into instance's receive queue.\r
 \r
-  @param  Instance          Pointer to the mnp instance context data.\r
-  @param  RxDataWrap        Pointer to the Wrap structure containing the\r
-                                received data and other information.\r
-\r
+  @param[in, out]  Instance        Pointer to the mnp instance context data.\r
+  @param[in, out]  RxDataWrap      Pointer to the Wrap structure containing the\r
+                                   received data and other information.\r
 **/\r
 VOID\r
 MnpQueueRcvdPacket (\r
-  IN MNP_INSTANCE_DATA  *Instance,\r
-  IN MNP_RXDATA_WRAP    *RxDataWrap\r
+  IN OUT MNP_INSTANCE_DATA  *Instance,\r
+  IN OUT MNP_RXDATA_WRAP    *RxDataWrap\r
   )\r
 {\r
   MNP_RXDATA_WRAP *OldRxDataWrap;\r
@@ -600,25 +593,25 @@ MnpMatchPacket (
 /**\r
   Analyse the received packets.\r
 \r
-  @param  MnpServiceData    Pointer to the mnp service context data.\r
-  @param  Nbuf              Pointer to the net buffer holding the received\r
-                            packet.\r
-  @param  RxData            Pointer to the buffer used to save the analysed\r
-                            result in EFI_MANAGED_NETWORK_RECEIVE_DATA.\r
-  @param  GroupAddress      Pointer to pointer to a MNP_GROUP_ADDRESS used to\r
-                            pass out the address of the multicast address the\r
-                            received packet destinated to.\r
-  @param  PktAttr           Pointer to the buffer used to save the analysed\r
-                            packet attribute.\r
+  @param[in]       MnpServiceData    Pointer to the mnp service context data.\r
+  @param[in]       Nbuf              Pointer to the net buffer holding the received\r
+                                     packet.\r
+  @param[in, out]  RxData            Pointer to the buffer used to save the analysed\r
+                                     result in EFI_MANAGED_NETWORK_RECEIVE_DATA.\r
+  @param[out]      GroupAddress      Pointer to pointer to a MNP_GROUP_ADDRESS used to\r
+                                     pass out the address of the multicast address the\r
+                                     received packet destinated to.\r
+  @param[out]      PktAttr           Pointer to the buffer used to save the analysed\r
+                                     packet attribute.\r
 \r
 **/\r
 VOID\r
 MnpAnalysePacket (\r
-  IN  MNP_SERVICE_DATA                  *MnpServiceData,\r
-  IN  NET_BUF                           *Nbuf,\r
-  IN  EFI_MANAGED_NETWORK_RECEIVE_DATA  *RxData,\r
-  OUT MNP_GROUP_ADDRESS                 **GroupAddress,\r
-  OUT UINT8                             *PktAttr\r
+  IN  MNP_SERVICE_DATA                      *MnpServiceData,\r
+  IN  NET_BUF                               *Nbuf,\r
+  IN  OUT EFI_MANAGED_NETWORK_RECEIVE_DATA  *RxData,\r
+  OUT MNP_GROUP_ADDRESS                     **GroupAddress,\r
+  OUT UINT8                                 *PktAttr\r
   )\r
 {\r
   EFI_SIMPLE_NETWORK_MODE *SnpMode;\r
@@ -702,8 +695,8 @@ MnpAnalysePacket (
 /**\r
   Wrap the RxData.\r
 \r
-  @param[in]  Instance              Pointer to the mnp instance context data.\r
-  @param[in]  RxData                Pointer to the receive data to wrap.\r
+  @param[in]  Instance           Pointer to the mnp instance context data.\r
+  @param[in]  RxData             Pointer to the receive data to wrap.\r
 \r
   @return Pointer to a MNP_RXDATA_WRAP which wraps the RxData.\r
 \r
@@ -758,9 +751,9 @@ MnpWrapRxData (
   Enqueue the received the packets to the instances belonging to the\r
   MnpServiceData.\r
 \r
-  @param  MnpServiceData    Pointer to the mnp service context data.\r
-  @param  Nbuf              Pointer to the net buffer representing the received\r
-                            packet.\r
+  @param[in]  MnpServiceData    Pointer to the mnp service context data.\r
+  @param[in]  Nbuf              Pointer to the net buffer representing the received\r
+                                packet.\r
 \r
 **/\r
 VOID\r
@@ -833,7 +826,7 @@ MnpEnqueuePacket (
 /**\r
   Try to receive a packet and deliver it.\r
 \r
-  @param[in]  MnpServiceData    Pointer to the mnp service context data.\r
+  @param[in, out]  MnpServiceData        Pointer to the mnp service context data.\r
 \r
   @retval EFI_SUCCESS           add return value to function comment\r
   @retval EFI_NOT_STARTED       The simple network protocol is not started.\r
@@ -843,7 +836,7 @@ MnpEnqueuePacket (
 **/\r
 EFI_STATUS\r
 MnpReceivePacket (\r
-  IN MNP_SERVICE_DATA  *MnpServiceData\r
+  IN OUT MNP_SERVICE_DATA  *MnpServiceData\r
   )\r
 {\r
   EFI_STATUS                  Status;\r
@@ -985,10 +978,10 @@ EXIT:
 /**\r
   Remove the received packets if timeout occurs.\r
 \r
-  @param  Event             The event this notify function registered to.\r
-  @param  Context           Pointer to the context data registered to the\r
-                            event.\r
-  \r
+  @param[in]  Event             The event this notify function registered to.\r
+  @param[in]  Context           Pointer to the context data registered to the\r
+                                event.\r
+   \r
 **/\r
 VOID\r
 EFIAPI\r
@@ -1052,16 +1045,15 @@ MnpCheckPacketTimeout (
   Poll to receive the packets from Snp. This function is either called by upperlayer\r
   protocols/applications or the system poll timer notify mechanism.\r
 \r
-  @param  Event             The event this notify function registered to.\r
-  @param  Context           Pointer to the context data registered to the\r
-                            event.\r
+  @param[in]       Event        The event this notify function registered to.\r
+  @param[in, out]  Context      Pointer to the context data registered to the event.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 MnpSystemPoll (\r
   IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
+  IN OUT VOID   *Context\r
   )\r
 {\r
   MNP_SERVICE_DATA  *MnpServiceData;\r