]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix function header
authorywu21 <ywu21@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 23 Dec 2008 07:29:54 +0000 (07:29 +0000)
committerywu21 <ywu21@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 23 Dec 2008 07:29:54 +0000 (07:29 +0000)
Fix return status issues
Fix  in out issues

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7097 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Library/NetLib.h

index ca9e30324275e0c3fb6dacd097aa7039a152e658..c234defe11cdb63c92d063a8dba581687f148e82 100644 (file)
@@ -170,25 +170,24 @@ typedef struct {
   return the invalid length 33, which is IP4_MASK_NUM.\r
   NetMask is in the host byte order.\r
 \r
-  @param  NetMask               The netmask to get the length from\r
-\r
-  @return The length of the netmask, IP4_MASK_NUM if the mask isn't\r
-  @return supported.\r
+  @param[in]  NetMask              The netmask to get the length from.\r
 \r
+  @return The length of the netmask, IP4_MASK_NUM if the mask isn't.\r
+  \r
 **/\r
 INTN\r
 EFIAPI\r
 NetGetMaskLength (\r
-  IN IP4_ADDR               Mask\r
+  IN IP4_ADDR               NetMask\r
   );\r
 \r
 /**\r
   Return the class of the address, such as class a, b, c.\r
   Addr is in host byte order.\r
 \r
-  @param  Addr                  The address to get the class from\r
+  @param[in]   Addr                  The address to get the class from.\r
 \r
-  @return IP address class, such as IP4_ADDR_CLASSA\r
+  @return IP address class, such as IP4_ADDR_CLASSA.\r
 \r
 **/\r
 INTN\r
@@ -202,13 +201,14 @@ NetGetIpClass (
   the netmask. If NetMask is zero, use the IP address's class to\r
   get the default mask.\r
 \r
-  @param  Ip                    The IP to check againist\r
-  @param  NetMask               The mask of the IP\r
+  @param[in]  Ip                    The IP to check against.\r
+  @param[in]  NetMask               The mask of the IP.\r
 \r
-  @return TRUE if IP is a valid unicast address on the network, otherwise FALSE\r
+  @return TRUE if IP is a valid unicast address on the network, otherwise FALSE.\r
 \r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 Ip4IsUnicast (\r
   IN IP4_ADDR               Ip,\r
   IN IP4_ADDR               NetMask\r
@@ -233,7 +233,7 @@ extern EFI_IPv4_ADDRESS  mZeroIp4Addr;
   Extract a UINT32 from a byte stream, then convert it to host\r
   byte order. Use this function to avoid alignment error.\r
 \r
-  @param  Buf                   The buffer to extract the UINT32.\r
+  @param[in]  Buf                 The buffer to extract the UINT32.\r
 \r
   @return The UINT32 extracted.\r
 \r
@@ -248,24 +248,20 @@ NetGetUint32 (
   Put a UINT32 to the byte stream. Convert it from host byte order\r
   to network byte order before putting.\r
 \r
-  @param  Buf                   The buffer to put the UINT32\r
-  @param  Data                  The data to put\r
-\r
-  @return None\r
-\r
+  @param[in, out]  Buf          The buffer to put the UINT32.\r
+  @param[in]      Data          The data to put.\r
+  \r
 **/\r
 VOID\r
 EFIAPI\r
 NetPutUint32 (\r
-  IN UINT8                  *Buf,\r
-  IN UINT32                 Data\r
+  IN OUT UINT8                 *Buf,\r
+  IN     UINT32                Data\r
   );\r
 \r
 /**\r
   Initialize a random seed using current time.\r
 \r
-  None\r
-\r
   @return The random seed initialized with current time.\r
 \r
 **/\r
@@ -311,9 +307,9 @@ NetRandomInitSeed (
 \r
 \r
 /**\r
-  Remove the first entry on the list\r
+  Remove the first entry on the list.\r
 \r
-  @param  Head                  The list header\r
+  @param[in, out]  Head                  The list header.\r
 \r
   @return The entry that is removed from the list, NULL if the list is empty.\r
 \r
@@ -321,13 +317,13 @@ NetRandomInitSeed (
 LIST_ENTRY *\r
 EFIAPI\r
 NetListRemoveHead (\r
-  LIST_ENTRY            *Head\r
+  IN OUT LIST_ENTRY            *Head\r
   );\r
 \r
 /**\r
-  Remove the last entry on the list\r
+  Remove the last entry on the list.\r
 \r
-  @param  Head                  The list head\r
+  @param[in, out]  Head                  The list head.\r
 \r
   @return The entry that is removed from the list, NULL if the list is empty.\r
 \r
@@ -335,39 +331,35 @@ NetListRemoveHead (
 LIST_ENTRY *\r
 EFIAPI\r
 NetListRemoveTail (\r
-  LIST_ENTRY            *Head\r
+  IN OUT LIST_ENTRY            *Head\r
   );\r
 \r
 /**\r
   Insert the NewEntry after the PrevEntry.\r
 \r
-  @param  PrevEntry             The previous entry to insert after\r
-  @param  NewEntry              The new entry to insert\r
-\r
-  @return None\r
+  @param[in, out]  PrevEntry             The previous entry to insert after.\r
+  @param[in, out]  NewEntry              The new entry to insert.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetListInsertAfter (\r
-  IN LIST_ENTRY         *PrevEntry,\r
-  IN LIST_ENTRY         *NewEntry\r
+  IN OUT LIST_ENTRY         *PrevEntry,\r
+  IN OUT LIST_ENTRY         *NewEntry\r
   );\r
 \r
 /**\r
   Insert the NewEntry before the PostEntry.\r
 \r
-  @param  PostEntry             The entry to insert before\r
-  @param  NewEntry              The new entry to insert\r
-\r
-  @return None\r
+  @param[in, out]  PostEntry             The entry to insert before.\r
+  @param[in, out]  NewEntry              The new entry to insert.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetListInsertBefore (\r
-  IN LIST_ENTRY         *PostEntry,\r
-  IN LIST_ENTRY         *NewEntry\r
+  IN OUT LIST_ENTRY     *PostEntry,\r
+  IN OUT LIST_ENTRY     *NewEntry\r
   );\r
 \r
 \r
@@ -392,35 +384,31 @@ typedef struct {
 /**\r
   Initialize the netmap. Netmap is a reposity to keep the <Key, Value> pairs.\r
 \r
-  @param  Map                   The netmap to initialize\r
-\r
-  @return None\r
+  @param[in, out]  Map                   The netmap to initialize.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetMapInit (\r
-  IN NET_MAP                *Map\r
+  IN OUT NET_MAP                *Map\r
   );\r
 \r
 /**\r
   To clean up the netmap, that is, release allocated memories.\r
 \r
-  @param  Map                   The netmap to clean up.\r
-\r
-  @return None\r
+  @param[in, out]  Map                   The netmap to clean up.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetMapClean (\r
-  IN NET_MAP                *Map\r
+  IN OUT NET_MAP            *Map\r
   );\r
 \r
 /**\r
-  Test whether the netmap is empty\r
+  Test whether the netmap is empty.\r
 \r
-  @param  Map                   The net map to test\r
+  @param[in]  Map                   The net map to test.\r
 \r
   @return TRUE if the netmap is empty, otherwise FALSE.\r
 \r
@@ -434,7 +422,7 @@ NetMapIsEmpty (
 /**\r
   Return the number of the <Key, Value> pairs in the netmap.\r
 \r
-  @param  Map                   The netmap to get the entry number\r
+  @param[in]  Map                   The netmap to get the entry number.\r
 \r
   @return The entry number in the netmap.\r
 \r
@@ -448,18 +436,18 @@ NetMapGetCount (
 /**\r
   Allocate an item to save the <Key, Value> pair to the head of the netmap.\r
 \r
-  @param  Map                   The netmap to insert into\r
-  @param  Key                   The user's key\r
-  @param  Value                 The user's value for the key\r
+  @param[in, out]  Map                   The netmap to insert into.\r
+  @param[in]       Key                   The user's key.\r
+  @param[in]       Value                 The user's value for the key.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES  Failed to allocate the memory for the item\r
-  @retval EFI_SUCCESS           The item is inserted to the head\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate the memory for the item.\r
+  @retval EFI_SUCCESS           The item is inserted to the head.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 NetMapInsertHead (\r
-  IN NET_MAP                *Map,\r
+  IN OUT NET_MAP            *Map,\r
   IN VOID                   *Key,\r
   IN VOID                   *Value    OPTIONAL\r
   );\r
@@ -467,32 +455,32 @@ NetMapInsertHead (
 /**\r
   Allocate an item to save the <Key, Value> pair to the tail of the netmap.\r
 \r
-  @param  Map                   The netmap to insert into\r
-  @param  Key                   The user's key\r
-  @param  Value                 The user's value for the key\r
+  @param[in, out]  Map                   The netmap to insert into.\r
+  @param[in]       Key                   The user's key.\r
+  @param[in]       Value                 The user's value for the key.\r
 \r
-  @retval EFI_OUT_OF_RESOURCES  Failed to allocate the memory for the item\r
-  @retval EFI_SUCCESS           The item is inserted to the tail\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate the memory for the item.\r
+  @retval EFI_SUCCESS           The item is inserted to the tail.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 NetMapInsertTail (\r
-  IN NET_MAP                *Map,\r
+  IN OUT NET_MAP            *Map,\r
   IN VOID                   *Key,\r
   IN VOID                   *Value    OPTIONAL\r
   );\r
 \r
 /**\r
-  Find the key in the netmap\r
+  Find the key in the netmap.\r
 \r
-  @param  Map                   The netmap to search within\r
-  @param  Key                   The key to search\r
+  @param[in]  Map                   The netmap to search within.\r
+  @param[in]  Key                   The key to search.\r
 \r
   @return The point to the item contains the Key, or NULL if Key isn't in the map.\r
 \r
 **/\r
-NET_MAP_ITEM  *\r
+NET_MAP_ITEM *\r
 EFIAPI\r
 NetMapFindKey (\r
   IN  NET_MAP               *Map,\r
@@ -500,53 +488,53 @@ NetMapFindKey (
   );\r
 \r
 /**\r
-  Remove the item from the netmap\r
+  Remove the item from the netmap.\r
 \r
-  @param  Map                   The netmap to remove the item from\r
-  @param  Item                  The item to remove\r
-  @param  Value                 The variable to receive the value if not NULL\r
+  @param[in, out]  Map                   The netmap to remove the item from.\r
+  @param[in, out]  Item                  The item to remove.\r
+  @param[out]      Value                 The variable to receive the value if not NULL.\r
 \r
-  @return The key of the removed item.\r
+  @return                                The key of the removed item.\r
 \r
 **/\r
 VOID *\r
 EFIAPI\r
 NetMapRemoveItem (\r
-  IN  NET_MAP               *Map,\r
-  IN  NET_MAP_ITEM          *Item,\r
-  OUT VOID                  **Value   OPTIONAL\r
+  IN  OUT NET_MAP             *Map,\r
+  IN  OUT NET_MAP_ITEM        *Item,\r
+  OUT VOID                    **Value           OPTIONAL\r
   );\r
 \r
 /**\r
   Remove the first entry on the netmap.\r
 \r
-  @param  Map                   The netmap to remove the head from\r
-  @param  Value                 The variable to receive the value if not NULL\r
+  @param[in, out]  Map                   The netmap to remove the head from.\r
+  @param[out]      Value                 The variable to receive the value if not NULL.\r
 \r
-  @return The key of the item removed\r
+  @return                                The key of the item removed.\r
 \r
 **/\r
 VOID *\r
 EFIAPI\r
 NetMapRemoveHead (\r
-  IN  NET_MAP               *Map,\r
-  OUT VOID                  **Value   OPTIONAL\r
+  IN OUT NET_MAP            *Map,\r
+  OUT VOID                  **Value         OPTIONAL\r
   );\r
 \r
 /**\r
   Remove the last entry on the netmap.\r
 \r
-  @param  Map                   The netmap to remove the tail from\r
-  @param  Value                 The variable to receive the value if not NULL\r
+  @param[in, out]  Map                   The netmap to remove the tail from.\r
+  @param[out]      Value                 The variable to receive the value if not NULL.\r
 \r
-  @return The key of the item removed\r
+  @return                                The key of the item removed.\r
 \r
 **/\r
 VOID *\r
 EFIAPI\r
 NetMapRemoveTail (\r
-  IN  NET_MAP               *Map,\r
-  OUT VOID                  **Value OPTIONAL\r
+  IN OUT NET_MAP            *Map,\r
+  OUT VOID                  **Value       OPTIONAL\r
   );\r
 \r
 typedef\r
@@ -563,11 +551,13 @@ EFI_STATUS
   from the loop. It returns the CallBack's last return value. This\r
   function is delete safe for the current item.\r
 \r
-  @param  Map                   The Map to iterate through\r
-  @param  CallBack              The callback function to call for each item.\r
-  @param  Arg                   The opaque parameter to the callback\r
+  @param[in]  Map                   The Map to iterate through.\r
+  @param[in]  CallBack              The callback function to call for each item.\r
+  @param[in]  Arg                   The opaque parameter to the callback.\r
 \r
-  @return It returns the CallBack's last return value.\r
+  @retval EFI_SUCCESS            There is no item in the netmap or CallBack for each item\r
+                                 return EFI_SUCCESS.\r
+  @retval Others                 It returns the CallBack's last return value.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -575,7 +565,7 @@ EFIAPI
 NetMapIterate (\r
   IN NET_MAP                *Map,\r
   IN NET_MAP_CALLBACK       CallBack,\r
-  IN VOID                   *Arg      OPTIONAL\r
+  IN VOID                   *Arg\r
   );\r
 \r
 \r
@@ -585,10 +575,10 @@ NetMapIterate (
 /**\r
   Create a child of the service that is identified by ServiceBindingGuid.\r
 \r
-  @param  ControllerHandle      The controller which has the service installed.\r
-  @param  ImageHandle           The image handle used to open service.\r
-  @param  ServiceBindingGuid    The service's Guid.\r
-  @param  ChildHandle           The handle to receive the create child\r
+  @param[in]       Controller            The controller which has the service installed.\r
+  @param[in]       Image                 The image handle used to open service.\r
+  @param[in]       ServiceBindingGuid    The service's Guid.\r
+  @param[in, out]  ChildHandle           The handle to receive the create child\r
 \r
   @retval EFI_SUCCESS           The child is successfully created.\r
   @retval Others                Failed to create the child.\r
@@ -597,19 +587,19 @@ NetMapIterate (
 EFI_STATUS\r
 EFIAPI\r
 NetLibCreateServiceChild (\r
-  IN  EFI_HANDLE            ControllerHandle,\r
-  IN  EFI_HANDLE            ImageHandle,\r
+  IN  EFI_HANDLE            Controller,\r
+  IN  EFI_HANDLE            Image,\r
   IN  EFI_GUID              *ServiceBindingGuid,\r
-  OUT EFI_HANDLE            *ChildHandle\r
+  IN  OUT EFI_HANDLE        *ChildHandle\r
   );\r
 \r
 /**\r
   Destory a child of the service that is identified by ServiceBindingGuid.\r
 \r
-  @param  ControllerHandle      The controller which has the service installed.\r
-  @param  ImageHandle           The image handle used to open service.\r
-  @param  ServiceBindingGuid    The service's Guid.\r
-  @param  ChildHandle           The child to destory\r
+  @param[in]   Controller            The controller which has the service installed.\r
+  @param[in]   Image                 The image handle used to open service.\r
+  @param[in]   ServiceBindingGuid    The service's Guid.\r
+  @param[in]   ChildHandle           The child to destory\r
 \r
   @retval EFI_SUCCESS           The child is successfully destoried.\r
   @retval Others                Failed to destory the child.\r
@@ -618,8 +608,8 @@ NetLibCreateServiceChild (
 EFI_STATUS\r
 EFIAPI\r
 NetLibDestroyServiceChild (\r
-  IN  EFI_HANDLE            ControllerHandle,\r
-  IN  EFI_HANDLE            ImageHandle,\r
+  IN  EFI_HANDLE            Controller,\r
+  IN  EFI_HANDLE            Image,\r
   IN  EFI_GUID              *ServiceBindingGuid,\r
   IN  EFI_HANDLE            ChildHandle\r
   );\r
@@ -629,36 +619,37 @@ NetLibDestroyServiceChild (
   SnpHandle to a unicode string. Callers are responsible for freeing the\r
   string storage.\r
 \r
-  @param  SnpHandle             The handle where the simple network protocol is\r
-                                installed on.\r
-  @param  ImageHandle           The image handle used to act as the agent handle to\r
-                                get the simple network protocol.\r
-  @param  MacString             The pointer to store the address of the string\r
-                                representation of  the mac address.\r
-\r
+  @param[in]   SnpHandle             The handle where the simple network protocol is\r
+                                     installed on.\r
+  @param[in]   ImageHandle           The image handle used to act as the agent handle to\r
+                                     get the simple network protocol.\r
+  @param[out]  MacString             The pointer to store the address of the string\r
+                                     representation of  the mac address.\r
+  \r
+  @retval EFI_SUCCESS           Convert the mac address a unicode string successfully.\r
   @retval EFI_OUT_OF_RESOURCES  There are not enough memory resource.\r
-  @retval other                 Failed to open the simple network protocol.\r
+  @retval Others                Failed to open the simple network protocol.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 NetLibGetMacString (\r
-  IN           EFI_HANDLE  SnpHandle,\r
-  IN           EFI_HANDLE  ImageHandle,\r
-  IN OUT       CHAR16      **MacString\r
+  IN  EFI_HANDLE            SnpHandle,\r
+  IN  EFI_HANDLE            ImageHandle,\r
+  OUT CHAR16                **MacString\r
   );\r
 \r
 /**\r
   Create an IPv4 device path node.\r
 \r
-  @param  Node                  Pointer to the IPv4 device path node.\r
-  @param  Controller            The handle where the NIC IP4 config protocol resides.\r
-  @param  LocalIp               The local IPv4 address.\r
-  @param  LocalPort             The local port.\r
-  @param  RemoteIp              The remote IPv4 address.\r
-  @param  RemotePort            The remote port.\r
-  @param  Protocol              The protocol type in the IP header.\r
-  @param  UseDefaultAddress     Whether this instance is using default address or not.\r
+  @param[in, out]  Node                  Pointer to the IPv4 device path node.\r
+  @param[in]       Controller            The handle where the NIC IP4 config protocol resides.\r
+  @param[in]       LocalIp               The local IPv4 address.\r
+  @param[in]       LocalPort             The local port.\r
+  @param[in]       RemoteIp              The remote IPv4 address.\r
+  @param[in]       RemotePort            The remote port.\r
+  @param[in]       Protocol              The protocol type in the IP header.\r
+  @param[in]       UseDefaultAddress     Whether this instance is using default address or not.\r
 \r
 **/\r
 VOID\r
@@ -684,10 +675,10 @@ NetLibCreateIPv4DPathNode (
   IP opens these handle BY_DRIVER, use that info, we can get the\r
   UNDI/SNP handle.\r
 \r
-  @param  Controller            Then protocol handle to check\r
-  @param  ProtocolGuid          The protocol that is related with the handle.\r
+  @param[in]  Controller            Then protocol handle to check.\r
+  @param[in]  ProtocolGuid          The protocol that is related with the handle.\r
 \r
-  @return The UNDI/SNP handle or NULL.\r
+  @return The UNDI/SNP handle or NULL for errors.\r
 \r
 **/\r
 EFI_HANDLE\r
@@ -700,14 +691,14 @@ NetLibGetNicHandle (
 /**\r
   Add a Deferred Procedure Call to the end of the DPC queue.\r
 \r
-  @param DpcTpl           The EFI_TPL that the DPC should be invoked.\r
-  @param DpcProcedure     Pointer to the DPC's function.\r
-  @param DpcContext       Pointer to the DPC's context.  Passed to DpcProcedure\r
-                          when DpcProcedure is invoked.\r
+  @param[in]  DpcTpl           The EFI_TPL that the DPC should be invoked.\r
+  @param[in]  DpcProcedure     Pointer to the DPC's function.\r
+  @param[in]  DpcContext       Pointer to the DPC's context.  Passed to DpcProcedure\r
+                               when DpcProcedure is invoked.\r
 \r
   @retval  EFI_SUCCESS              The DPC was queued.\r
-  @retval  EFI_INVALID_PARAMETER    DpcTpl is not a valid EFI_TPL.\r
-                                    DpcProcedure is NULL.\r
+  @retval  EFI_INVALID_PARAMETER    DpcTpl is not a valid EFI_TPL, or DpcProcedure\r
+                                    is NULL.\r
   @retval  EFI_OUT_OF_RESOURCES     There are not enough resources available to\r
                                     add the DPC to the queue.\r
 \r
@@ -721,7 +712,10 @@ NetLibQueueDpc (
   );\r
 \r
 /**\r
-  Add a Deferred Procedure Call to the end of the DPC queue.\r
+  Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl\r
+  value greater than or equal to the current TPL are invoked in the order that\r
+  they were queued.  DPCs with higher DpcTpl values are invoked before DPCs with\r
+  lower DpcTpl values.\r
 \r
   @retval  EFI_SUCCESS              One or more DPCs were invoked.\r
   @retval  EFI_NOT_FOUND            No DPCs were invoked.\r
@@ -736,7 +730,7 @@ NetLibDispatchDpc (
 /**\r
   This is the default unload handle for all the network drivers.\r
 \r
-  @param  ImageHandle           The drivers' driver image.\r
+  @param[in]  ImageHandle       The drivers' driver image.\r
 \r
   @retval EFI_SUCCESS           The image is unloaded.\r
   @retval Others                Failed to unload the image.\r
@@ -897,9 +891,9 @@ typedef struct {
   Allocate a single block NET_BUF. Upon allocation, all the\r
   free space is in the tail room.\r
 \r
-  @param  Len                   The length of the block.\r
+  @param[in]  Len              The length of the block.\r
 \r
-  @retval *                     Pointer to the allocated NET_BUF. If NULL  the\r
+  @return                       Pointer to the allocated NET_BUF. If NULL  the\r
                                 allocation failed due to resource limit.\r
 \r
 **/\r
@@ -912,9 +906,7 @@ NetbufAlloc (
 /**\r
   Free the buffer and its associated NET_VECTOR.\r
 \r
-  @param  Nbuf                  Pointer to the NET_BUF to be freed.\r
-\r
-  @return None.\r
+  @param[in]  Nbuf                  Pointer to the NET_BUF to be freed.\r
 \r
 **/\r
 VOID\r
@@ -929,11 +921,11 @@ NetbufFree (
   returns the fragment that contains the byte which is used mainly by\r
   the buffer implementation itself.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer.\r
-  @param  Offset                The index or offset of the byte\r
-  @param  Index                 Index of the fragment that contains the block\r
+  @param[in]   Nbuf                  Pointer to the net buffer.\r
+  @param[in]   Offset                The index or offset of the byte.\r
+  @param[out]  Index                 Index of the fragment that contains the block.\r
 \r
-  @retval *                     Pointer to the nth byte of data in the net buffer.\r
+  @return *                     Pointer to the nth byte of data in the net buffer.\r
                                 If NULL, there is no such data in the net buffer.\r
 \r
 **/\r
@@ -942,15 +934,16 @@ EFIAPI
 NetbufGetByte (\r
   IN  NET_BUF               *Nbuf,\r
   IN  UINT32                Offset,\r
-  OUT UINT32                *Index      OPTIONAL\r
+  OUT UINT32                *Index  OPTIONAL\r
   );\r
 \r
 /**\r
   Create a copy of NET_BUF that share the associated NET_DATA.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer to be cloned.\r
+  @param[in]  Nbuf              Pointer to the net buffer to be cloned.\r
 \r
-  @retval *                     Pointer to the cloned net buffer.\r
+  @return                       Pointer to the cloned net buffer.If NULL, the\r
+                                allocation failed due to resource limit.\r
 \r
 **/\r
 NET_BUF  *\r
@@ -963,19 +956,20 @@ NetbufClone (
   Create a duplicated copy of Nbuf, data is copied. Also leave some\r
   head space before the data.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer to be cloned.\r
-  @param  Duplicate             Pointer to the net buffer to duplicate to, if NULL\r
-                                a new net  buffer is allocated.\r
-  @param  HeadSpace             Length of the head space to reserve\r
+  @param[in]       Nbuf                  Pointer to the net buffer to be cloned.\r
+  @param[in, out]  Duplicate             Pointer to the net buffer to duplicate to, if NULL\r
+                                         a new net  buffer is allocated.\r
+  @param[in]      HeadSpace              Length of the head space to reserve.\r
 \r
-  @retval *                     Pointer to the duplicated net buffer.\r
+  @return                       Pointer to the duplicated net buffer.If NULL, the\r
+                                allocation failed due to resource limit.\r
 \r
 **/\r
 NET_BUF  *\r
 EFIAPI\r
 NetbufDuplicate (\r
   IN NET_BUF                *Nbuf,\r
-  IN NET_BUF                *Duplicate    OPTIONAL,\r
+  IN OUT NET_BUF            *Duplicate        OPTIONAL,\r
   IN UINT32                 HeadSpace\r
   );\r
 \r
@@ -985,14 +979,15 @@ NetbufDuplicate (
   created but the associated data in NET_VECTOR is shared.\r
   This function exists to do IP packet fragmentation.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer to be cloned.\r
-  @param  Offset                Starting point of the data to be included in new\r
-                                buffer.\r
-  @param  Len                   How many data to include in new data\r
-  @param  HeadSpace             How many bytes of head space to reserve for\r
-                                protocol header\r
+  @param[in]  Nbuf                  Pointer to the net buffer to be cloned.\r
+  @param[in]  Offset                Starting point of the data to be included in new\r
+                                    buffer.\r
+  @param[in]  Len                   How many data to include in new data.\r
+  @param[in]  HeadSpace             How many bytes of head space to reserve for\r
+                                    protocol header.\r
 \r
-  @retval *                     Pointer to the cloned net buffer.\r
+  @return                       Pointer to the cloned net buffer.If NULL, the\r
+                                allocation failed due to resource limit.\r
 \r
 **/\r
 NET_BUF  *\r
@@ -1013,35 +1008,33 @@ NetbufGetFragment (
   of an empty NET_BUF not built from the external. But\r
   it should be enough for the network stack.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer.\r
-  @param  Len                   The length of buffer to be reserverd.\r
-\r
-  @return None.\r
+  @param[in, out]  Nbuf                  Pointer to the net buffer.\r
+  @param[in]       Len                   The length of buffer to be reserverd.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetbufReserve (\r
-  IN NET_BUF                *Nbuf,\r
+  IN OUT NET_BUF            *Nbuf,\r
   IN UINT32                 Len\r
   );\r
 \r
 /**\r
   Allocate some space from the header or tail of the buffer.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer.\r
-  @param  Len                   The length of the buffer to be allocated.\r
-  @param  FromHead              The flag to indicate whether reserve the data from\r
-                                head or tail. TRUE for from head, and FALSE for\r
-                                from tail.\r
+  @param[in, out]  Nbuf                  Pointer to the net buffer.\r
+  @param[in]       Len                   The length of the buffer to be allocated.\r
+  @param [in]      FromHead              The flag to indicate whether reserve the data from\r
+                                         head or tail. TRUE for from head, and FALSE for\r
+                                         from tail.\r
 \r
-  @retval *                     Pointer to the first byte of the allocated buffer.\r
+  @return                       Pointer to the first byte of the allocated buffer.\r
 \r
 **/\r
 UINT8  *\r
 EFIAPI\r
 NetbufAllocSpace (\r
-  IN NET_BUF                *Nbuf,\r
+  IN OUT NET_BUF            *Nbuf,\r
   IN UINT32                 Len,\r
   IN BOOLEAN                FromHead\r
   );\r
@@ -1049,18 +1042,18 @@ NetbufAllocSpace (
 /**\r
   Trim some data from the header or tail of the buffer.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer.\r
-  @param  Len                   The length of the data to be trimmed.\r
-  @param  FromHead              The flag to indicate whether trim data from head or\r
-                                tail. TRUE for from head, and FALSE for from tail.\r
+  @param[in, out]  Nbuf                  Pointer to the net buffer.\r
+  @param[in]       Len                   The length of the data to be trimmed.\r
+  @param[in]      FromHead               The flag to indicate whether trim data from head or\r
+                                         tail. TRUE for from head, and FALSE for from tail.\r
 \r
-  @retval UINTN                 Length of the actually trimmed data.\r
+  @return    Length of the actually trimmed data.\r
 \r
 **/\r
 UINT32\r
 EFIAPI\r
 NetbufTrim (\r
-  IN NET_BUF                *Nbuf,\r
+  IN OUT NET_BUF            *Nbuf,\r
   IN UINT32                 Len,\r
   IN BOOLEAN                FromHead\r
   );\r
@@ -1068,10 +1061,10 @@ NetbufTrim (
 /**\r
   Copy the data from the specific offset to the destination.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer.\r
-  @param  Offset                The sequence number of the first byte to copy.\r
-  @param  Len                   Length of the data to copy.\r
-  @param  Dest                  The destination of the data to copy to.\r
+  @param[in]   Nbuf                  Pointer to the net buffer.\r
+  @param[in]   Offset                The sequence number of the first byte to copy.\r
+  @param[in]   Len                   Length of the data to copy.\r
+  @param[in]   Dest                  The destination of the data to copy to.\r
 \r
   @retval UINTN                 The length of the copied data.\r
 \r
@@ -1088,17 +1081,17 @@ NetbufCopy (
 /**\r
   Build a NET_BUF from external blocks.\r
 \r
-  @param  ExtFragment           Pointer to the data block.\r
-  @param  ExtNum                The number of the data block.\r
-  @param  HeadSpace             The head space to be reserved.\r
-  @param  HeadLen               The length of the protocol header, This function\r
-                                will pull that number of data into a linear block.\r
-  @param  ExtFree               Pointer to the caller provided free function.\r
-  @param  Arg                   The argument passed to ExtFree when ExtFree is\r
-                                called.\r
+  @param[in]  ExtFragment           Pointer to the data block.\r
+  @param[in]  ExtNum                The number of the data block.\r
+  @param[in]  HeadSpace             The head space to be reserved.\r
+  @param[in]  HeadLen               The length of the protocol header, This function\r
+                                    will pull that number of data into a linear block.\r
+  @param[in]  ExtFree               Pointer to the caller provided free function.\r
+  @param[in]  Arg                   The argument passed to ExtFree when ExtFree is\r
+                                    called.\r
 \r
-  @retval *                     Pointer to the net buffer built from the data\r
-                                blocks.\r
+  @return                    Pointer to the net buffer built from the data blocks.\r
+                             If NULL, the allocation failed due to resource limit.\r
 \r
 **/\r
 NET_BUF  *\r
@@ -1116,11 +1109,11 @@ NetbufFromExt (
   Build a fragment table to contain the fragments in the\r
   buffer. This is the opposite of the NetbufFromExt.\r
 \r
-  @param  Nbuf                  Point to the net buffer\r
-  @param  ExtFragment           Pointer to the data block.\r
-  @param  ExtNum                The number of the data block.\r
+  @param[in]       Nbuf                  Point to the net buffer.\r
+  @param[in, out]  ExtFragment           Pointer to the data block.\r
+  @param[in, out]  ExtNum                The number of the data block.\r
 \r
-  @retval EFI_BUFFER_TOO_SMALL  The number of non-empty block is bigger than ExtNum\r
+  @retval EFI_BUFFER_TOO_SMALL  The number of non-empty block is bigger than ExtNum.\r
   @retval EFI_SUCCESS           Fragment table built.\r
 \r
 **/\r
@@ -1128,22 +1121,22 @@ EFI_STATUS
 EFIAPI\r
 NetbufBuildExt (\r
   IN NET_BUF                *Nbuf,\r
-  IN NET_FRAGMENT           *ExtFragment,\r
-  IN UINT32                 *ExtNum\r
+  IN OUT NET_FRAGMENT       *ExtFragment,\r
+  IN OUT UINT32             *ExtNum\r
   );\r
 \r
 /**\r
   Build a NET_BUF from a list of NET_BUF.\r
 \r
-  @param  BufList               A List of NET_BUF.\r
-  @param  HeadSpace             The head space to be reserved.\r
-  @param  HeaderLen             The length of the protocol header, This function\r
-                                will pull that number of data into a linear block.\r
-  @param  ExtFree               Pointer to the caller provided free function.\r
-  @param  Arg                   The argument passed to ExtFree when ExtFree is\r
-                                called.\r
+  @param[in]   BufList               A List of NET_BUF.\r
+  @param[in]   HeadSpace             The head space to be reserved.\r
+  @param[in]   HeaderLen             The length of the protocol header, This function\r
+                                     will pull that number of data into a linear block.\r
+  @param[in]   ExtFree               Pointer to the caller provided free function.\r
+  @param[in]   Arg                   The argument passed to ExtFree when ExtFree is\r
+                                     called.\r
 \r
-  @retval *                     Pointer to the net buffer built from the data\r
+  @return                       Pointer to the net buffer built from the data\r
                                 blocks.\r
 \r
 **/\r
@@ -1154,43 +1147,38 @@ NetbufFromBufList (
   IN UINT32                 HeadSpace,\r
   IN UINT32                 HeaderLen,\r
   IN NET_VECTOR_EXT_FREE    ExtFree,\r
-  IN VOID                   *Arg                OPTIONAL\r
+  IN VOID                   *Arg              OPTIONAL\r
   );\r
 \r
 /**\r
   Free a list of net buffers.\r
 \r
-  @param  Head                  Pointer to the head of linked net buffers.\r
-\r
-  @return None.\r
+  @param[in, out]  Head              Pointer to the head of linked net buffers.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetbufFreeList (\r
-  IN LIST_ENTRY             *Head\r
+  IN OUT LIST_ENTRY         *Head\r
   );\r
 \r
 /**\r
   Initiate the net buffer queue.\r
 \r
-  @param  NbufQue               Pointer to the net buffer queue to be initiated.\r
-\r
-  @return None.\r
+  @param[in, out]  NbufQue               Pointer to the net buffer queue to be initiated.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetbufQueInit (\r
-  IN NET_BUF_QUEUE          *NbufQue\r
+  IN OUT NET_BUF_QUEUE          *NbufQue\r
   );\r
 \r
 /**\r
   Allocate an initialized net buffer queue.\r
 \r
-  None.\r
-\r
-  @retval *                     Pointer to the allocated net buffer queue.\r
+  @return                       Pointer to the allocated net buffer queue.If NULL, the\r
+                                allocation failed due to resource limit.\r
 \r
 **/\r
 NET_BUF_QUEUE  *\r
@@ -1202,9 +1190,7 @@ NetbufQueAlloc (
 /**\r
   Free a net buffer queue.\r
 \r
-  @param  NbufQue               Poitner to the net buffer queue to be freed.\r
-\r
-  @return None.\r
+  @param[in]  NbufQue               Poitner to the net buffer queue to be freed.\r
 \r
 **/\r
 VOID\r
@@ -1216,43 +1202,43 @@ NetbufQueFree (
 /**\r
   Remove a net buffer from head in the specific queue.\r
 \r
-  @param  NbufQue               Pointer to the net buffer queue.\r
+  @param[in, out]  NbufQue               Pointer to the net buffer queue.\r
 \r
-  @retval *                     Pointer to the net buffer removed from the specific\r
+  @return                       Pointer to the net buffer removed from the specific\r
+                                queue. If NULL, there is no net buffer in the specific\r
                                 queue.\r
 \r
 **/\r
 NET_BUF  *\r
 EFIAPI\r
 NetbufQueRemove (\r
-  IN NET_BUF_QUEUE          *NbufQue\r
+  IN OUT NET_BUF_QUEUE          *NbufQue\r
   );\r
 \r
 /**\r
   Append a buffer to the end of the queue.\r
 \r
-  @param  NbufQue               Pointer to the net buffer queue.\r
-  @param  Nbuf                  Pointer to the net buffer to be appended.\r
-\r
-  @return None.\r
+  @param[in, out]  NbufQue               Pointer to the net buffer queue.\r
+  @param[in, out]  Nbuf                  Pointer to the net buffer to be appended.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetbufQueAppend (\r
-  IN NET_BUF_QUEUE          *NbufQue,\r
-  IN NET_BUF                *Nbuf\r
+  IN OUT NET_BUF_QUEUE          *NbufQue,\r
+  IN OUT NET_BUF                *Nbuf\r
   );\r
 \r
 /**\r
   Copy some data from the buffer queue to the destination.\r
 \r
-  @param  NbufQue               Pointer to the net buffer queue.\r
-  @param  Offset                The sequence number of the first byte to copy.\r
-  @param  Len                   Length of the data to copy.\r
-  @param  Dest                  The destination of the data to copy to.\r
+  @param[in]   NbufQue               Pointer to the net buffer queue.\r
+  @param[in]   Offset                The sequence number of the first byte to copy.\r
+  @param[in]   Len                   Length of the data to copy.\r
+  @param[out]  Dest                  The destination of the data to copy to.\r
 \r
-  @retval UINTN                 The length of the copied data.\r
+  @return       The length of the copied data. If 0, then the length is zero or offset \r
+                suppress the total size of net buffer.\r
 \r
 **/\r
 UINT32\r
@@ -1261,23 +1247,23 @@ NetbufQueCopy (
   IN NET_BUF_QUEUE          *NbufQue,\r
   IN UINT32                 Offset,\r
   IN UINT32                 Len,\r
-  IN UINT8                  *Dest\r
+  OUT UINT8                 *Dest\r
   );\r
 \r
 /**\r
   Trim some data from the queue header, release the buffer if\r
   whole buffer is trimmed.\r
 \r
-  @param  NbufQue               Pointer to the net buffer queue.\r
-  @param  Len                   Length of the data to trim.\r
+  @param[in, out]  NbufQue               Pointer to the net buffer queue.\r
+  @param[in]       Len                   Length of the data to trim.\r
 \r
-  @retval UINTN                 The length of the data trimmed.\r
+  @return   The length of the data trimmed, or 0 if length of the data to trim is zero.\r
 \r
 **/\r
 UINT32\r
 EFIAPI\r
 NetbufQueTrim (\r
-  IN NET_BUF_QUEUE          *NbufQue,\r
+  IN OUT NET_BUF_QUEUE      *NbufQue,\r
   IN UINT32                 Len\r
   );\r
 \r
@@ -1285,24 +1271,22 @@ NetbufQueTrim (
 /**\r
   Flush the net buffer queue.\r
 \r
-  @param  NbufQue               Pointer to the queue to be flushed.\r
-\r
-  @return None.\r
+  @param[in, out]  NbufQue               Pointer to the queue to be flushed.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 NetbufQueFlush (\r
-  IN NET_BUF_QUEUE          *NbufQue\r
+  IN OUT NET_BUF_QUEUE          *NbufQue\r
   );\r
 \r
 /**\r
   Compute checksum for a bulk of data.\r
 \r
-  @param  Bulk                  Pointer to the data.\r
-  @param  Len                   Length of the data, in bytes.\r
+  @param[in]   Bulk                  Pointer to the data.\r
+  @param[in]   Len                   Length of the data, in bytes.\r
 \r
-  @retval UINT16                The computed checksum.\r
+  @return    The computed checksum.\r
 \r
 **/\r
 UINT16\r
@@ -1315,10 +1299,10 @@ NetblockChecksum (
 /**\r
   Add two checksums.\r
 \r
-  @param  Checksum1             The first checksum to be added.\r
-  @param  Checksum2             The second checksum to be added.\r
+  @param[in]   Checksum1             The first checksum to be added.\r
+  @param[in]   Checksum2             The second checksum to be added.\r
 \r
-  @retval UINT16                The new checksum.\r
+  @return         The new checksum.\r
 \r
 **/\r
 UINT16\r
@@ -1331,9 +1315,9 @@ NetAddChecksum (
 /**\r
   Compute the checksum for a NET_BUF.\r
 \r
-  @param  Nbuf                  Pointer to the net buffer.\r
+  @param[in]   Nbuf                  Pointer to the net buffer.\r
 \r
-  @retval UINT16                The computed checksum.\r
+  @return    The computed checksum.\r
 \r
 **/\r
 UINT16\r
@@ -1347,12 +1331,12 @@ NetbufChecksum (
   Src, Dst are in network byte order. and Len is\r
   in host byte order.\r
 \r
-  @param  Src                   The source address of the packet.\r
-  @param  Dst                   The destination address of the packet.\r
-  @param  Proto                 The protocol type of the packet.\r
-  @param  Len                   The length of the packet.\r
+  @param[in]   Src                   The source address of the packet.\r
+  @param[in]   Dst                   The destination address of the packet.\r
+  @param[in]   Proto                 The protocol type of the packet.\r
+  @param[in]   Len                   The length of the packet.\r
 \r
-  @retval UINT16                The computed checksum.\r
+  @return   The computed checksum.\r
 \r
 **/\r
 UINT16\r