Fixing function headers.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7114 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niry 2008-12-24 08:14:19 +00:00
parent 0c323d071d
commit 276dcc1b14
12 changed files with 100 additions and 95 deletions

View File

@ -83,7 +83,6 @@ SockTcpDataToRcv (
UINT32 DataLen;
TCP_RSV_DATA *TcpRsvData;
BOOLEAN Urg;
ASSERT ((SockBuffer != NULL) && (IsUrg != NULL) && (BufLen > 0));
RcvBufEntry = SockBufFirst (SockBuffer);
@ -232,7 +231,6 @@ SockProcessRcvToken (
SockSetTcpRxData (Sock, RxData, TokenRcvdBytes, IsUrg);
NetbufQueTrim (Sock->RcvBuffer.DataQueue, TokenRcvdBytes);
// SOCK_TRIM_RCV_BUFF (Sock, TokenRcvdBytes);
SIGNAL_TOKEN (&(RcvToken->Token), EFI_SUCCESS);
return TokenRcvdBytes;
@ -545,7 +543,7 @@ OnError:
@param SockInitData Pointer to the initial data of the socket.
@return Pointer to the newly created socket.
@return Pointer to the newly created socket, return NULL when exception occured.
**/
SOCKET *
@ -934,7 +932,9 @@ SockClone (
/**
Called by the low layer protocol to indicate the socket a connection is
established. This function just changes the socket's state to SO_CONNECTED
established.
This function just changes the socket's state to SO_CONNECTED
and signals the token used for connection establishment.
@param Sock Pointer to the socket associated with the
@ -961,12 +961,14 @@ SockConnEstablished (
/**
Called by the low layer protocol to indicate the connection is closed; This
function flushes the socket, sets the state to SO_CLOSED and signals the close
token.
Called by the low layer protocol to indicate the connection is closed.
This function flushes the socket, sets the state to SO_CLOSED and signals
the close token.
@param Sock Pointer to the socket associated with the closed
connection.
**/
VOID
SockConnClosed (
@ -989,7 +991,8 @@ SockConnClosed (
/**
Called by low layer protocol to indicate that some data is sent or processed;
Called by low layer protocol to indicate that some data is sent or processed.
This function trims the sent data in the socket send buffer, signals the data
token if proper.
@ -1078,7 +1081,8 @@ SockGetDataToSend (
/**
Called by the low layer protocol to deliver received data to socket layer;
Called by the low layer protocol to deliver received data to socket layer.
This function will append the data to the socket receive buffer, set ther
urgent data length and then check if any receive token can be signaled.
@ -1184,11 +1188,11 @@ SockRcvdErr (
/**
Called by the low layer protocol to indicate that there
will be no more data from the communication peer; This
function set the socket's state to SO_NO_MORE_DATA and
signal all queued IO tokens with the error status
EFI_CONNECTION_FIN.
Called by the low layer protocol to indicate that there will be no more data
from the communication peer.
This function set the socket's state to SO_NO_MORE_DATA and signal all queued
IO tokens with the error status EFI_CONNECTION_FIN.
@param Sock Pointer to the socket.

View File

@ -856,8 +856,8 @@ Exit:
**/
EFI_STATUS
SockGetMode (
IN SOCKET *Sock,
IN VOID *Mode
IN SOCKET *Sock,
IN OUT VOID *Mode
)
{
return Sock->ProtoHandler (Sock, SOCK_MODE, Mode);

View File

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

View File

@ -69,8 +69,8 @@ Tcp4Route (
**/
EFI_STATUS
Tcp4GetMode (
IN TCP_CB *Tcb,
IN TCP4_MODE_DATA *Mode
IN TCP_CB *Tcb,
IN OUT TCP4_MODE_DATA *Mode
)
{
SOCKET *Sock;

View File

@ -629,8 +629,8 @@ Tcp4DestroySocketCallback (
EFI_STATUS
EFIAPI
Tcp4ServiceBindingCreateChild (
IN EFI_SERVICE_BINDING_PROTOCOL *This,
IN EFI_HANDLE *ChildHandle
IN EFI_SERVICE_BINDING_PROTOCOL *This,
IN OUT EFI_HANDLE *ChildHandle
)
{
SOCKET *Sock;

View File

@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/ServiceBinding.h>
#include <Library/IpIoLib.h>
#define TCP4_DRIVER_SIGNATURE SIGNATURE_32 ('T', 'C', 'P', '4')
#define TCP4_DRIVER_SIGNATURE EFI_SIGNATURE_32 ('T', 'C', 'P', '4')
#define TCP4_PORT_KNOWN 1024
#define TCP4_PORT_USER_RESERVED 65535
@ -29,12 +29,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Tcp4ServiceBinding, \
TCP4_DRIVER_SIGNATURE \
)
///
/// TCP heartbeat tick timer.
///
typedef struct _TCP4_HEARTBEAT_TIMER {
EFI_EVENT TimerEvent;
INTN RefCnt;
EFI_EVENT TimerEvent; ///< The event assoiated with the timer
INTN RefCnt; ///< Number of reference
} TCP4_HEARTBEAT_TIMER;
///
/// TCP service data
///
typedef struct _TCP4_SERVICE_DATA {
UINT32 Signature;
EFI_HANDLE ControllerHandle;
@ -45,6 +51,13 @@ typedef struct _TCP4_SERVICE_DATA {
LIST_ENTRY SocketList;
} TCP4_SERVICE_DATA;
///
/// TCP protocol data
///
typedef struct _TCP4_PROTO_DATA {
TCP4_SERVICE_DATA *TcpService;
TCP_CB *TcpPcb;
} TCP4_PROTO_DATA;
/**
@ -112,10 +125,6 @@ Tcp4Dispatcher (
IN VOID *Data OPTIONAL
);
typedef struct _TCP4_PROTO_DATA {
TCP4_SERVICE_DATA *TcpService;
TCP_CB *TcpPcb;
} TCP4_PROTO_DATA;
/**
The entry point for Tcp4 driver, used to install Tcp4 driver on the ImageHandle.
@ -299,8 +308,8 @@ Tcp4DestroySocketCallback (
EFI_STATUS
EFIAPI
Tcp4ServiceBindingCreateChild (
IN EFI_SERVICE_BINDING_PROTOCOL *This,
IN EFI_HANDLE *ChildHandle
IN EFI_SERVICE_BINDING_PROTOCOL *This,
IN OUT EFI_HANDLE *ChildHandle
);
/**

View File

@ -149,7 +149,7 @@ TcpGetRcvMss (
VOID
TcpSetState (
IN TCP_CB *Tcb,
IN TCP_STATES State
IN UINT8 State
);
//
@ -518,10 +518,8 @@ TcpComputeRtt (
@param Tcb Pointer to the TCP_CB of this TCP instance.
@param Nbuf Pointer to the NET_BUF containing the received tcp segment.
@return 0 The data is trimmed.
**/
INTN
VOID
TcpTrimInWnd (
IN TCP_CB *Tcb,
IN NET_BUF *Nbuf
@ -608,7 +606,7 @@ TcpOnAppConnect (
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
INTN
VOID
TcpOnAppConsume (
IN TCP_CB *Tcb
);

View File

@ -257,10 +257,8 @@ TcpComputeRtt (
@param Left The sequence number of the window's left edge.
@param Right The sequence number of the window's right edge.
@return 0 The data is successfully trimmed.
**/
INTN
VOID
TcpTrimSegment (
IN NET_BUF *Nbuf,
IN TCP_SEQNO Left,
@ -284,7 +282,6 @@ TcpTrimSegment (
Seg->Seq = Seg->End;
NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_HEAD);
return 0;
}
//
@ -338,7 +335,6 @@ TcpTrimSegment (
}
ASSERT (TcpVerifySegment (Nbuf) != 0);
return 0;
}
@ -348,16 +344,14 @@ TcpTrimSegment (
@param Tcb Pointer to the TCP_CB of this TCP instance.
@param Nbuf Pointer to the NET_BUF containing the received tcp segment.
@return 0 The data is trimmed.
**/
INTN
VOID
TcpTrimInWnd (
IN TCP_CB *Tcb,
IN NET_BUF *Nbuf
)
{
return TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
TcpTrimSegment (Nbuf, Tcb->RcvNxt, Tcb->RcvWl2 + Tcb->RcvWnd);
}
@ -1272,8 +1266,6 @@ NO_UPDATE:
TcpClose (Tcb);
}
break;
default:
break;
}
//

View File

@ -99,7 +99,7 @@ TcpInitTcbPeer (
{
UINT16 RcvMss;
ASSERT (Tcb && Seg && Opt);
ASSERT ((Tcb != NULL) && (Seg != NULL) && (Opt != NULL));
ASSERT (TCP_FLG_ON (Seg->Flag, TCP_FLG_SYN));
Tcb->SndWnd = Seg->Wnd;
@ -497,7 +497,7 @@ TcpGetRcvMss (
VOID
TcpSetState (
IN TCP_CB *Tcb,
IN TCP_STATES State
IN UINT8 State
)
{
DEBUG (
@ -508,7 +508,7 @@ TcpSetState (
mTcpStateName[State])
);
Tcb->State = (TCP_STATES)State;
Tcb->State = State;
switch (State) {
case TCP_ESTABLISHED:
@ -791,7 +791,7 @@ TcpOnAppSend (
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
INTN
VOID
TcpOnAppConsume (
IN TCP_CB *Tcb
)
@ -800,17 +800,14 @@ TcpOnAppConsume (
switch (Tcb->State) {
case TCP_CLOSED:
return -1;
break;
return;
case TCP_LISTEN:
return -1;
break;
return;
case TCP_SYN_SENT:
case TCP_SYN_RCVD:
return 0;
break;
return;
case TCP_ESTABLISHED:
TcpOld = TcpRcvWinOld (Tcb);
@ -834,19 +831,15 @@ TcpOnAppConsume (
break;
case TCP_CLOSE_WAIT:
return 0;
break;
return;
case TCP_FIN_WAIT_1:
case TCP_FIN_WAIT_2:
case TCP_CLOSING:
case TCP_LAST_ACK:
case TCP_TIME_WAIT:
return -1;
break;
return;
}
return -1;
}
@ -873,8 +866,6 @@ TcpOnAppAbort (
case TCP_CLOSE_WAIT:
TcpResetConnection (Tcb);
break;
default:
break;
}
TcpSetState (Tcb, TCP_CLOSED);

View File

@ -832,9 +832,6 @@ SEND_AGAIN:
}
if (TcpTransmitSegment (Tcb, Nbuf) != 0) {
//
// TODO: double check this
//
NetbufTrim (Nbuf, (Nbuf->Tcp->HeadLen << 2), NET_BUF_HEAD);
Nbuf->Tcp = NULL;

View File

@ -182,7 +182,7 @@ struct _TCP_CB {
//
// RFC793 and RFC1122 defined variables
//
TCP_STATES State; ///< TCP state, such as SYN_SENT, LISTEN
UINT8 State; ///< TCP state, such as SYN_SENT, LISTEN
UINT8 DelayedAck; ///< Number of delayed ACKs
UINT16 HeadSum; ///< Checksum of the fixed parts of pesudo
///< header: Src IP, Dst IP, 0, Protocol,
@ -342,7 +342,7 @@ extern UINT32 mTcpTick;
typedef
VOID
(*TCP_TIMER_HANDLER) (
IN TCP_CB * Tcb
IN TCP_CB *Tcb
);
#include "Tcp4Func.h"

View File

@ -211,7 +211,7 @@ TcpProbeTimeout (
//
if ((TcpDataToSend (Tcb, 1) != 0) && (TcpToSendData (Tcb, 1) > 0)) {
ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT));
ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT) != 0);
return ;
}