]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fixing function headers.
authorniry <niry@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Dec 2008 08:14:19 +0000 (08:14 +0000)
committerniry <niry@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Dec 2008 08:14:19 +0000 (08:14 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7114 6f19259b-4bc3-4df7-8a09-765794883524

12 files changed:
MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Timer.c

index 7cd3a84f27743622b3630381df51c142a5e11ddc..1e27bfbf97ce9800faada45497a816072000e313 100644 (file)
@@ -83,7 +83,6 @@ SockTcpDataToRcv (
   UINT32        DataLen;\r
   TCP_RSV_DATA  *TcpRsvData;\r
   BOOLEAN       Urg;\r
-\r
   ASSERT ((SockBuffer != NULL) && (IsUrg != NULL) && (BufLen > 0));\r
 \r
   RcvBufEntry = SockBufFirst (SockBuffer);\r
@@ -232,7 +231,6 @@ SockProcessRcvToken (
   SockSetTcpRxData (Sock, RxData, TokenRcvdBytes, IsUrg);\r
 \r
   NetbufQueTrim (Sock->RcvBuffer.DataQueue, TokenRcvdBytes);\r
-//  SOCK_TRIM_RCV_BUFF (Sock, TokenRcvdBytes);\r
   SIGNAL_TOKEN (&(RcvToken->Token), EFI_SUCCESS);\r
 \r
   return TokenRcvdBytes;\r
@@ -545,7 +543,7 @@ OnError:
 \r
   @param  SockInitData          Pointer to the initial data of the socket.\r
 \r
-  @return Pointer to the newly created socket.\r
+  @return Pointer to the newly created socket, return NULL when exception occured.\r
 \r
 **/\r
 SOCKET *\r
@@ -934,7 +932,9 @@ SockClone (
 \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
@@ -961,12 +961,14 @@ SockConnEstablished (
 \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
 VOID\r
 SockConnClosed (\r
@@ -989,7 +991,8 @@ SockConnClosed (
 \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
@@ -1078,7 +1081,8 @@ SockGetDataToSend (
 \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
@@ -1184,11 +1188,11 @@ SockRcvdErr (
 \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
+  Called by the low layer protocol to indicate that there will be no more data \r
+  from the communication peer.\r
+  \r
+  This function set the socket's state to SO_NO_MORE_DATA and signal all queued \r
+  IO tokens with the error status EFI_CONNECTION_FIN.\r
 \r
   @param  Sock                  Pointer to the socket.\r
 \r
index dd359823b4a50c49b52ed02c5f35cc57ef0dd908..c0756954674acf868ce13c48243ff237a9866827 100644 (file)
@@ -856,8 +856,8 @@ Exit:
 **/\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
   return Sock->ProtoHandler (Sock, SOCK_MODE, Mode);\r
index 11406ed6d020c4fd600a16592d39ccb041882ae0..e0f9540930d4f3540d90a755bef9fec5de477ed4 100644 (file)
@@ -114,7 +114,7 @@ typedef enum {
 \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
@@ -197,17 +197,6 @@ typedef enum {
   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
@@ -217,7 +206,27 @@ typedef struct _SOCK_BUFFER {
   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
@@ -241,7 +250,9 @@ SockSetState (
 \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
@@ -254,9 +265,10 @@ SockConnEstablished (
   );\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
@@ -268,7 +280,8 @@ SockConnClosed (
   );\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
@@ -305,10 +318,10 @@ SockGetDataToSend (
 \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
@@ -319,7 +332,8 @@ SockNoMoreData (
   );\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
@@ -720,8 +734,8 @@ SockClose (
 **/\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
index 62574fecf1bb12b7de914f2d859f09f3a52dc41c..dbc82b51c155573252dc4a4b183654ab4d3c26a5 100644 (file)
@@ -69,8 +69,8 @@ Tcp4Route (
 **/\r
 EFI_STATUS\r
 Tcp4GetMode (\r
-  IN TCP_CB         *Tcb,\r
-  IN TCP4_MODE_DATA *Mode\r
+  IN     TCP_CB         *Tcb,\r
+  IN OUT TCP4_MODE_DATA *Mode\r
   )\r
 {\r
   SOCKET                *Sock;\r
index 921332cbe069066638f3fcd3779d6ea9f72eb933..94a1753b812f9a39e87a11598fcb6bed26c086d5 100644 (file)
@@ -629,8 +629,8 @@ Tcp4DestroySocketCallback (
 EFI_STATUS\r
 EFIAPI\r
 Tcp4ServiceBindingCreateChild (\r
-  IN EFI_SERVICE_BINDING_PROTOCOL  *This,\r
-  IN EFI_HANDLE                    *ChildHandle\r
+  IN     EFI_SERVICE_BINDING_PROTOCOL  *This,\r
+  IN OUT EFI_HANDLE                    *ChildHandle\r
   )\r
 {\r
   SOCKET            *Sock;\r
index 44ff26575b73bb2d48a4c516894fd69c0394adcc..ba8c8c23f15c4342c7bea7af7b224ea36d1493f0 100644 (file)
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/ServiceBinding.h>\r
 #include <Library/IpIoLib.h>\r
 \r
-#define TCP4_DRIVER_SIGNATURE   SIGNATURE_32 ('T', 'C', 'P', '4')\r
+#define TCP4_DRIVER_SIGNATURE   EFI_SIGNATURE_32 ('T', 'C', 'P', '4')\r
 \r
 #define TCP4_PORT_KNOWN         1024\r
 #define TCP4_PORT_USER_RESERVED 65535\r
@@ -29,12 +29,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   Tcp4ServiceBinding, \\r
   TCP4_DRIVER_SIGNATURE \\r
   )\r
-\r
+  \r
+///\r
+/// TCP heartbeat tick timer.\r
+///\r
 typedef struct _TCP4_HEARTBEAT_TIMER {\r
-  EFI_EVENT  TimerEvent;\r
-  INTN       RefCnt;\r
+  EFI_EVENT  TimerEvent;         ///< The event assoiated with the timer\r
+  INTN       RefCnt;             ///< Number of reference\r
 } TCP4_HEARTBEAT_TIMER;\r
 \r
+///\r
+/// TCP service data\r
+///\r
 typedef struct _TCP4_SERVICE_DATA {\r
   UINT32                        Signature;\r
   EFI_HANDLE                    ControllerHandle;\r
@@ -45,6 +51,13 @@ typedef struct _TCP4_SERVICE_DATA {
   LIST_ENTRY                    SocketList;\r
 } TCP4_SERVICE_DATA;\r
 \r
+///\r
+/// TCP protocol data\r
+///\r
+typedef struct _TCP4_PROTO_DATA {\r
+  TCP4_SERVICE_DATA *TcpService;\r
+  TCP_CB            *TcpPcb;\r
+} TCP4_PROTO_DATA;\r
 \r
 \r
 /**\r
@@ -112,10 +125,6 @@ Tcp4Dispatcher (
   IN VOID                    *Data    OPTIONAL\r
   );\r
 \r
-typedef struct _TCP4_PROTO_DATA {\r
-  TCP4_SERVICE_DATA *TcpService;\r
-  TCP_CB            *TcpPcb;\r
-} TCP4_PROTO_DATA;\r
 \r
 /**\r
   The entry point for Tcp4 driver, used to install Tcp4 driver on the ImageHandle.\r
@@ -299,8 +308,8 @@ Tcp4DestroySocketCallback (
 EFI_STATUS\r
 EFIAPI\r
 Tcp4ServiceBindingCreateChild (\r
-  IN EFI_SERVICE_BINDING_PROTOCOL  *This,\r
-  IN EFI_HANDLE                    *ChildHandle\r
+  IN     EFI_SERVICE_BINDING_PROTOCOL  *This,\r
+  IN OUT EFI_HANDLE                    *ChildHandle\r
   );\r
 \r
 /**\r
index 21922c7a023853999259966c6efdf6c014eec8a7..b0edceaab9ac79d3e52b359b107caab17e1f149f 100644 (file)
@@ -149,7 +149,7 @@ TcpGetRcvMss (
 VOID\r
 TcpSetState (\r
   IN TCP_CB      *Tcb,\r
-  IN TCP_STATES  State\r
+  IN UINT8       State\r
   );\r
 \r
 //\r
@@ -518,10 +518,8 @@ TcpComputeRtt (
   @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
   @param  Nbuf     Pointer to the NET_BUF containing the received tcp segment.\r
 \r
-  @return 0        The data is trimmed.\r
-\r
 **/\r
-INTN\r
+VOID\r
 TcpTrimInWnd (\r
   IN TCP_CB  *Tcb,\r
   IN NET_BUF *Nbuf\r
@@ -608,7 +606,7 @@ TcpOnAppConnect (
   @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
 \r
 **/\r
-INTN\r
+VOID\r
 TcpOnAppConsume (\r
   IN TCP_CB *Tcb\r
   );\r
index 7f80958c7dded7a192276a99dda446ba75901db5..38fb6ade42fc3610ffca3039e0fa6881d98cf57b 100644 (file)
@@ -257,10 +257,8 @@ TcpComputeRtt (
   @param  Left     The sequence number of the window's left edge.\r
   @param  Right    The sequence number of the window's right edge.\r
 \r
-  @return 0        The data is successfully trimmed.\r
-\r
 **/\r
-INTN\r
+VOID\r
 TcpTrimSegment (\r
   IN NET_BUF   *Nbuf,\r
   IN TCP_SEQNO Left,\r
@@ -284,7 +282,6 @@ TcpTrimSegment (
 \r
     Seg->Seq = Seg->End;\r
     NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_HEAD);\r
-    return 0;\r
   }\r
 \r
   //\r
@@ -338,7 +335,6 @@ TcpTrimSegment (
   }\r
 \r
   ASSERT (TcpVerifySegment (Nbuf) != 0);\r
-  return 0;\r
 }\r
 \r
 \r
@@ -348,16 +344,14 @@ TcpTrimSegment (
   @param  Tcb      Pointer to the TCP_CB of this TCP instance.\r
   @param  Nbuf     Pointer to the NET_BUF containing the received tcp segment.\r
 \r
-  @return 0        The data is trimmed.\r
-\r
 **/\r
-INTN\r
+VOID\r
 TcpTrimInWnd (\r
   IN TCP_CB  *Tcb,\r
   IN NET_BUF *Nbuf\r
   )\r
 {\r
-  return TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);\r
+  TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);\r
 }\r
 \r
 \r
@@ -1272,8 +1266,6 @@ NO_UPDATE:
       TcpClose (Tcb);\r
     }\r
     break;\r
-  default:\r
-    break;\r
   }\r
 \r
   //\r
index 204c9d988177b2269f5cf42ce4ccdafe3e9c65bd..9fa9e8315a0e8b4ca55a66306af1c6c36017a6ed 100644 (file)
@@ -99,7 +99,7 @@ TcpInitTcbPeer (
 {\r
   UINT16  RcvMss;\r
 \r
-  ASSERT (Tcb && Seg && Opt);\r
+  ASSERT ((Tcb != NULL) && (Seg != NULL) && (Opt != NULL));\r
   ASSERT (TCP_FLG_ON (Seg->Flag, TCP_FLG_SYN));\r
 \r
   Tcb->SndWnd     = Seg->Wnd;\r
@@ -497,7 +497,7 @@ TcpGetRcvMss (
 VOID\r
 TcpSetState (\r
   IN TCP_CB      *Tcb,\r
-  IN TCP_STATES  State\r
+  IN UINT8       State\r
   )\r
 {\r
   DEBUG (\r
@@ -508,7 +508,7 @@ TcpSetState (
     mTcpStateName[State])\r
     );\r
 \r
-  Tcb->State = (TCP_STATES)State;\r
+  Tcb->State = State;\r
 \r
   switch (State) {\r
   case TCP_ESTABLISHED:\r
@@ -791,7 +791,7 @@ TcpOnAppSend (
   @param  Tcb                   Pointer to the TCP_CB of this TCP instance.\r
 \r
 **/\r
-INTN\r
+VOID\r
 TcpOnAppConsume (\r
   IN TCP_CB *Tcb\r
   )\r
@@ -800,17 +800,14 @@ TcpOnAppConsume (
 \r
   switch (Tcb->State) {\r
   case TCP_CLOSED:\r
-    return -1;\r
-    break;\r
+    return;\r
 \r
   case TCP_LISTEN:\r
-    return -1;\r
-    break;\r
+    return;\r
 \r
   case TCP_SYN_SENT:\r
   case TCP_SYN_RCVD:\r
-    return 0;\r
-    break;\r
+    return;\r
 \r
   case TCP_ESTABLISHED:\r
     TcpOld = TcpRcvWinOld (Tcb);\r
@@ -834,19 +831,15 @@ TcpOnAppConsume (
     break;\r
 \r
   case TCP_CLOSE_WAIT:\r
-    return 0;\r
-    break;\r
+    return;\r
 \r
   case TCP_FIN_WAIT_1:\r
   case TCP_FIN_WAIT_2:\r
   case TCP_CLOSING:\r
   case TCP_LAST_ACK:\r
   case TCP_TIME_WAIT:\r
-    return -1;\r
-    break;\r
+    return;\r
   }\r
-\r
-  return -1;\r
 }\r
 \r
 \r
@@ -873,8 +866,6 @@ TcpOnAppAbort (
   case TCP_CLOSE_WAIT:\r
     TcpResetConnection (Tcb);\r
     break;\r
-  default:\r
-    break;\r
   }\r
 \r
   TcpSetState (Tcb, TCP_CLOSED);\r
index f12b2c5b4ca001ec88c95f20b1e22e510d24e414..4d68c298ea37a75483a4bc6df7fee794629b7db9 100644 (file)
@@ -832,9 +832,6 @@ SEND_AGAIN:
   }\r
 \r
   if (TcpTransmitSegment (Tcb, Nbuf) != 0) {\r
-    //\r
-    // TODO: double check this\r
-    //\r
     NetbufTrim (Nbuf, (Nbuf->Tcp->HeadLen << 2), NET_BUF_HEAD);\r
     Nbuf->Tcp = NULL;\r
 \r
index 8bb99caac0f07106354f06ba6cbad2c2aed208a9..f1eaad5be1939011f45ea1f26222a8800def8193 100644 (file)
@@ -182,7 +182,7 @@ struct _TCP_CB {
   //\r
   // RFC793 and RFC1122 defined variables\r
   //\r
-  TCP_STATES             State;      ///< TCP state, such as SYN_SENT, LISTEN\r
+  UINT8             State;      ///< TCP state, such as SYN_SENT, LISTEN\r
   UINT8             DelayedAck; ///< Number of delayed ACKs\r
   UINT16            HeadSum;    ///< Checksum of the fixed parts of pesudo\r
                                 ///< header: Src IP, Dst IP, 0, Protocol,\r
@@ -342,7 +342,7 @@ extern UINT32         mTcpTick;
 typedef\r
 VOID\r
 (*TCP_TIMER_HANDLER) (\r
-  IN TCP_CB * Tcb\r
+  IN TCP_CB *Tcb\r
   );\r
 \r
 #include "Tcp4Func.h"\r
index 8ef9d2ceddf89866aa9028168af38d76b0212d8e..945a5cac22f00a317fecb3c76ad5b13b58e54395 100644 (file)
@@ -211,7 +211,7 @@ TcpProbeTimeout (
   //\r
   if ((TcpDataToSend (Tcb, 1) != 0) && (TcpToSendData (Tcb, 1) > 0)) {\r
 \r
-    ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT));\r
+    ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT) != 0);\r
     return ;\r
   }\r
 \r