\r
#define SOCK_IS_NO_MORE_DATA(Sock) (0 != ((Sock)->Flag & SO_NO_MORE_DATA))\r
\r
-#define SOCK_SIGNATURE SIGNATURE_32 ('S', 'O', 'C', 'K')\r
+#define SOCK_SIGNATURE EFI_SIGNATURE_32 ('S', 'O', 'C', 'K')\r
\r
#define SOCK_FROM_THIS(a) CR ((a), SOCKET, NetProtocol, SOCK_SIGNATURE)\r
\r
SOCK_STREAM ///< This socket providing stream service\r
} SOCK_TYPE;\r
\r
-///\r
-/// The handler of protocol for request from socket.\r
-///\r
-typedef\r
-EFI_STATUS\r
-(*SOCK_PROTO_HANDLER) (\r
- IN SOCKET *Socket, ///< The socket issuing the request to protocol\r
- IN SOCK_REQUEST Request, ///< The request issued by socket\r
- IN VOID *RequestData ///< The request related data\r
- );\r
-\r
///\r
/// The buffer structure of rcvd data and send data used by socket.\r
///\r
NET_BUF_QUEUE *DataQueue; ///< The queue to buffer data\r
} SOCK_BUFFER;\r
\r
-\r
+/**\r
+ The handler of protocol for request from socket.\r
+ \r
+ @param Socket The socket issuing the request to protocol\r
+ @param Request The request issued by socket\r
+ @param RequestData The request related data\r
+ \r
+ @retval EFI_SUCCESS The socket request is completed successfully.\r
+ @retval other The error status returned by the corresponding TCP\r
+ layer function.\r
+ \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(*SOCK_PROTO_HANDLER) (\r
+ IN SOCKET *Socket,\r
+ IN SOCK_REQUEST Request,\r
+ IN VOID *RequestData\r
+ );\r
+ \r
+ \r
//\r
// Socket provided oprerations for low layer protocol\r
//\r
\r
/**\r
Called by the low layer protocol to indicate the socket a connection is \r
- established. This function just changes the socket's state to SO_CONNECTED \r
+ established. \r
+ \r
+ This function just changes the socket's state to SO_CONNECTED \r
and signals the token used for connection establishment.\r
\r
@param Sock Pointer to the socket associated with the\r
);\r
\r
/**\r
- Called by the low layer protocol to indicate the connection is closed; This \r
- function flushes the socket, sets the state to SO_CLOSED and signals the close \r
- token.\r
+ Called by the low layer protocol to indicate the connection is closed.\r
+ \r
+ This function flushes the socket, sets the state to SO_CLOSED and signals \r
+ the close token.\r
\r
@param Sock Pointer to the socket associated with the closed\r
connection.\r
);\r
\r
/**\r
- Called by low layer protocol to indicate that some data is sent or processed; \r
+ Called by low layer protocol to indicate that some data is sent or processed.\r
+ \r
This function trims the sent data in the socket send buffer, signals the data \r
token if proper.\r
\r
\r
/**\r
Called by the low layer protocol to indicate that there\r
- will be no more data from the communication peer; This\r
- function set the socket's state to SO_NO_MORE_DATA and\r
- signal all queued IO tokens with the error status\r
- EFI_CONNECTION_FIN.\r
+ will be no more data from the communication peer.\r
+ \r
+ This function set the socket's state to SO_NO_MORE_DATA and\r
+ signal all queued IO tokens with the error status EFI_CONNECTION_FIN.\r
\r
@param Sock Pointer to the socket.\r
\r
);\r
\r
/**\r
- Called by the low layer protocol to deliver received data to socket layer; \r
+ Called by the low layer protocol to deliver received data to socket layer.\r
+ \r
This function will append the data to the socket receive buffer, set ther \r
urgent data length and then check if any receive token can be signaled.\r
\r
**/\r
EFI_STATUS\r
SockGetMode (\r
- IN SOCKET *Sock,\r
- IN VOID *Mode\r
+ IN SOCKET *Sock,\r
+ IN OUT VOID *Mode\r
);\r
\r
/**\r