diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:07 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | d1050b9dff1cace252aff86630bfdb59dff5f507 (patch) | |
tree | 77f796143980742d97a883f62ce339a270474801 /NetworkPkg/TcpDxe/TcpTimer.c | |
parent | 2f88bd3a1296c522317f1c21377876de63de5be7 (diff) | |
download | edk2-d1050b9dff1cace252aff86630bfdb59dff5f507.zip edk2-d1050b9dff1cace252aff86630bfdb59dff5f507.tar.gz edk2-d1050b9dff1cace252aff86630bfdb59dff5f507.tar.bz2 |
NetworkPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the NetworkPkg package
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Diffstat (limited to 'NetworkPkg/TcpDxe/TcpTimer.c')
-rw-r--r-- | NetworkPkg/TcpDxe/TcpTimer.c | 138 |
1 files changed, 61 insertions, 77 deletions
diff --git a/NetworkPkg/TcpDxe/TcpTimer.c b/NetworkPkg/TcpDxe/TcpTimer.c index 04caf8e..5d2e124 100644 --- a/NetworkPkg/TcpDxe/TcpTimer.c +++ b/NetworkPkg/TcpDxe/TcpTimer.c @@ -9,7 +9,7 @@ #include "TcpMain.h"
-UINT32 mTcpTick = 1000;
+UINT32 mTcpTick = 1000;
/**
Connect timeout handler.
@@ -19,7 +19,7 @@ UINT32 mTcpTick = 1000; **/
VOID
TcpConnectTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
);
/**
@@ -30,7 +30,7 @@ TcpConnectTimeout ( **/
VOID
TcpRexmitTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
);
/**
@@ -41,7 +41,7 @@ TcpRexmitTimeout ( **/
VOID
TcpProbeTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
);
/**
@@ -52,7 +52,7 @@ TcpProbeTimeout ( **/
VOID
TcpKeepaliveTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
);
/**
@@ -63,7 +63,7 @@ TcpKeepaliveTimeout ( **/
VOID
TcpFinwait2Timeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
);
/**
@@ -74,10 +74,10 @@ TcpFinwait2Timeout ( **/
VOID
Tcp2MSLTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
);
-TCP_TIMER_HANDLER mTcpTimerHandler[TCP_TIMER_NUMBER] = {
+TCP_TIMER_HANDLER mTcpTimerHandler[TCP_TIMER_NUMBER] = {
TcpConnectTimeout,
TcpRexmitTimeout,
TcpProbeTimeout,
@@ -94,7 +94,7 @@ TCP_TIMER_HANDLER mTcpTimerHandler[TCP_TIMER_NUMBER] = { **/
VOID
TcpClose (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
NetbufFreeList (&Tcb->SndQue);
@@ -111,7 +111,7 @@ TcpClose ( **/
VOID
TcpBackoffRto (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
//
@@ -121,16 +121,14 @@ TcpBackoffRto ( //
if ((Tcb->LossTimes >= TCP_FOLD_RTT) && (Tcb->SRtt != 0)) {
Tcb->RttVar += Tcb->SRtt >> 2;
- Tcb->SRtt = 0;
+ Tcb->SRtt = 0;
}
Tcb->Rto <<= 1;
if (Tcb->Rto < TCP_RTO_MIN) {
-
Tcb->Rto = TCP_RTO_MIN;
} else if (Tcb->Rto > TCP_RTO_MAX) {
-
Tcb->Rto = TCP_RTO_MAX;
}
}
@@ -143,14 +141,14 @@ TcpBackoffRto ( **/
VOID
TcpConnectTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
if (!TCP_CONNECTED (Tcb->State)) {
DEBUG (
(DEBUG_ERROR,
- "TcpConnectTimeout: connection closed because connection timer timeout for TCB %p\n",
- Tcb)
+ "TcpConnectTimeout: connection closed because connection timer timeout for TCB %p\n",
+ Tcb)
);
if (EFI_ABORTED == Tcb->Sk->SockError) {
@@ -160,19 +158,17 @@ TcpConnectTimeout ( if (TCP_SYN_RCVD == Tcb->State) {
DEBUG (
(DEBUG_WARN,
- "TcpConnectTimeout: send reset because connection timer timeout for TCB %p\n",
- Tcb)
+ "TcpConnectTimeout: send reset because connection timer timeout for TCB %p\n",
+ Tcb)
);
TcpResetConnection (Tcb);
-
}
TcpClose (Tcb);
}
}
-
/**
Timeout handler for TCP retransmission timer.
@@ -181,15 +177,15 @@ TcpConnectTimeout ( **/
VOID
TcpRexmitTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
UINT32 FlightSize;
DEBUG (
(DEBUG_WARN,
- "TcpRexmitTimeout: transmission timeout for TCB %p\n",
- Tcb)
+ "TcpRexmitTimeout: transmission timeout for TCB %p\n",
+ Tcb)
);
//
@@ -197,19 +193,18 @@ TcpRexmitTimeout ( // amount of data that has been sent but not
// yet ACKed.
//
- FlightSize = TCP_SUB_SEQ (Tcb->SndNxt, Tcb->SndUna);
- Tcb->Ssthresh = MAX ((UINT32) (2 * Tcb->SndMss), FlightSize / 2);
+ FlightSize = TCP_SUB_SEQ (Tcb->SndNxt, Tcb->SndUna);
+ Tcb->Ssthresh = MAX ((UINT32)(2 * Tcb->SndMss), FlightSize / 2);
- Tcb->CWnd = Tcb->SndMss;
- Tcb->LossRecover = Tcb->SndNxt;
+ Tcb->CWnd = Tcb->SndMss;
+ Tcb->LossRecover = Tcb->SndNxt;
Tcb->LossTimes++;
if ((Tcb->LossTimes > Tcb->MaxRexmit) && !TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_CONNECT)) {
-
DEBUG (
(DEBUG_ERROR,
- "TcpRexmitTimeout: connection closed because too many timeouts for TCB %p\n",
- Tcb)
+ "TcpRexmitTimeout: connection closed because too many timeouts for TCB %p\n",
+ Tcb)
);
if (EFI_ABORTED == Tcb->Sk->SockError) {
@@ -217,7 +212,7 @@ TcpRexmitTimeout ( }
TcpClose (Tcb);
- return ;
+ return;
}
TcpBackoffRto (Tcb);
@@ -237,7 +232,7 @@ TcpRexmitTimeout ( **/
VOID
TcpProbeTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
//
@@ -247,10 +242,9 @@ TcpProbeTimeout ( // the probe timer, since retransmit timer is on.
//
if ((TcpDataToSend (Tcb, 1) != 0) && (TcpToSendData (Tcb, 1) > 0)) {
-
ASSERT (TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT) != 0);
Tcb->ProbeTimerOn = FALSE;
- return ;
+ return;
}
TcpSendZeroProbe (Tcb);
@@ -265,7 +259,7 @@ TcpProbeTimeout ( **/
VOID
TcpKeepaliveTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
Tcb->KeepAliveProbes++;
@@ -274,13 +268,12 @@ TcpKeepaliveTimeout ( // Too many Keep-alive probes, drop the connection
//
if (Tcb->KeepAliveProbes > Tcb->MaxKeepAlive) {
-
if (EFI_ABORTED == Tcb->Sk->SockError) {
SOCK_ERROR (Tcb->Sk, EFI_TIMEOUT);
}
TcpClose (Tcb);
- return ;
+ return;
}
TcpSendZeroProbe (Tcb);
@@ -295,13 +288,13 @@ TcpKeepaliveTimeout ( **/
VOID
TcpFinwait2Timeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
DEBUG (
(DEBUG_WARN,
- "TcpFinwait2Timeout: connection closed because FIN_WAIT2 timer timeouts for TCB %p\n",
- Tcb)
+ "TcpFinwait2Timeout: connection closed because FIN_WAIT2 timer timeouts for TCB %p\n",
+ Tcb)
);
TcpClose (Tcb);
@@ -315,13 +308,13 @@ TcpFinwait2Timeout ( **/
VOID
Tcp2MSLTimeout (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
DEBUG (
(DEBUG_WARN,
- "Tcp2MSLTimeout: connection closed because TIME_WAIT timer timeouts for TCB %p\n",
- Tcb)
+ "Tcp2MSLTimeout: connection closed because TIME_WAIT timer timeouts for TCB %p\n",
+ Tcb)
);
TcpClose (Tcb);
@@ -336,7 +329,7 @@ Tcp2MSLTimeout ( **/
VOID
TcpUpdateTimer (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
UINT16 Index;
@@ -349,11 +342,10 @@ TcpUpdateTimer ( TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_TIMER_ON);
for (Index = 0; Index < TCP_TIMER_NUMBER; Index++) {
-
if (TCP_TIMER_ON (Tcb->EnabledTimer, Index) &&
TCP_TIME_LT (Tcb->Timer[Index], mTcpTick + Tcb->NextExpire)
- ) {
-
+ )
+ {
Tcb->NextExpire = TCP_SUB_TIME (Tcb->Timer[Index], mTcpTick);
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_TIMER_ON);
}
@@ -370,9 +362,9 @@ TcpUpdateTimer ( **/
VOID
TcpSetTimer (
- IN OUT TCP_CB *Tcb,
- IN UINT16 Timer,
- IN UINT32 TimeOut
+ IN OUT TCP_CB *Tcb,
+ IN UINT16 Timer,
+ IN UINT32 TimeOut
)
{
TCP_SET_TIMER (Tcb->EnabledTimer, Timer);
@@ -390,8 +382,8 @@ TcpSetTimer ( **/
VOID
TcpClearTimer (
- IN OUT TCP_CB *Tcb,
- IN UINT16 Timer
+ IN OUT TCP_CB *Tcb,
+ IN UINT16 Timer
)
{
TCP_CLEAR_TIMER (Tcb->EnabledTimer, Timer);
@@ -406,7 +398,7 @@ TcpClearTimer ( **/
VOID
TcpClearAllTimer (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
Tcb->EnabledTimer = 0;
@@ -421,22 +413,19 @@ TcpClearAllTimer ( **/
VOID
TcpSetProbeTimer (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
if (!Tcb->ProbeTimerOn) {
Tcb->ProbeTime = Tcb->Rto;
Tcb->ProbeTimerOn = TRUE;
-
} else {
Tcb->ProbeTime <<= 1;
}
if (Tcb->ProbeTime < TCP_RTO_MIN) {
-
Tcb->ProbeTime = TCP_RTO_MIN;
} else if (Tcb->ProbeTime > TCP_RTO_MAX) {
-
Tcb->ProbeTime = TCP_RTO_MAX;
}
@@ -451,12 +440,11 @@ TcpSetProbeTimer ( **/
VOID
TcpSetKeepaliveTimer (
- IN OUT TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
)
{
if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_KEEPALIVE)) {
- return ;
-
+ return;
}
//
@@ -468,13 +456,11 @@ TcpSetKeepaliveTimer ( //
if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_KEEPALIVE) ||
(Tcb->Idle < Tcb->KeepAliveIdle)
- ) {
-
+ )
+ {
TcpSetTimer (Tcb, TCP_TIMER_KEEPALIVE, Tcb->KeepAliveIdle);
Tcb->KeepAliveProbes = 0;
-
} else {
-
TcpSetTimer (Tcb, TCP_TIMER_KEEPALIVE, Tcb->KeepAlivePeriod);
}
}
@@ -488,13 +474,13 @@ TcpSetKeepaliveTimer ( VOID
EFIAPI
TcpTickingDpc (
- IN VOID *Context
+ IN VOID *Context
)
{
- LIST_ENTRY *Entry;
- LIST_ENTRY *Next;
- TCP_CB *Tcb;
- INT16 Index;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
+ TCP_CB *Tcb;
+ INT16 Index;
mTcpTick++;
mTcpGlobalIss += TCP_ISS_INCREMENT_2;
@@ -503,14 +489,14 @@ TcpTickingDpc ( // Don't use LIST_FOR_EACH, which isn't delete safe.
//
for (Entry = mTcpRunQue.ForwardLink; Entry != &mTcpRunQue; Entry = Next) {
+ Next = Entry->ForwardLink;
- Next = Entry->ForwardLink;
-
- Tcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
+ Tcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
if (Tcb->State == TCP_CLOSED) {
continue;
}
+
//
// The connection is doing RTT measurement.
//
@@ -524,7 +510,7 @@ TcpTickingDpc ( TcpSendAck (Tcb);
}
- if (Tcb->IpInfo->IpVersion == IP_VERSION_6 && Tcb->Tick > 0) {
+ if ((Tcb->IpInfo->IpVersion == IP_VERSION_6) && (Tcb->Tick > 0)) {
Tcb->Tick--;
}
@@ -532,7 +518,6 @@ TcpTickingDpc ( // No timer is active or no timer expired
//
if (!TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_TIMER_ON) || ((--Tcb->NextExpire) > 0)) {
-
continue;
}
@@ -540,7 +525,6 @@ TcpTickingDpc ( // Call the timeout handler for each expired timer.
//
for (Index = 0; Index < TCP_TIMER_NUMBER; Index++) {
-
if (TCP_TIMER_ON (Tcb->EnabledTimer, Index) && TCP_TIME_LEQ (Tcb->Timer[Index], mTcpTick)) {
//
// disable the timer before calling the handler
@@ -578,8 +562,8 @@ TcpTickingDpc ( VOID
EFIAPI
TcpTicking (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
QueueDpc (TPL_CALLBACK, TcpTickingDpc, Context);
|