MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / TcpUpdateTimer

Function TcpUpdateTimer

NetworkPkg/TcpDxe/TcpTimer.c:337–361  ·  view source on GitHub ↗

Update the timer status and the next expire time according to the timers to expire in a specific future time slot. @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance. **/

Source from the content-addressed store, hash-verified

335
336**/
337VOID
338TcpUpdateTimer (
339 IN OUT TCP_CB *Tcb
340 )
341{
342 UINT16 Index;
343
344 //
345 // Don't use a too large value to init NextExpire
346 // since mTcpTick wraps around as sequence no does.
347 //
348 Tcb->NextExpire = TCP_EXPIRE_TIME;
349 TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_TIMER_ON);
350
351 for (Index = 0; Index < TCP_TIMER_NUMBER; Index++) {
352
353 if (TCP_TIMER_ON (Tcb->EnabledTimer, Index) &&
354 TCP_TIME_LT (Tcb->Timer[Index], mTcpTick + Tcb->NextExpire)
355 ) {
356
357 Tcb->NextExpire = TCP_SUB_TIME (Tcb->Timer[Index], mTcpTick);
358 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_TIMER_ON);
359 }
360 }
361}
362
363/**
364 Enable a TCP timer.

Callers 4

TcpSetTimerFunction · 0.85
TcpClearTimerFunction · 0.85
TcpClearAllTimerFunction · 0.85
TcpTickingDpcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected