]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiTcp4Io.c
index a2f17a63fb49a688e77265a51a7e722c8414554d..901b38e92fc0c0e479fb16ad48d5f58d74debded 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
-  The wrap of TCP/IP Socket interface\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
+Copyright (c) 2004 - 2018, 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
@@ -10,26 +10,15 @@ 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
-Module Name:\r
-\r
-  IScsiTcp4Io.c\r
-\r
-Abstract:\r
-  The wrap of TCP/IP Socket interface\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
+  The common notify function associated with various Tcp4Io events.\r
 \r
+  @param[in]  Event   The event signaled.\r
+  @param[in]  Context The context.\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -42,20 +31,15 @@ Tcp4IoCommonNotify (
 }\r
 \r
 /**\r
-  Create a TCP socket with the specified configuration data. \r
-\r
-  @param  Image[in]      The handle of the driver image.\r
-\r
-  @param  Controller[in] The handle of the controller.\r
+  Create a TCP socket with the specified configuration data.\r
 \r
-  @param  ConfigData[in] The Tcp4 configuration data.\r
+  @param[in]  Image      The handle of the driver image.\r
+  @param[in]  Controller The handle of the controller.\r
+  @param[in]  ConfigData The Tcp4 configuration data.\r
+  @param[in]  Tcp4Io     The Tcp4Io.\r
 \r
-  @param  Tcp4Io[in]     The Tcp4Io.\r
-  \r
   @retval EFI_SUCCESS    The TCP socket is created and configured.\r
-\r
-  @retval Other          Failed to create the TCP socket or configure it.\r
-\r
+  @retval Others         Failed to create the TCP socket or configure it.\r
 **/\r
 EFI_STATUS\r
 Tcp4IoCreateSocket (\r
@@ -246,12 +230,9 @@ ON_ERROR:
 }\r
 \r
 /**\r
-  Destroy the socket. \r
+  Destroy the socket.\r
 \r
   @param[in]  Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.\r
-\r
-  @retval     None.\r
-\r
 **/\r
 VOID\r
 Tcp4IoDestroySocket (\r
@@ -286,17 +267,17 @@ Tcp4IoDestroySocket (
 /**\r
   Connect to the other endpoint of the TCP socket.\r
 \r
-  @param  Tcp4Io[in]  The Tcp4Io wrapping the TCP socket.\r
-\r
-  @param  Timeout[in] The time to wait for connection done.\r
-\r
-  @retval None.\r
+  @param[in, out]  Tcp4Io    The Tcp4Io wrapping the TCP socket.\r
+  @param[in]       Timeout   The time to wait for connection done.\r
 \r
+  @retval EFI_SUCCESS          Connect to the other endpoint of the TCP socket successfully.\r
+  @retval EFI_TIMEOUT          Failed to connect to the other endpoint of the TCP socket in the                               specified time period.\r
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 Tcp4IoConnect (\r
-  IN TCP4_IO    *Tcp4Io,\r
-  IN EFI_EVENT  Timeout\r
+  IN OUT TCP4_IO    *Tcp4Io,\r
+  IN EFI_EVENT      Timeout\r
   )\r
 {\r
   EFI_TCP4_PROTOCOL *Tcp4;\r
@@ -325,14 +306,11 @@ Tcp4IoConnect (
 /**\r
   Reset the socket.\r
 \r
-  @param  Tcp4Io[in] The Tcp4Io wrapping the TCP socket.\r
-\r
-  @retval None.\r
-\r
+  @param[in, out]  Tcp4Io The Tcp4Io wrapping the TCP socket.\r
 **/\r
 VOID\r
 Tcp4IoReset (\r
-  IN TCP4_IO  *Tcp4Io\r
+  IN OUT TCP4_IO  *Tcp4Io\r
   )\r
 {\r
   EFI_STATUS        Status;\r
@@ -355,14 +333,12 @@ Tcp4IoReset (
 /**\r
   Transmit the Packet to the other endpoint of the socket.\r
 \r
-  @param  Tcp4Io[in]           The Tcp4Io wrapping the TCP socket.\r
-\r
-  @param  Packet[in]           The packet to transmit\r
+  @param[in]   Tcp4Io          The Tcp4Io wrapping the TCP socket.\r
+  @param[in]   Packet          The packet to transmit.\r
 \r
   @retval EFI_SUCCESS          The packet is trasmitted.\r
-\r
   @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
-\r
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 Tcp4IoTransmit (\r
@@ -410,7 +386,7 @@ Tcp4IoTransmit (
 \r
 ON_EXIT:\r
 \r
-  gBS->FreePool (TxData);\r
+  FreePool (TxData);\r
 \r
   return Status;\r
 }\r
@@ -418,22 +394,17 @@ ON_EXIT:
 /**\r
   Receive data from the socket.\r
 \r
-  @param  Tcp4Io[in]           The Tcp4Io which wraps the socket to be destroyeds.\r
-\r
-  @param  Packet[in]           The buffer to hold the data copy from the soket rx buffer.\r
-\r
-  @param  AsyncMode[in]        Is this receive asyncronous or not.\r
-\r
-  @param  Timeout[in]          The time to wait for receiving the amount of data the Packet\r
+  @param[in]  Tcp4Io           The Tcp4Io which wraps the socket to be destroyed.\r
+  @param[in]  Packet           The buffer to hold the data copy from the soket rx buffer.\r
+  @param[in]  AsyncMode        Is this receive asyncronous or not.\r
+  @param[in]  Timeout          The time to wait for receiving the amount of data the Packet\r
                                can hold.\r
 \r
   @retval EFI_SUCCESS          The required amount of data is received from the socket.\r
-\r
   @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.\r
-\r
   @retval EFI_TIMEOUT          Failed to receive the required amount of data in the\r
                                specified time period.\r
-\r
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 Tcp4IoReceive (\r
@@ -509,8 +480,8 @@ Tcp4IoReceive (
   }\r
 \r
 ON_EXIT:\r
-\r
-  gBS->FreePool (Fragment);\r
+  Tcp4Io->RxToken.Packet.RxData = NULL;\r
+  FreePool (Fragment);\r
 \r
   return Status;\r
 }\r