diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-07-25 05:32:10 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-07-25 05:32:10 +0000 |
commit | 4eb65aff715faafd9040c6fc85a5d59e22343978 (patch) | |
tree | 2d44bcc49ffb7aad635fb3a94509a82211493f10 /MdeModulePkg/Universal/Network/Tcp4Dxe | |
parent | c8c8116cfb645195b3484757a9f81a53f6989bdf (diff) | |
download | edk2-platforms-4eb65aff715faafd9040c6fc85a5d59e22343978.tar.xz |
Fixed EBC build issues.
Fixed ICC build issues.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3431 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Tcp4Dxe')
11 files changed, 72 insertions, 59 deletions
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c index 1f81fc39d3..bc70403698 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c @@ -76,7 +76,7 @@ SockTcpDataToRcv ( TcpRsvData = (TCP_RSV_DATA *) RcvBufEntry->ProtoData;
- *IsUrg = ((TcpRsvData->UrgLen > 0) ? TRUE : FALSE);
+ *IsUrg = (BOOLEAN) ((TcpRsvData->UrgLen > 0) ? TRUE : FALSE);
if (*IsUrg && TcpRsvData->UrgLen < RcvBufEntry->TotalSize) {
@@ -100,7 +100,7 @@ SockTcpDataToRcv ( TcpRsvData = (TCP_RSV_DATA *) RcvBufEntry->ProtoData;
- Urg = ((TcpRsvData->UrgLen > 0) ? TRUE : FALSE);
+ Urg = (BOOLEAN) ((TcpRsvData->UrgLen > 0) ? TRUE : FALSE);
if (*IsUrg != Urg) {
break;
@@ -165,7 +165,7 @@ SockSetTcpRxData ( for (Index = 0; (Index < RxData->FragmentCount) && (RcvdBytes > 0); Index++) {
Fragment = &RxData->FragmentTable[Index];
- CopyBytes = NET_MIN (Fragment->FragmentLength, RcvdBytes);
+ CopyBytes = NET_MIN ((UINT32) (Fragment->FragmentLength), RcvdBytes);
NetbufQueCopy (
Sock->RcvBuffer.DataQueue,
@@ -209,7 +209,7 @@ SockProcessRcvToken ( TokenRcvdBytes = SockTcpDataToRcv (
&Sock->RcvBuffer,
&IsUrg,
- RxData->DataLength
+ (UINT32) RxData->DataLength
);
//
@@ -254,7 +254,7 @@ SockProcessTcpSndData ( //
SndData = NetbufFromExt (
(NET_FRAGMENT *) TxData->FragmentTable,
- TxData->FragmentCount,
+ (UINT32) TxData->FragmentCount,
0,
0,
SockFreeFoo,
@@ -518,7 +518,7 @@ SockProcessSndToken ( SndToken = (SOCK_IO_TOKEN *) SockToken->Token;
TxData = SndToken->Packet.TxData;
- DataLen = TxData->DataLength;
+ DataLen = (UINT32) TxData->DataLength;
Status = SockProcessTcpSndData (Sock, TxData);
if (EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c index 0b71996e14..cde02b2bec 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c @@ -571,7 +571,7 @@ SockSend ( goto Exit;
}
- DataLen = TxData->DataLength;
+ DataLen = (UINT32) TxData->DataLength;
//
// process this sending token now or buffer it only?
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h index f3978541fb..7c219e3b9b 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h @@ -320,7 +320,7 @@ SockRcvdErr ( // // the socket structure representing a network service access point // -typedef struct _SOCKET { +struct _SOCKET { // // socket description information @@ -365,7 +365,7 @@ typedef struct _SOCKET { EFI_TCP4_PROTOCOL TcpProtocol; EFI_UDP4_PROTOCOL UdpProtocol; } NetProtocol; -} SOCKET; +}; // // the token structure buffered in socket layer diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c index 9039905be6..ea7d732b84 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c @@ -104,7 +104,7 @@ Tcp4GetMode ( }
if (Mode->Tcp4State) {
- *(Mode->Tcp4State) = Tcb->State;
+ *(Mode->Tcp4State) = (EFI_TCP4_CONNECTION_STATE) Tcb->State;
}
if (Mode->Tcp4ConfigData) {
@@ -139,9 +139,10 @@ Tcp4GetMode ( Option->KeepAliveTime = Tcb->KeepAliveIdle / TCP_TICK_HZ;
Option->KeepAliveInterval = Tcb->KeepAlivePeriod / TCP_TICK_HZ;
- Option->EnableNagle = !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE);
- Option->EnableTimeStamp = !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_TS);
- Option->EnableWindowScaling = !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_WS);
+ Option->EnableNagle = (BOOLEAN) (!TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE));
+ Option->EnableTimeStamp = (BOOLEAN) (!TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_TS));
+ Option->EnableWindowScaling = (BOOLEAN) (!TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_WS))
+;
Option->EnableSelectiveAck = FALSE;
Option->EnablePathMtuDiscovery = FALSE;
@@ -341,7 +342,6 @@ Tcp4ConfigurePcb ( IN EFI_TCP4_CONFIG_DATA *CfgData
)
{
- IP_IO *IpIo;
EFI_IP4_CONFIG_DATA IpCfgData;
EFI_STATUS Status;
EFI_TCP4_OPTION *Option;
@@ -352,14 +352,13 @@ Tcp4ConfigurePcb ( TcpProto = (TCP4_PROTO_DATA *) Sk->ProtoReserved;
Tcb = TcpProto->TcpPcb;
- IpIo = TcpProto->TcpService->IpIo;
ASSERT (Tcb != NULL);
//
// Add Ip for send pkt to the peer
//
- IpCfgData = mIpIoDefaultIpConfigData;
+ CopyMem (&IpCfgData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
IpCfgData.DefaultProtocol = EFI_IP_PROTO_TCP;
IpCfgData.UseDefaultAddress = CfgData->AccessPoint.UseDefaultAddress;
IpCfgData.StationAddress = CfgData->AccessPoint.StationAddress;
@@ -441,25 +440,34 @@ Tcp4ConfigurePcb ( if (Option != NULL) {
SET_RCV_BUFFSIZE (
Sk,
- TCP_COMP_VAL (TCP_RCV_BUF_SIZE_MIN,
- TCP_RCV_BUF_SIZE,
- TCP_RCV_BUF_SIZE,
- Option->ReceiveBufferSize)
+ (UINT32) (TCP_COMP_VAL (
+ TCP_RCV_BUF_SIZE_MIN,
+ TCP_RCV_BUF_SIZE,
+ TCP_RCV_BUF_SIZE,
+ Option->ReceiveBufferSize
+ )
+ )
);
SET_SND_BUFFSIZE (
Sk,
- TCP_COMP_VAL (TCP_SND_BUF_SIZE_MIN,
- TCP_SND_BUF_SIZE,
- TCP_SND_BUF_SIZE,
- Option->SendBufferSize)
+ (UINT32) (TCP_COMP_VAL (
+ TCP_SND_BUF_SIZE_MIN,
+ TCP_SND_BUF_SIZE,
+ TCP_SND_BUF_SIZE,
+ Option->SendBufferSize
+ )
+ )
);
SET_BACKLOG (
Sk,
- TCP_COMP_VAL (TCP_BACKLOG_MIN,
- TCP_BACKLOG,
- TCP_BACKLOG,
- Option->MaxSynBackLog)
+ (UINT32) (TCP_COMP_VAL (
+ TCP_BACKLOG_MIN,
+ TCP_BACKLOG,
+ TCP_BACKLOG,
+ Option->MaxSynBackLog
+ )
+ )
);
Tcb->MaxRexmit = (UINT16) TCP_COMP_VAL (
@@ -472,7 +480,7 @@ Tcp4ConfigurePcb ( TCP_FIN_WAIT2_TIME,
TCP_FIN_WAIT2_TIME_MAX,
TCP_FIN_WAIT2_TIME,
- Option->FinTimeout * TCP_TICK_HZ
+ (UINT32) (Option->FinTimeout * TCP_TICK_HZ)
);
if (Option->TimeWaitTimeout != 0) {
@@ -480,7 +488,7 @@ Tcp4ConfigurePcb ( TCP_TIME_WAIT_TIME,
TCP_TIME_WAIT_TIME_MAX,
TCP_TIME_WAIT_TIME,
- Option->TimeWaitTimeout * TCP_TICK_HZ
+ (UINT32) (Option->TimeWaitTimeout * TCP_TICK_HZ)
);
} else {
Tcb->TimeWaitTimeout = 0;
@@ -499,13 +507,13 @@ Tcp4ConfigurePcb ( TCP_KEEPALIVE_IDLE_MIN,
TCP_KEEPALIVE_IDLE_MAX,
TCP_KEEPALIVE_IDLE_MIN,
- Option->KeepAliveTime * TCP_TICK_HZ
+ (UINT32) (Option->KeepAliveTime * TCP_TICK_HZ)
);
Tcb->KeepAlivePeriod = TCP_COMP_VAL (
TCP_KEEPALIVE_PERIOD_MIN,
TCP_KEEPALIVE_PERIOD,
TCP_KEEPALIVE_PERIOD,
- Option->KeepAliveInterval * TCP_TICK_HZ
+ (UINT32) (Option->KeepAliveInterval * TCP_TICK_HZ)
);
}
@@ -513,7 +521,7 @@ Tcp4ConfigurePcb ( TCP_CONNECT_TIME_MIN,
TCP_CONNECT_TIME,
TCP_CONNECT_TIME,
- Option->ConnectionTimeout * TCP_TICK_HZ
+ (UINT32) (Option->ConnectionTimeout * TCP_TICK_HZ)
);
if (Option->EnableNagle == FALSE) {
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c index 2927849285..002cd61089 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c @@ -44,7 +44,7 @@ EFI_TCP4_PROTOCOL mTcp4ProtocolTemplate = { SOCK_INIT_DATA mTcp4DefaultSockData = {
SOCK_STREAM,
- 0,
+ (SOCK_STATE) 0,
NULL,
TCP_BACKLOG,
TCP_SND_BUF_SIZE,
@@ -192,8 +192,8 @@ Returns: //
Seed = NetRandomInitSeed ();
mTcpGlobalIss = NET_RANDOM (Seed) % mTcpGlobalIss;
- mTcp4RandomPort = TCP4_PORT_KNOWN +
- (UINT16) (NET_RANDOM(Seed) % TCP4_PORT_KNOWN);
+ mTcp4RandomPort = (UINT16) ( TCP4_PORT_KNOWN +
+ (UINT16) (NET_RANDOM(Seed) % TCP4_PORT_KNOWN));
return Status;
}
@@ -306,7 +306,7 @@ Tcp4DriverBindingStart ( //
NetZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA));
- OpenData.IpConfigData = mIpIoDefaultIpConfigData;
+ CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
OpenData.IpConfigData.DefaultProtocol = EFI_IP_PROTO_TCP;
OpenData.PktRcvdNotify = Tcp4RxCallback;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c index 8a8cd8a9e3..8f5a997957 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.c @@ -48,7 +48,7 @@ Tcp4ChkDataBuf ( UINT32 Len;
for (Index = 0, Len = 0; Index < FragmentCount; Index++) {
- Len = Len + FragmentTable[Index].FragmentLength;
+ Len = Len + (UINT32) FragmentTable[Index].FragmentLength;
}
if (DataLen != Len) {
@@ -380,8 +380,8 @@ Tcp4Transmit ( }
Status = Tcp4ChkDataBuf (
- Token->Packet.TxData->DataLength,
- Token->Packet.TxData->FragmentCount,
+ (UINT32) Token->Packet.TxData->DataLength,
+ (UINT32) Token->Packet.TxData->FragmentCount,
Token->Packet.TxData->FragmentTable
);
if (EFI_ERROR (Status)) {
@@ -447,8 +447,8 @@ Tcp4Receive ( }
Status = Tcp4ChkDataBuf (
- Token->Packet.RxData->DataLength,
- Token->Packet.RxData->FragmentCount,
+ (UINT32) Token->Packet.RxData->DataLength,
+ (UINT32) Token->Packet.RxData->FragmentCount,
Token->Packet.RxData->FragmentTable
);
if (EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c index 7f1f141bc8..9cb55a567d 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c @@ -123,7 +123,7 @@ TcpInitTcbPeer ( }
if (TCP_FLG_ON (Opt->Flag, TCP_OPTION_RCVD_MSS)) {
- Tcb->SndMss = NET_MAX (64, Opt->Mss);
+ Tcb->SndMss = (UINT16) NET_MAX (64, Opt->Mss);
RcvMss = TcpGetRcvMss (Tcb->Sk);
if (Tcb->SndMss > RcvMss) {
@@ -568,7 +568,7 @@ TcpChecksum ( HTONS ((UINT16) Nbuf->TotalSize)
);
- return ~Checksum;
+ return (UINT16) ~Checksum;
}
@@ -806,6 +806,7 @@ TcpOnAppConsume ( IN TCP_CB *Tcb
)
{
+ UINT32 TcpOld;
switch (Tcb->State) {
case TCP_CLOSED:
@@ -822,9 +823,10 @@ TcpOnAppConsume ( break;
case TCP_ESTABLISHED:
- if (TcpRcvWinNow (Tcb) > TcpRcvWinOld (Tcb)) {
+ TcpOld = TcpRcvWinOld (Tcb);
+ if (TcpRcvWinNow (Tcb) > TcpOld) {
- if (TcpRcvWinOld (Tcb) < Tcb->RcvMss) {
+ if (TcpOld < Tcb->RcvMss) {
TCP4_DEBUG_TRACE (("TcpOnAppConsume: send a window"
" update for a window closed Tcb(%x)\n", Tcb));
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c index d430a2e10d..b81f442a6f 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.c @@ -114,7 +114,7 @@ TcpSynBuildOption ( IN NET_BUF *Nbuf
)
{
- char *Data;
+ UINT8 *Data;
UINT16 Len;
ASSERT (Tcb && Nbuf && !Nbuf->Tcp);
@@ -193,7 +193,7 @@ TcpBuildOption ( IN NET_BUF *Nbuf
)
{
- char *Data;
+ UINT8 *Data;
UINT16 Len;
ASSERT (Tcb && Nbuf && !Nbuf->Tcp);
@@ -303,7 +303,7 @@ TcpParseOption ( return -1;
}
- Option->WndScale = NET_MIN (14, Head[Cur + 2]);
+ Option->WndScale = (UINT8) NET_MIN (14, Head[Cur + 2]);
TCP_SET_FLG (Option->Flag, TCP_OPTION_RCVD_WS);
Cur += TCP_OPTION_WS_LEN;
@@ -340,7 +340,7 @@ TcpParseOption ( return -1;
}
- Cur = Cur + Len;
+ Cur = (UINT8) (Cur + Len);
break;
}
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h index 8074cb5564..cae0e885cf 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h @@ -72,7 +72,7 @@ enum { TCP_OPTION_MAX_WIN = 0xffff, // max window size in TCP header TCP_OPTION_RCVD_MSS = 0x01, TCP_OPTION_RCVD_WS = 0x02, - TCP_OPTION_RCVD_TS = 0x04, + TCP_OPTION_RCVD_TS = 0x04 }; UINT8 diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c index f2987e769c..870403fa2e 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c @@ -1003,6 +1003,9 @@ TcpToSendAck ( IN TCP_CB *Tcb
)
{
+ UINT32 TcpNow;
+
+ TcpNow = TcpRcvWinNow (Tcb);
//
// Generally, TCP should send a delayed ACK unless:
// 1. ACK at least every other FULL sized segment received,
@@ -1011,7 +1014,7 @@ TcpToSendAck ( //
if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW) ||
(Tcb->DelayedAck >= 1) ||
- (TcpRcvWinNow (Tcb) > TcpRcvWinOld (Tcb))
+ (TcpNow > TcpRcvWinOld (Tcb))
) {
TcpSendAck (Tcb);
return;
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h index 03daa6f04e..a35a51b3cc 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h @@ -42,7 +42,7 @@ enum { TCP_CLOSING, TCP_TIME_WAIT, TCP_CLOSE_WAIT, - TCP_LAST_ACK, + TCP_LAST_ACK }; // @@ -56,7 +56,7 @@ enum { TCP_FLG_PSH = 0x08, TCP_FLG_ACK = 0x10, TCP_FLG_URG = 0x20, - TCP_FLG_FLAG = 0x3F, // mask for all the flags + TCP_FLG_FLAG = 0x3F // mask for all the flags }; enum { @@ -144,7 +144,7 @@ enum { TCP_KEEPALIVE_IDLE_MAX = TCP_TICK_HZ *60 *60 *4, TCP_KEEPALIVE_PERIOD_MIN= TCP_TICK_HZ *30, TCP_FIN_WAIT2_TIME_MAX = 4 *TCP_TICK_HZ, - TCP_TIME_WAIT_TIME_MAX = 60 *TCP_TICK_HZ, + TCP_TIME_WAIT_TIME_MAX = 60 *TCP_TICK_HZ }; typedef struct _TCP_SEG { @@ -165,7 +165,7 @@ typedef struct _TCP_PEER { // // tcp control block, it includes various states // -typedef struct _TCP_CB { +struct _TCP_CB { NET_LIST_ENTRY List; TCP_CB *Parent; @@ -269,7 +269,7 @@ typedef struct _TCP_CB { // pointer reference to Ip used to send pkt // IP_IO_IP_INFO *IpInfo; -} TCP_CB; +}; extern NET_LIST_ENTRY mTcpRunQue; extern NET_LIST_ENTRY mTcpListenQue; @@ -336,8 +336,8 @@ extern UINT32 mTcpTick; (((Pb)->Port == 0) || ((Pb)->Port == (Pa)->Port))) #define TCP_TIMER_ON(Flag, Timer) ((Flag) & (1 << (Timer))) -#define TCP_SET_TIMER(Flag, Timer) ((Flag) |= (1 << (Timer))) -#define TCP_CLEAR_TIMER(Flag, Timer) ((Flag) &= ~(1 << (Timer))) +#define TCP_SET_TIMER(Flag, Timer) ((Flag) = (UINT16) ((Flag) | (1 << (Timer)))) +#define TCP_CLEAR_TIMER(Flag, Timer) ((Flag) = (UINT16) ((Flag) & (~(1 << (Timer))))) #define TCP_TIME_LT(Ta, Tb) ((INT32) ((Ta) - (Tb)) < 0) #define TCP_TIME_LEQ(Ta, Tb) ((INT32) ((Ta) - (Tb)) <= 0) |