Skip to content

Commit

Permalink
Remove xProcessedTCPMessage (#1122)
Browse files Browse the repository at this point in the history
* Remove xProcessedTCPMessage

* Uncrustify: triggered by comment

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Tony Josi <[email protected]>
  • Loading branch information
3 people authored Mar 25, 2024
1 parent e7ddc7d commit 04a4b54
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 37 deletions.
11 changes: 0 additions & 11 deletions source/FreeRTOS_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@
#endif
#endif

#if ( ipconfigUSE_TCP != 0 )

/** @brief Set to a non-zero value if one or more TCP message have been processed
* within the last round. */
BaseType_t xProcessedTCPMessage;
#endif

/** @brief If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1, then the Ethernet
* driver will filter incoming packets and only pass the stack those packets it
* considers need processing. In this case ipCONSIDER_FRAME_FOR_PROCESSING() can
Expand Down Expand Up @@ -2021,10 +2014,6 @@ static eFrameProcessingResult_t prvProcessIPPacket( const IPPacket_t * pxIPPacke
{
eReturn = eFrameConsumed;
}

/* Setting this variable will cause xTCPTimerCheck()
* to be called just before the IP-task blocks. */
xProcessedTCPMessage++;
break;
#endif /* if ipconfigUSE_TCP == 1 */
default:
Expand Down
1 change: 0 additions & 1 deletion source/FreeRTOS_IP_Timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ void vCheckNetworkTimers( void )
* check must be repeated. */
xNextTime = xTCPTimerCheck( xWillSleep );
prvIPTimerStart( &xTCPTimer, xNextTime );
xProcessedTCPMessage = 0;
}
}

Expand Down
7 changes: 0 additions & 7 deletions source/include/FreeRTOS_IP.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,6 @@ extern NetworkBufferDescriptor_t * pxARPWaitingNetworkBuffer;
#define vPrintResourceStats() do {} while( ipFALSE_BOOL ) /**< ipconfigHAS_PRINTF is not defined. Define vPrintResourceStats to a do-while( 0 ). */
#endif

#if ( ipconfigUSE_TCP != 0 )

/** @brief Set to a non-zero value if one or more TCP message have been processed
* within the last round. */
extern BaseType_t xProcessedTCPMessage;
#endif

#include "FreeRTOS_IP_Utils.h" /*TODO can be moved after other 2 includes */


Expand Down
4 changes: 0 additions & 4 deletions test/unit-test/FreeRTOS_IP/FreeRTOS_IP_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2659,7 +2659,6 @@ void test_prvProcessIPPacket_TCP( void )
uint8_t ucEthBuffer[ ipconfigTCP_MSS ];
IPHeader_t * pxIPHeader;
BaseType_t xReturnValue = pdTRUE;
uint32_t backup = xProcessedTCPMessage;
struct xNetworkInterface xInterface;

memset( ucEthBuffer, 0, ipconfigTCP_MSS );
Expand Down Expand Up @@ -2689,7 +2688,6 @@ void test_prvProcessIPPacket_TCP( void )
eResult = prvProcessIPPacket( pxIPPacket, pxNetworkBuffer );

TEST_ASSERT_EQUAL( eFrameConsumed, eResult );
TEST_ASSERT_EQUAL( backup + 1, xProcessedTCPMessage );
}

/**
Expand All @@ -2705,7 +2703,6 @@ void test_prvProcessIPPacket_TCPProcessFail( void )
uint8_t ucEthBuffer[ ipconfigTCP_MSS ];
IPHeader_t * pxIPHeader;
BaseType_t xReturnValue = pdTRUE;
uint32_t backup = xProcessedTCPMessage;
NetworkEndPoint_t xEndPoint = { 0 };
struct xNetworkInterface xInterface;

Expand Down Expand Up @@ -2736,7 +2733,6 @@ void test_prvProcessIPPacket_TCPProcessFail( void )
eResult = prvProcessIPPacket( pxIPPacket, pxNetworkBuffer );

TEST_ASSERT_EQUAL( eProcessBuffer, eResult );
TEST_ASSERT_EQUAL( backup + 1, xProcessedTCPMessage );
}

/**
Expand Down
2 changes: 0 additions & 2 deletions test/unit-test/FreeRTOS_IP_Timers/FreeRTOS_IP_Timers_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ volatile BaseType_t xInsideInterrupt = pdFALSE;

NetworkBufferDescriptor_t * pxARPWaitingNetworkBuffer;

BaseType_t xProcessedTCPMessage;

struct xNetworkEndPoint * pxNetworkEndPoints;
struct xNetworkInterface * pxNetworkInterfaces;

Expand Down
12 changes: 0 additions & 12 deletions test/unit-test/FreeRTOS_IP_Timers/FreeRTOS_IP_Timers_utest.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ extern IPTimer_t xARPTimer;
extern IPTimer_t xDNSTimer;
#endif

#if ( ipconfigUSE_TCP != 0 )

/** @brief Set to a non-zero value if one or more TCP message have been processed
* within the last round. */
extern BaseType_t xProcessedTCPMessage;
#endif

extern IPTimer_t xARPResolutionTimer;
extern BaseType_t xAllNetworksUp;
extern IPTimer_t xNetworkTimer;
Expand Down Expand Up @@ -636,8 +629,6 @@ void test_vCheckNetworkTimers_AllTimersInactivePendingMessages( void )
xTCPTimer.bActive = pdFALSE;
xARPResolutionTimer.bActive = pdFALSE;

xProcessedTCPMessage = pdTRUE;

uxQueueMessagesWaiting_ExpectAnyArgsAndReturn( pdTRUE );

vSocketCloseNextTime_Expect( NULL );
Expand All @@ -660,8 +651,6 @@ void test_vCheckNetworkTimers_AllTimersInactive_2( void )
xTCPTimer.bActive = pdFALSE;
xARPResolutionTimer.bActive = pdFALSE;

xProcessedTCPMessage = pdTRUE;

uxQueueMessagesWaiting_ExpectAnyArgsAndReturn( pdFALSE );

xTCPTimerCheck_ExpectAndReturn( pdTRUE, 0x123 );
Expand All @@ -674,7 +663,6 @@ void test_vCheckNetworkTimers_AllTimersInactive_2( void )

vCheckNetworkTimers();

TEST_ASSERT_EQUAL( 0, xProcessedTCPMessage );
TEST_ASSERT_EQUAL( 0x123, xTCPTimer.ulRemainingTime );
TEST_ASSERT_EQUAL( pdFALSE_UNSIGNED, xTCPTimer.bExpired );
TEST_ASSERT_EQUAL( pdTRUE_UNSIGNED, xTCPTimer.bActive );
Expand Down

0 comments on commit 04a4b54

Please sign in to comment.