]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Main.c
index 8a8cd8a9e377fa45a5abfd46ed6fd5194f711e1c..d8fc68c0a97d2e189ad1c7ac2f6f921152630bd4 100644 (file)
@@ -1,25 +1,18 @@
 /** @file\r
+  Implementation of TCP4 protocol services.\r
 \r
-Copyright (c) 2005 - 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 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
+http://opensource.org/licenses/bsd-license.php<BR>\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
 \r
-Module Name:\r
-\r
-  Tcp4Main.c\r
-\r
-Abstract:\r
-\r
-  Implementation of TCP4 protocol services.\r
-\r
-\r
 **/\r
 \r
+\r
 #include "Tcp4Main.h"\r
 \r
 \r
@@ -35,7 +28,6 @@ Abstract:
   @retval EFI_INVALID_PARAMETER    The integrity check is failed.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 Tcp4ChkDataBuf (\r
   IN UINT32                 DataLen,\r
@@ -48,7 +40,7 @@ Tcp4ChkDataBuf (
   UINT32 Len;\r
 \r
   for (Index = 0, Len = 0; Index < FragmentCount; Index++) {\r
-    Len = Len + FragmentTable[Index].FragmentLength;\r
+    Len = Len + (UINT32) FragmentTable[Index].FragmentLength;\r
   }\r
 \r
   if (DataLen != Len) {\r
@@ -62,13 +54,18 @@ Tcp4ChkDataBuf (
 /**\r
   Get the current operational status.\r
 \r
+  The GetModeData() function copies the current operational settings of this\r
+  EFI TCPv4 Protocol instance into user-supplied buffers. This function can\r
+  also be used to retrieve the operational setting of underlying drivers\r
+  such as IPv4, MNP, or SNP.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance.\r
   @param  Tcp4State                Pointer to the buffer to receive the current TCP\r
                                    state.\r
   @param  Tcp4ConfigData           Pointer to the buffer to receive the current TCP\r
                                    configuration.\r
-  @param  Ip4ModeData              Pointer to the buffer to receive the current\r
-                                   IPv4 configuration.\r
+  @param  Ip4ModeData              Pointer to the buffer to receive the current IPv4\r
+                                   configuration data used by the TCPv4 instance.\r
   @param  MnpConfigData            Pointer to the buffer to receive the current MNP\r
                                    configuration data indirectly used by the TCPv4\r
                                    Instance.\r
@@ -85,12 +82,12 @@ Tcp4ChkDataBuf (
 EFI_STATUS\r
 EFIAPI\r
 Tcp4GetModeData (\r
-  IN  CONST EFI_TCP4_PROTOCOL                  * This,\r
-  OUT       EFI_TCP4_CONNECTION_STATE          * Tcp4State OPTIONAL,\r
-  OUT       EFI_TCP4_CONFIG_DATA               * Tcp4ConfigData OPTIONAL,\r
-  OUT       EFI_IP4_MODE_DATA                  * Ip4ModeData OPTIONAL,\r
-  OUT       EFI_MANAGED_NETWORK_CONFIG_DATA    * MnpConfigData OPTIONAL,\r
-  OUT       EFI_SIMPLE_NETWORK_MODE            * SnpModeData OPTIONAL\r
+  IN      EFI_TCP4_PROTOCOL                  *This,\r
+     OUT  EFI_TCP4_CONNECTION_STATE          *Tcp4State       OPTIONAL,\r
+     OUT  EFI_TCP4_CONFIG_DATA               *Tcp4ConfigData  OPTIONAL,\r
+     OUT  EFI_IP4_MODE_DATA                  *Ip4ModeData     OPTIONAL,\r
+     OUT  EFI_MANAGED_NETWORK_CONFIG_DATA    *MnpConfigData   OPTIONAL,\r
+     OUT  EFI_SIMPLE_NETWORK_MODE            *SnpModeData     OPTIONAL\r
   )\r
 {\r
   TCP4_MODE_DATA  TcpMode;\r
@@ -116,6 +113,22 @@ Tcp4GetModeData (
   Initialize or brutally reset the operational parameters for\r
   this EFI TCPv4 instance.\r
 \r
+  The Configure() function does the following:\r
+  * Initialize this EFI TCPv4 instance, i.e., initialize the communication end\r
+  setting, specify active open or passive open for an instance.\r
+  * Reset this TCPv4 instance brutally, i.e., cancel all pending asynchronous\r
+  tokens, flush transmission and receiving buffer directly without informing\r
+  the communication peer.\r
+  No other TCPv4 Protocol operation can be executed by this instance\r
+  until it is configured properly. For an active TCP4 instance, after a proper\r
+  configuration it may call Connect() to initiates the three-way handshake.\r
+  For a passive TCP4 instance, its state will transit to Tcp4StateListen after\r
+  configuration, and Accept() may be called to listen the incoming TCP connection\r
+  request. If TcpConfigData is set to NULL, the instance is reset. Resetting\r
+  process will be done brutally, the state machine will be set to Tcp4StateClosed\r
+  directly, the receive queue and transmit queue will be flushed, and no traffic is\r
+  allowed through this instance.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance.\r
   @param  TcpConfigData            Pointer to the configure data to configure the\r
                                    instance.\r
@@ -137,13 +150,15 @@ Tcp4GetModeData (
 EFI_STATUS\r
 EFIAPI\r
 Tcp4Configure (\r
-  IN EFI_TCP4_PROTOCOL        * This,\r
-  IN EFI_TCP4_CONFIG_DATA     * TcpConfigData OPTIONAL\r
+  IN EFI_TCP4_PROTOCOL        *This,\r
+  IN EFI_TCP4_CONFIG_DATA     *TcpConfigData     OPTIONAL\r
   )\r
 {\r
   EFI_TCP4_OPTION  *Option;\r
   SOCKET           *Sock;\r
   EFI_STATUS       Status;\r
+  IP4_ADDR         Ip;\r
+  IP4_ADDR         SubnetMask;\r
 \r
   if (NULL == This) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -153,26 +168,27 @@ Tcp4Configure (
   // Tcp protocol related parameter check will be conducted here\r
   //\r
   if (NULL != TcpConfigData) {\r
-    if ((EFI_IP4 (TcpConfigData->AccessPoint.RemoteAddress) != 0) &&\r
-      !Ip4IsUnicast (EFI_NTOHL (TcpConfigData->AccessPoint.RemoteAddress), 0)) {\r
+\r
+    CopyMem (&Ip, &TcpConfigData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));\r
+    if (IP4_IS_LOCAL_BROADCAST (NTOHL (Ip))) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+\r
+    if (TcpConfigData->AccessPoint.ActiveFlag &&\r
+      (0 == TcpConfigData->AccessPoint.RemotePort || (Ip == 0))) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
     if (!TcpConfigData->AccessPoint.UseDefaultAddress) {\r
-      if (!Ip4IsUnicast (EFI_NTOHL (TcpConfigData->AccessPoint.StationAddress), 0) ||\r
-          !IP4_IS_VALID_NETMASK (EFI_NTOHL (TcpConfigData->AccessPoint.SubnetMask))\r
-            ) {\r
+\r
+      CopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));\r
+      CopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));\r
+      if (!IP4_IS_VALID_NETMASK (NTOHL (SubnetMask)) ||\r
+          (SubnetMask != 0 && !NetIp4IsUnicast (NTOHL (Ip), NTOHL (SubnetMask)))) {\r
         return EFI_INVALID_PARAMETER;\r
       }\r
     }\r
 \r
-    if (TcpConfigData->AccessPoint.ActiveFlag &&\r
-        (0 == TcpConfigData->AccessPoint.RemotePort ||\r
-        (EFI_IP4 (TcpConfigData->AccessPoint.RemoteAddress) == 0))\r
-        ) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
     Option = TcpConfigData->ControlOption;\r
     if ((NULL != Option) &&\r
         (Option->EnableSelectiveAck || Option->EnablePathMtuDiscovery)) {\r
@@ -199,13 +215,33 @@ Tcp4Configure (
 /**\r
   Add or delete routing entries.\r
 \r
+  The Routes() function adds or deletes a route from the instance's routing table.\r
+  The most specific route is selected by comparing the SubnetAddress with the\r
+  destination IP address's arithmetical AND to the SubnetMask.\r
+  The default route is added with both SubnetAddress and SubnetMask set to 0.0.0.0.\r
+  The default route matches all destination IP addresses if there is no more specific route.\r
+  Direct route is added with GatewayAddress set to 0.0.0.0. Packets are sent to\r
+  the destination host if its address can be found in the Address Resolution Protocol (ARP)\r
+  cache or it is on the local subnet. If the instance is configured to use default\r
+  address, a direct route to the local network will be added automatically.\r
+  Each TCP instance has its own independent routing table. Instance that uses the\r
+  default IP address will have a copy of the EFI_IP4_CONFIG_PROTOCOL's routing table.\r
+  The copy will be updated automatically whenever the IP driver reconfigures its\r
+  instance. As a result, the previous modification to the instance's local copy\r
+  will be lost. The priority of checking the route table is specific with IP\r
+  implementation and every IP implementation must comply with RFC 1122.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance.\r
   @param  DeleteRoute              If TRUE, delete the specified route from routing\r
                                    table; if FALSE, add the specified route to\r
                                    routing table.\r
+                                   DestinationAddress and SubnetMask are used as\r
+                                   the keywords to search route entry.\r
   @param  SubnetAddress            The destination network.\r
   @param  SubnetMask               The subnet mask for the destination network.\r
   @param  GatewayAddress           The gateway address for this route.\r
+                                   It must be on the same subnet with the station\r
+                                   address unless a direct route is specified.\r
 \r
   @retval EFI_SUCCESS              The operation completed successfully.\r
   @retval EFI_NOT_STARTED          The EFI_TCP4_PROTOCOL instance has not been\r
@@ -252,12 +288,22 @@ Tcp4Routes (
 /**\r
   Initiate a nonblocking TCP connection request for an active TCP instance.\r
 \r
+  The Connect() function will initiate an active open to the remote peer configured\r
+  in current TCP instance if it is configured active. If the connection succeeds\r
+  or fails due to any error, the ConnectionToken->CompletionToken.Event will be\r
+  signaled and ConnectionToken->CompletionToken.Status will be updated accordingly.\r
+  This function can only be called for the TCP instance in Tcp4StateClosed state.\r
+  The instance will transfer into Tcp4StateSynSent if the function returns EFI_SUCCESS.\r
+  If TCP three way handshake succeeds, its state will become Tcp4StateEstablished,\r
+  otherwise, the state will return to Tcp4StateClosed.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance\r
   @param  ConnectionToken          Pointer to the connection token to return when\r
                                    the TCP three way handshake finishes.\r
 \r
-  @retval EFI_SUCCESS              The connection request is successfully\r
-                                   initiated.\r
+  @retval EFI_SUCCESS              The connection request is successfully initiated\r
+                                   and the state of this TCPv4 instance has\r
+                                   been changed to Tcp4StateSynSent.\r
   @retval EFI_NOT_STARTED          This EFI_TCP4_PROTOCOL instance hasn't been\r
                                    configured.\r
   @retval EFI_ACCESS_DENIED        The instance is not configured as an active one\r
@@ -292,6 +338,16 @@ Tcp4Connect (
 /**\r
   Listen on the passive instance to accept an incoming connection request.\r
 \r
+  The Accept() function initiates an asynchronous accept request to wait for an\r
+  incoming connection on the passive TCP instance. If a remote peer successfully\r
+  establishes a connection with this instance, a new TCP instance will be created\r
+  and its handle will be returned in ListenToken->NewChildHandle. The newly created\r
+  instance is configured by inheriting the passive instance's configuration and is\r
+  ready for use upon return. The instance is in the Tcp4StateEstablished state.\r
+  The ListenToken->CompletionToken.Event will be signaled when a new connection\r
+  is accepted, user aborts the listen or connection is reset. This function only\r
+  can be called when current TCP instance is in Tcp4StateListen state.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance\r
   @param  ListenToken              Pointer to the listen token to return when\r
                                    operation finishes.\r
@@ -306,7 +362,7 @@ Tcp4Connect (
   @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.\r
   @retval EFI_OUT_OF_RESOURCES     Could not allocate enough resources to finish\r
                                    the operation.\r
-  @retval EFI_DEVICE_ERROR         An unexpected system or network error occurred.\r
+  @retval EFI_DEVICE_ERROR         Any unexpected and not belonged to above category error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -331,26 +387,31 @@ Tcp4Accept (
 \r
 \r
 /**\r
-  Queues outgoing data into the transmit queue\r
+  Queues outgoing data into the transmit queue.\r
+\r
+  The Transmit() function queues a sending request to this TCPv4 instance along\r
+  with the user data. The status of the token is updated and the event in the token\r
+  will be signaled once the data is sent out or some error occurs.\r
 \r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance\r
   @param  Token                    Pointer to the completion token to queue to the\r
                                    transmit queue\r
 \r
-  @retval EFI_SUCCESS              The data has been queued for transmission\r
+  @retval EFI_SUCCESS              The data has been queued for transmission.\r
   @retval EFI_NOT_STARTED          The EFI_TCP4_PROTOCOL instance hasn't been\r
                                    configured.\r
   @retval EFI_NO_MAPPING           When using a default address, configuration\r
                                    (DHCP, BOOTP, RARP, etc.) is not finished yet.\r
-  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid\r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.\r
   @retval EFI_ACCESS_DENIED        One or more of the following conditions is TRUE:\r
                                    * A transmit completion token with the same\r
-                                   Token-> CompletionToken.Event was already in the\r
-                                   transmission queue. * The current instance is in\r
-                                   Tcp4StateClosed state * The current instance is\r
-                                   a passive one and it is in Tcp4StateListen\r
-                                   state. * User has called Close() to disconnect\r
-                                   this connection.\r
+                                     Token-> CompletionToken.Event was already in the\r
+                                     transmission queue.\r
+                                   * The current instance is in Tcp4StateClosed state\r
+                                   * The current instance is a passive one and\r
+                                     it is in Tcp4StateListen state.\r
+                                   * User has called Close() to disconnect this\r
+                                     connection.\r
   @retval EFI_NOT_READY            The completion token could not be queued because\r
                                    the transmit queue is full.\r
   @retval EFI_OUT_OF_RESOURCES     Could not queue the transmit data because of\r
@@ -380,8 +441,8 @@ Tcp4Transmit (
   }\r
 \r
   Status = Tcp4ChkDataBuf (\r
-            Token->Packet.TxData->DataLength,\r
-            Token->Packet.TxData->FragmentCount,\r
+            (UINT32) Token->Packet.TxData->DataLength,\r
+            (UINT32) Token->Packet.TxData->FragmentCount,\r
             Token->Packet.TxData->FragmentTable\r
             );\r
   if (EFI_ERROR (Status)) {\r
@@ -398,11 +459,23 @@ Tcp4Transmit (
 /**\r
   Place an asynchronous receive request into the receiving queue.\r
 \r
+  The Receive() function places a completion token into the receive packet queue.\r
+  This function is always asynchronous. The caller must allocate the\r
+  Token->CompletionToken.Event and the FragmentBuffer used to receive data. He also\r
+  must fill the DataLength which represents the whole length of all FragmentBuffer.\r
+  When the receive operation completes, the EFI TCPv4 Protocol driver updates the\r
+  Token->CompletionToken.Status and Token->Packet.RxData fields and the\r
+  Token->CompletionToken.Event is signaled. If got data the data and its length\r
+  will be copy into the FragmentTable, in the same time the full length of received\r
+  data will be recorded in the DataLength fields. Providing a proper notification\r
+  function and context for the event will enable the user to receive the notification\r
+  and receiving status. That notification function is guaranteed to not be re-entered.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance.\r
   @param  Token                    Pointer to a token that is associated with the\r
                                    receive data descriptor.\r
 \r
-  @retval EFI_SUCCESS              The receive completion token was cached\r
+  @retval EFI_SUCCESS              The receive completion token was cached.\r
   @retval EFI_NOT_STARTED          The EFI_TCP4_PROTOCOL instance hasn't been\r
                                    configured.\r
   @retval EFI_NO_MAPPING           When using a default address, configuration\r
@@ -411,14 +484,17 @@ Tcp4Transmit (
   @retval EFI_OUT_OF_RESOURCES     The receive completion token could not be queued\r
                                    due to a lack of system resources.\r
   @retval EFI_DEVICE_ERROR         An unexpected system or network error occurred.\r
+                                   The EFI TCPv4 Protocol instance has been reset\r
+                                   to startup defaults.\r
   @retval EFI_ACCESS_DENIED        One or more of the following conditions is TRUE:\r
                                    * A receive completion token with the same\r
-                                   Token->CompletionToken.Event was already in the\r
-                                   receive queue. * The current instance is in\r
-                                   Tcp4StateClosed state. * The current instance is\r
-                                   a passive one and it is in Tcp4StateListen\r
-                                   state. * User has called Close() to disconnect\r
-                                   this connection.\r
+                                     Token->CompletionToken.Event was already in\r
+                                     the receive queue.\r
+                                   * The current instance is in Tcp4StateClosed state.\r
+                                   * The current instance is a passive one and it\r
+                                     is in Tcp4StateListen state.\r
+                                   * User has called Close() to disconnect this\r
+                                     connection.\r
   @retval EFI_CONNECTION_FIN       The communication peer has closed the connection\r
                                    and there is no any buffered data in the receive\r
                                    buffer of this instance.\r
@@ -447,8 +523,8 @@ Tcp4Receive (
   }\r
 \r
   Status = Tcp4ChkDataBuf (\r
-            Token->Packet.RxData->DataLength,\r
-            Token->Packet.RxData->FragmentCount,\r
+            (UINT32) Token->Packet.RxData->DataLength,\r
+            (UINT32) Token->Packet.RxData->FragmentCount,\r
             Token->Packet.RxData->FragmentTable\r
             );\r
   if (EFI_ERROR (Status)) {\r
@@ -465,21 +541,30 @@ Tcp4Receive (
 /**\r
   Disconnecting a TCP connection gracefully or reset a TCP connection.\r
 \r
-  @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance\r
+  Initiate an asynchronous close token to TCP driver. After Close() is called,\r
+  any buffered transmission data will be sent by TCP driver and the current\r
+  instance will have a graceful close working flow described as RFC 793 if\r
+  AbortOnClose is set to FALSE, otherwise, a rest packet will be sent by TCP\r
+  driver to fast disconnect this connection. When the close operation completes\r
+  successfully the TCP instance is in Tcp4StateClosed state, all pending\r
+  asynchronous operation is signaled and any buffers used for TCP network traffic\r
+  is flushed.\r
+\r
+  @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance.\r
   @param  CloseToken               Pointer to the close token to return when\r
                                    operation finishes.\r
 \r
-  @retval EFI_SUCCESS              The operation completed successfully\r
+  @retval EFI_SUCCESS              The operation completed successfully.\r
   @retval EFI_NOT_STARTED          The EFI_TCP4_PROTOCOL instance hasn't been\r
                                    configured.\r
-  @retval EFI_ACCESS_DENIED        One or more of the following are TRUE: *\r
-                                   Configure() has been called with TcpConfigData\r
-                                   set to NULL and this function has not returned.\r
+  @retval EFI_ACCESS_DENIED        One or more of the following are TRUE:\r
+                                   Configure() has been called with TcpConfigData\r
+                                     set to NULL and this function has not returned.\r
                                    * Previous Close() call on this instance has not\r
-                                   finished.\r
-  @retval EFI_INVALID_PARAMETER    One ore more parameters are invalid\r
+                                     finished.\r
+  @retval EFI_INVALID_PARAMETER    One ore more parameters are invalid.\r
   @retval EFI_OUT_OF_RESOURCES     Could not allocate enough resource to finish the\r
-                                   operation\r
+                                   operation.\r
   @retval EFI_DEVICE_ERROR         Any unexpected and not belonged to above\r
                                    category error.\r
 \r
@@ -508,21 +593,39 @@ Tcp4Close (
 /**\r
   Abort an asynchronous connection, listen, transmission or receive request.\r
 \r
+  The Cancel() function aborts a pending connection, listen, transmit or receive\r
+  request. If Token is not NULL and the token is in the connection, listen,\r
+  transmission or receive queue when it is being cancelled, its Token->Status\r
+  will be set to EFI_ABORTED and then Token->Event will be signaled. If the token\r
+  is not in one of the queues, which usually means that the asynchronous operation\r
+  has completed, EFI_NOT_FOUND is returned. If Token is NULL all asynchronous token\r
+  issued by Connect(), Accept(), Transmit() and Receive()will be aborted.\r
+  NOTE: It has not been implemented currently.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance.\r
   @param  Token                    Pointer to a token that has been issued by\r
                                    Connect(), Accept(), Transmit() or Receive(). If\r
                                    NULL, all pending tokens issued by above four\r
                                    functions will be aborted.\r
 \r
-  @retval EFI_UNSUPPORTED          The operation is not supported in current\r
+  @retval  EFI_SUCCESS             The asynchronous I/O request is aborted and Token->Event\r
+                                   is signaled.\r
+  @retval  EFI_INVALID_PARAMETER   This is NULL.\r
+  @retval  EFI_NOT_STARTED         This instance hasn's been configured.\r
+  @retval  EFI_NO_MAPPING          When using the default address, configuration\r
+                                   (DHCP, BOOTP,RARP, etc.) hasn's finished yet.\r
+  @retval  EFI_NOT_FOUND           The asynchronous I/O request isn's found in the\r
+                                   transmission or receive queue. It has either\r
+                                   completed or wasn's issued by Transmit() and Receive().\r
+  @retval  EFI_UNSUPPORTED         The operation is not supported in current\r
                                    implementation.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 Tcp4Cancel (\r
-  IN EFI_TCP4_PROTOCOL           * This,\r
-  IN EFI_TCP4_COMPLETION_TOKEN   * Token OPTIONAL\r
+  IN EFI_TCP4_PROTOCOL           *This,\r
+  IN EFI_TCP4_COMPLETION_TOKEN   *Token    OPTIONAL\r
   )\r
 {\r
   return EFI_UNSUPPORTED;\r
@@ -532,6 +635,13 @@ Tcp4Cancel (
 /**\r
   Poll to receive incoming data and transmit outgoing segments.\r
 \r
+  The Poll() function increases the rate that data is moved between the network\r
+  and application and can be called when the TCP instance is created successfully.\r
+  Its use is optional. In some implementations, the periodical timer in the MNP\r
+  driver may not poll the underlying communications device fast enough to avoid\r
+  drop packets. Drivers and applications that are experiencing packet loss should\r
+  try calling the Poll() function in a high frequency.\r
+\r
   @param  This                     Pointer to the EFI_TCP4_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS              Incoming or outgoing data was processed.\r