]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Library / DxeTcpIoLib / DxeTcpIoLib.c
index fd85d0e78778698f794a7f0fc14d27c13ce70e64..341295d0b7afd49874c5ee3a2aa01579820fca90 100644 (file)
@@ -2,14 +2,8 @@
   This library is used to share code between UEFI network stack modules.\r
   It provides the helper routines to access TCP service.\r
 \r
-Copyright (c) 2010 - 2017, 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<BR>\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-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
+Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -23,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseMemoryLib.h>\r
 \r
 /**\r
-  The common notify function associated with various TcpIo events. \r
+  The common notify function associated with various TcpIo events.\r
 \r
   @param[in]  Event   The event signaled.\r
   @param[in]  Context The context.\r
@@ -111,14 +105,14 @@ ON_EXIT:
 }\r
 \r
 /**\r
-  Create a TCP socket with the specified configuration data. \r
+  Create a TCP socket with the specified configuration data.\r
 \r
   @param[in]  Image      The handle of the driver image.\r
   @param[in]  Controller The handle of the controller.\r
   @param[in]  TcpVersion The version of Tcp, TCP_VERSION_4 or TCP_VERSION_6.\r
   @param[in]  ConfigData The Tcp configuration data.\r
   @param[out] TcpIo      The TcpIo.\r
-  \r
+\r
   @retval EFI_SUCCESS            The TCP socket is created and configured.\r
   @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
   @retval EFI_UNSUPPORTED        One or more of the control options are not\r
@@ -176,7 +170,7 @@ TcpIoCreateSocket (
 \r
   //\r
   // Create the TCP child instance and get the TCP protocol.\r
-  //  \r
+  //\r
   Status = NetLibCreateServiceChild (\r
              Controller,\r
              Image,\r
@@ -395,9 +389,9 @@ ON_ERROR:
 \r
   return Status;\r
 }\r
-  \r
+\r
 /**\r
-  Destroy the socket. \r
+  Destroy the socket.\r
 \r
   @param[in]  TcpIo The TcpIo which wraps the socket to be destroyed.\r
 \r
@@ -531,7 +525,7 @@ TcpIoDestroySocket (
 \r
   @param[in, out]  TcpIo     The TcpIo wrapping the TCP socket.\r
   @param[in]       Timeout   The time to wait for connection done. Set to NULL for infinite wait.\r
-  \r
+\r
   @retval EFI_SUCCESS            Connect to the other endpoint of the TCP socket\r
                                  successfully.\r
   @retval EFI_TIMEOUT            Failed to connect to the other endpoint of the\r
@@ -604,7 +598,7 @@ TcpIoConnect (
   @param[in, out]  TcpIo     The TcpIo wrapping the TCP socket.\r
   @param[in]       Timeout   The time to wait for connection done. Set to NULL for infinite wait.\r
 \r
-  \r
+\r
   @retval EFI_SUCCESS            Connect to the other endpoint of the TCP socket\r
                                  successfully.\r
   @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
@@ -671,7 +665,7 @@ TcpIoAccept (
   }\r
 \r
   //\r
-  // The new TCP instance handle created for the established connection is \r
+  // The new TCP instance handle created for the established connection is\r
   // in ListenToken.\r
   //\r
   if (!EFI_ERROR (Status)) {\r
@@ -680,7 +674,7 @@ TcpIoAccept (
     } else {\r
       ProtocolGuid = &gEfiTcp6ProtocolGuid;\r
     }\r
-    \r
+\r
     Status = gBS->OpenProtocol (\r
                     TcpIo->ListenToken.Tcp4Token.NewChildHandle,\r
                     ProtocolGuid,\r
@@ -719,7 +713,7 @@ TcpIoReset (
   Tcp4               = NULL;\r
   Tcp6               = NULL;\r
 \r
-  if (TcpIo->TcpVersion == TCP_VERSION_4) { \r
+  if (TcpIo->TcpVersion == TCP_VERSION_4) {\r
     TcpIo->CloseToken.Tcp4Token.AbortOnClose = TRUE;\r
     Tcp4 = TcpIo->Tcp.Tcp4;\r
     Status = Tcp4->Close (Tcp4, &TcpIo->CloseToken.Tcp4Token);\r
@@ -744,13 +738,13 @@ TcpIoReset (
   }\r
 }\r
 \r
-  \r
+\r
 /**\r
   Transmit the Packet to the other endpoint of the socket.\r
 \r
   @param[in]   TcpIo           The TcpIo wrapping the TCP socket.\r
   @param[in]   Packet          The packet to transmit.\r
-  \r
+\r
   @retval EFI_SUCCESS            The packet is trasmitted.\r
   @retval EFI_INVALID_PARAMETER  One or more parameters are invalid.\r
   @retval EFI_UNSUPPORTED        One or more of the control options are not\r
@@ -779,7 +773,7 @@ TcpIoTransmit (
 \r
   if (TcpIo->TcpVersion == TCP_VERSION_4) {\r
 \r
-    Size = sizeof (EFI_TCP4_TRANSMIT_DATA) + \r
+    Size = sizeof (EFI_TCP4_TRANSMIT_DATA) +\r
            (Packet->BlockOpNum - 1) * sizeof (EFI_TCP4_FRAGMENT_DATA);\r
   } else if (TcpIo->TcpVersion == TCP_VERSION_6) {\r
     Size = sizeof (EFI_TCP6_TRANSMIT_DATA) +\r
@@ -825,7 +819,7 @@ TcpIoTransmit (
     if (Tcp4 == NULL) {\r
       goto ON_EXIT;\r
     }\r
-    \r
+\r
     Status  = Tcp4->Transmit (Tcp4, &TcpIo->TxToken.Tcp4Token);\r
   } else {\r
     TcpIo->TxToken.Tcp6Token.Packet.TxData = (EFI_TCP6_TRANSMIT_DATA *) Data;\r
@@ -929,7 +923,7 @@ TcpIoReceive (
     }\r
 \r
     if (Tcp6 == NULL) {\r
-      return EFI_DEVICE_ERROR; \r
+      return EFI_DEVICE_ERROR;\r
     }\r
 \r
   } else {\r
@@ -961,11 +955,11 @@ TcpIoReceive (
     } else {\r
       Status = Tcp6->Receive (Tcp6, &TcpIo->RxToken.Tcp6Token);\r
     }\r
-    \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto ON_EXIT;\r
     }\r
-    \r
+\r
     while (!TcpIo->IsRxDone && ((Timeout == NULL) || EFI_ERROR (gBS->CheckEvent (Timeout)))) {\r
       //\r
       // Poll until some data is received or an error occurs.\r