]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Tcp4.h
Add some comments.
[mirror_edk2.git] / MdePkg / Include / Protocol / Tcp4.h
index 544236b10dbcca38f2ddb9bd468c81b9849859f3..c0652a683a1ce48c0a058c432a214c5891b8eb2c 100644 (file)
@@ -1,10 +1,10 @@
 /** @file\r
-  EFI TCPv4 Protocol Definition\r
+  EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition\r
   The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create\r
   and destroy child of the driver to communicate with other host using TCP protocol.\r
   The EFI TCPv4 Protocol provides services to send and receive data stream.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation\r
+  Copyright (c) 2006 - 2009, Intel Corporation\r
   All rights reserved. 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
@@ -13,6 +13,9 @@
   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
+  @par Revision Reference:          \r
+  This Protocol is introduced in UEFI Specification 2.0\r
+\r
 **/\r
 \r
 #ifndef __EFI_TCP4_PROTOCOL_H__\r
@@ -115,6 +118,32 @@ typedef struct {
 } EFI_TCP4_COMPLETION_TOKEN;\r
 \r
 typedef struct {\r
+  ///\r
+  /// The Status in the CompletionToken will be set to one of \r
+  /// the following values if the active open succeeds or an unexpected \r
+  /// error happens:\r
+  /// EFI_SUCCESS:              The active open succeeds and the instance's \r
+  ///                           state is Tcp4StateEstablished.\r
+  /// EFI_CONNECTION_RESET:     The connect fails because the connection is reset\r
+  ///                           either by instance itself or the communication peer.\r
+  /// EFI_CONNECTION_REFUSED:   The connect fails because this connection is initiated with\r
+  ///                           an active open and the connection is refused.\r
+  ///                           Note: It is not defined in UEFI 2.3 Specification.\r
+  /// EFI_ABORTED:              The active open is aborted.\r
+  /// EFI_TIMEOUT:              The connection establishment timer expires and \r
+  ///                           no more specific information is available.\r
+  /// EFI_NETWORK_UNREACHABLE:  The active open fails because \r
+  ///                           an ICMP network unreachable error is received. \r
+  /// EFI_HOST_UNREACHABLE:     The active open fails because an \r
+  ///                           ICMP host unreachable error is received. \r
+  /// EFI_PROTOCOL_UNREACHABLE: The active open fails \r
+  ///                           because an ICMP protocol unreachable error is received.\r
+  /// EFI_PORT_UNREACHABLE:     The connection establishment \r
+  ///                           timer times out and an ICMP port unreachable error is received.\r
+  /// EFI_ICMP_ERROR:           The connection establishment timer timeout and some other ICMP\r
+  ///                           error is received.\r
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurred.\r
+  /// \r
   EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
 } EFI_TCP4_CONNECTION_TOKEN;\r
 \r
@@ -144,9 +173,43 @@ typedef struct {
 } EFI_TCP4_TRANSMIT_DATA;\r
 \r
 typedef struct {\r
+  /// \r
+  /// When transmission finishes or meets any unexpected error it will \r
+  /// be set to one of the following values:\r
+  /// EFI_SUCCESS:              The receiving or transmission operation \r
+  ///                           completes successfully.\r
+  /// EFI_CONNECTION_FIN:       The receiving operation fails because the communication peer \r
+  ///                           has closed the connection and there is no more data in the \r
+  ///                           receive buffer of the instance.\r
+  ///                           Note: It is not defined in UEFI 2.3 Specification.\r
+  /// EFI_CONNECTION_RESET:     The receiving or transmission operation fails\r
+  ///                           because this connection is reset either by instance \r
+  ///                           itself or the communication peer.\r
+  /// EFI_ABORTED:              The receiving or transmission is aborted.\r
+  /// EFI_TIMEOUT:              The transmission timer expires and no more \r
+  ///                           specific information is available.\r
+  /// EFI_NETWORK_UNREACHABLE:  The transmission fails \r
+  ///                           because an ICMP network unreachable error is received. \r
+  /// EFI_HOST_UNREACHABLE:     The transmission fails because an \r
+  ///                           ICMP host unreachable error is received. \r
+  /// EFI_PROTOCOL_UNREACHABLE: The transmission fails \r
+  ///                           because an ICMP protocol unreachable error is received. \r
+  /// EFI_PORT_UNREACHABLE:     The transmission fails and an \r
+  ///                           ICMP port unreachable error is received. \r
+  /// EFI_ICMP_ERROR:           The transmission fails and some other \r
+  ///                           ICMP error is received. \r
+  /// EFI_DEVICE_ERROR:         An unexpected system or network error occurs.\r
+  /// EFI_NO_MEDIA:             There was a media error.\r
+  ///\r
   EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
   union {\r
+    ///\r
+    /// When this token is used for receiving, RxData is a pointer to EFI_TCP4_RECEIVE_DATA.\r
+    ///\r
     EFI_TCP4_RECEIVE_DATA   *RxData;\r
+    ///\r
+    /// When this token is used for transmitting, TxData is a pointer to EFI_TCP4_TRANSMIT_DATA.\r
+    ///\r
     EFI_TCP4_TRANSMIT_DATA  *TxData;\r
   } Packet;\r
 } EFI_TCP4_IO_TOKEN;\r
@@ -269,8 +332,7 @@ EFI_STATUS
                                 way handshake finishes.\r
 \r
   @retval EFI_SUCCESS           The connection request is successfully initiated and the state\r
-                                - of this TCPv4 instance has been changed to\r
-                                - Tcp4StateSynSent.\r
+                                of this TCPv4 instance has been changed to Tcp4StateSynSent.\r
   @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
   @retval EFI_ACCESS_DENIED     One or more of the following conditions are TRUE:\r
                                 - This instance is not configured as an active one.\r
@@ -279,7 +341,7 @@ EFI_STATUS
                                 - This is NULL.\r
                                 - ConnectionToken is NULL.\r
                                 - ConnectionToken->CompletionToken.Event is NULL.\r
-  @retval EFI_OUT_OF_RESOURCES  The driver can't allocate enough resources to initiate the activeopen.\r
+  @retval EFI_OUT_OF_RESOURCES  The driver can't allocate enough resource to initiate the activ eopen.\r
   @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
 \r
 **/\r
@@ -308,8 +370,8 @@ EFI_STATUS
                                 - This is NULL.\r
                                 - ListenToken is NULL.\r
                                 - ListentToken->CompletionToken.Event is NULL.\r
-  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resources to finish the operation.\r
-  @retval EFI_DEVICE_ERROR      Any unexpected error not covered by another error.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.\r
+  @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.\r
 \r
 **/\r
 typedef\r
@@ -389,7 +451,7 @@ EFI_STATUS
                                Tcp4StateListen state.\r
                                - User has called Close() to disconnect this connection.\r
   @retval EFI_CONNECTION_FIN   The communication peer has closed the connection and there is\r
-                               no buffered data in the receive buffer of this instance.\r
+                               no any buffered data in the receive buffer of this instance.\r
   @retval EFI_NOT_READY        The receive request could not be queued because the receive queue is full.\r
 \r
 **/\r
@@ -419,8 +481,8 @@ EFI_STATUS
                                 - This is NULL.\r
                                 - CloseToken is NULL.\r
                                 - CloseToken->CompletionToken.Event is NULL.\r
-  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resources to finish the operation.\r
-  @retval EFI_DEVICE_ERROR      Any unexpected error not covered by another error.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.\r
+  @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.\r
 \r
 **/\r
 typedef\r
@@ -443,12 +505,17 @@ EFI_STATUS
                 EFI_TCP4_COMPLETION_TOKEN is defined in\r
                 EFI_TCP4_PROTOCOL.Connect().\r
 \r
-  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
-  @retval  EFI_INVALID_PARAMETER This is NULL.\r
-  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
-  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.\r
-  @retval  EFI_TIMEOUT           Data was dropped out of the transmission or receive queue.\r
-                                 Consider increasing the polling rate.\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't been configured.\r
+  @retval  EFI_NO_MAPPING          When using the default address, configuration\r
+                                   (DHCP, BOOTP,RARP, etc.) hasn't finished yet.\r
+  @retval  EFI_NOT_FOUND           The asynchronous I/O request isn't found in the \r
+                                   transmission or receive queue. It has either \r
+                                   completed or wasn't issued by Transmit() and Receive().\r
+  @retval  EFI_UNSUPPORTED         The implementation does not support this function.\r
+                                   Note: It is not defined in UEFI 2.3 Specification.\r
 \r
 **/\r
 typedef\r
@@ -498,10 +565,6 @@ struct _EFI_TCP4_PROTOCOL {
   EFI_TCP4_POLL                          Poll;\r
 };\r
 \r
-#define EFI_CONNECTION_FIN               EFIERR (104)\r
-#define EFI_CONNECTION_RESET             EFIERR (105)\r
-#define EFI_CONNECTION_REFUSED           EFIERR (106)\r
-\r
 extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;\r
 extern EFI_GUID gEfiTcp4ProtocolGuid;\r
 \r