]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c
sync comments, fix function header, rename variable name to follow coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiTcp4Io.c
index 06caf72166749d20e32296b64ca1979732a1cac3..a2f17a63fb49a688e77265a51a7e722c8414554d 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The wrap of TCP/IP Socket interface\r
 \r
 Copyright (c) 2004 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,37 +15,48 @@ Module Name:
   IScsiTcp4Io.c\r
 \r
 Abstract:\r
+  The wrap of TCP/IP Socket interface\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
+/**\r
+  The common notify function associated with various Tcp4Io events. \r
+\r
+  @param  Event[in]   The event signaled.\r
+\r
+  @param  Contect[in] The context.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 Tcp4IoCommonNotify (\r
   IN EFI_EVENT  Event,\r
   IN VOID       *Context\r
   )\r
-/*++\r
-\r
-Routine Description:\r
+{\r
+  *((BOOLEAN *) Context) = TRUE;\r
+}\r
 \r
-  The common notify function associated with various Tcp4Io events. \r
+/**\r
+  Create a TCP socket with the specified configuration data. \r
 \r
-Arguments:\r
+  @param  Image[in]      The handle of the driver image.\r
 \r
-  Event   - The event signaled.\r
-  Contect - The context.\r
+  @param  Controller[in] The handle of the controller.\r
 \r
-Returns:\r
+  @param  ConfigData[in] The Tcp4 configuration data.\r
 \r
-  None.\r
+  @param  Tcp4Io[in]     The Tcp4Io.\r
+  \r
+  @retval EFI_SUCCESS    The TCP socket is created and configured.\r
 \r
---*/\r
-{\r
-  *((BOOLEAN *) Context) = TRUE;\r
-}\r
+  @retval Other          Failed to create the TCP socket or configure it.\r
 \r
+**/\r
 EFI_STATUS\r
 Tcp4IoCreateSocket (\r
   IN EFI_HANDLE           Image,\r
@@ -52,25 +64,6 @@ Tcp4IoCreateSocket (
   IN TCP4_IO_CONFIG_DATA  *ConfigData,\r
   IN TCP4_IO              *Tcp4Io\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a TCP socket with the specified configuration data. \r
-\r
-Arguments:\r
-\r
-  Image      - The handle of the driver image.\r
-  Controller - The handle of the controller.\r
-  ConfigData - The Tcp4 configuration data.\r
-  Tcp4Io     - The Tcp4Io.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The TCP socket is created and configured.\r
-  other       - Failed to create the TCP socket or configure it.\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   EFI_TCP4_PROTOCOL     *Tcp4;\r
@@ -169,7 +162,7 @@ Returns:
   // Create events for variuos asynchronous operations.\r
   //\r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_NOTIFY_SIGNAL,\r
+                  EVT_NOTIFY_SIGNAL,\r
                   TPL_NOTIFY,\r
                   Tcp4IoCommonNotify,\r
                   &Tcp4Io->IsConnDone,\r
@@ -180,7 +173,7 @@ Returns:
   }\r
 \r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_NOTIFY_SIGNAL,\r
+                  EVT_NOTIFY_SIGNAL,\r
                   TPL_NOTIFY,\r
                   Tcp4IoCommonNotify,\r
                   &Tcp4Io->IsTxDone,\r
@@ -191,7 +184,7 @@ Returns:
   }\r
 \r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_NOTIFY_SIGNAL,\r
+                  EVT_NOTIFY_SIGNAL,\r
                   TPL_NOTIFY,\r
                   Tcp4IoCommonNotify,\r
                   &Tcp4Io->IsRxDone,\r
@@ -202,7 +195,7 @@ Returns:
   }\r
 \r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_NOTIFY_SIGNAL,\r
+                  EVT_NOTIFY_SIGNAL,\r
                   TPL_NOTIFY,\r
                   Tcp4IoCommonNotify,\r
                   &Tcp4Io->IsCloseDone,\r
@@ -252,25 +245,18 @@ ON_ERROR:
   return Status;\r
 }\r
 \r
-VOID\r
-Tcp4IoDestroySocket (\r
-  IN TCP4_IO  *Tcp4Io\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Destroy the socket. \r
 \r
-Arguments:\r
+  @param[in]  Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.\r
 \r
-  Tcp4Io - The Tcp4Io which wraps the socket to be destroyeds.\r
+  @retval     None.\r
 \r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+Tcp4IoDestroySocket (\r
+  IN TCP4_IO  *Tcp4Io\r
+  )\r
 {\r
   EFI_TCP4_PROTOCOL *Tcp4;\r
 \r
@@ -297,27 +283,21 @@ Returns:
     );\r
 }\r
 \r
-EFI_STATUS\r
-Tcp4IoConnect (\r
-  IN TCP4_IO    *Tcp4Io,\r
-  IN EFI_EVENT  Timeout\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Connect to the other endpoint of the TCP socket.\r
 \r
-Arguments:\r
-\r
-  Tcp4Io  - The Tcp4Io wrapping the TCP socket.\r
-  Timeout - The time to wait for connection done.\r
+  @param  Tcp4Io[in]  The Tcp4Io wrapping the TCP socket.\r
 \r
-Returns:\r
+  @param  Timeout[in] The time to wait for connection done.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+Tcp4IoConnect (\r
+  IN TCP4_IO    *Tcp4Io,\r
+  IN EFI_EVENT  Timeout\r
+  )\r
 {\r
   EFI_TCP4_PROTOCOL *Tcp4;\r
   EFI_STATUS        Status;\r
@@ -342,25 +322,18 @@ Returns:
   return Status;\r
 }\r
 \r
-VOID\r
-Tcp4IoReset (\r
-  IN TCP4_IO  *Tcp4Io\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Reset the socket.\r
 \r
-Arguments:\r
-\r
-  Tcp4Io - The Tcp4Io wrapping the TCP socket.\r
-\r
-Returns:\r
+  @param  Tcp4Io[in] The Tcp4Io wrapping the TCP socket.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+Tcp4IoReset (\r
+  IN TCP4_IO  *Tcp4Io\r
+  )\r
 {\r
   EFI_STATUS        Status;\r
   EFI_TCP4_PROTOCOL *Tcp4;\r
@@ -379,28 +352,23 @@ Returns:
   }\r
 }\r
 \r
-EFI_STATUS\r
-Tcp4IoTransmit (\r
-  IN TCP4_IO  *Tcp4Io,\r
-  IN NET_BUF  *Packet\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Transmit the Packet to the other endpoint of the socket.\r
 \r
-Arguments:\r
+  @param  Tcp4Io[in]           The Tcp4Io wrapping the TCP socket.\r
 \r
-  Tcp4Io - The Tcp4Io wrapping the TCP socket.\r
-  Packet - The packet to transmit\r
+  @param  Packet[in]           The packet to transmit\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The packet is trasmitted.\r
 \r
-  EFI_SUCCESS          - The packet is trasmitted.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+Tcp4IoTransmit (\r
+  IN TCP4_IO  *Tcp4Io,\r
+  IN NET_BUF  *Packet\r
+  )\r
 {\r
   EFI_TCP4_TRANSMIT_DATA  *TxData;\r
   EFI_TCP4_PROTOCOL       *Tcp4;\r
@@ -447,35 +415,33 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-Tcp4IoReceive (\r
-  IN TCP4_IO    *Tcp4Io,\r
-  IN NET_BUF    *Packet,\r
-  IN BOOLEAN    AsyncMode,\r
-  IN EFI_EVENT  Timeout\r
-  )\r
-/*++\r
+/**\r
+  Receive data from the socket.\r
 \r
-Routine Description:\r
+  @param  Tcp4Io[in]           The Tcp4Io which wraps the socket to be destroyeds.\r
 \r
-  Receive data from the socket.\r
+  @param  Packet[in]           The buffer to hold the data copy from the soket rx buffer.\r
 \r
-Arguments:\r
+  @param  AsyncMode[in]        Is this receive asyncronous or not.\r
 \r
-  Tcp4Io    - The Tcp4Io which wraps the socket to be destroyeds.\r
-  Packet    - The buffer to hold the data copy from the soket rx buffer.\r
-  AsyncMode - Is this receive asyncronous or not.\r
-  Timeout   - The time to wait for receiving the amount of data the Packet\r
-              can hold.\r
+  @param  Timeout[in]          The time to wait for receiving the amount of data the Packet\r
+                               can hold.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The required amount of data is received from the socket.\r
 \r
-  EFI_SUCCESS          - The required amount of data is received from the socket.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate momery.\r
-  EFI_TIMEOUT          - Failed to receive the required amount of data in the\r
-                         specified time period.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.\r
 \r
---*/\r
+  @retval EFI_TIMEOUT          Failed to receive the required amount of data in the\r
+                               specified time period.\r
+\r
+**/\r
+EFI_STATUS\r
+Tcp4IoReceive (\r
+  IN TCP4_IO    *Tcp4Io,\r
+  IN NET_BUF    *Packet,\r
+  IN BOOLEAN    AsyncMode,\r
+  IN EFI_EVENT  Timeout\r
+  )\r
 {\r
   EFI_TCP4_PROTOCOL     *Tcp4;\r
   EFI_TCP4_RECEIVE_DATA RxData;\r