Skip to content

Commit

Permalink
Remove ipCONSIDER_FRAME_FOR_PROCESSING macro
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Feb 15, 2024
1 parent 4f38649 commit 7f37651
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions source/FreeRTOS_IP.c
Expand Up @@ -99,20 +99,6 @@
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
* be #-defined away. If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 0
* then the Ethernet driver will pass all received packets to the stack, and the
* stack must do the filtering itself. In this case ipCONSIDER_FRAME_FOR_PROCESSING
* needs to call eConsiderFrameForProcessing.
*/
#if ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES == 0
#define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eConsiderFrameForProcessing( ( pucEthernetBuffer ) )
#else
#define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eProcessBuffer
#endif

static void prvCallDHCP_RA_Handler( NetworkEndPoint_t * pxEndPoint );

static void prvIPTask_Initialise( void );
Expand Down Expand Up @@ -1602,7 +1588,6 @@ eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucE
*/
static void prvProcessEthernetPacket( NetworkBufferDescriptor_t * const pxNetworkBuffer )
{
const EthernetHeader_t * pxEthernetHeader;
eFrameProcessingResult_t eReturned = eReleaseBuffer;

/* Use do{}while(pdFALSE) to allow the use of break; */
Expand Down Expand Up @@ -1634,22 +1619,12 @@ static void prvProcessEthernetPacket( NetworkBufferDescriptor_t * const pxNetwor
break;
}

eReturned = ipCONSIDER_FRAME_FOR_PROCESSING( pxNetworkBuffer->pucEthernetBuffer );

/* Map the buffer onto the Ethernet Header struct for easy access to the fields. */

/* MISRA Ref 11.3.1 [Misaligned access] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-113 */
/* coverity[misra_c_2012_rule_11_3_violation] */
pxEthernetHeader = ( ( const EthernetHeader_t * ) pxNetworkBuffer->pucEthernetBuffer );

/* The condition "eReturned == eProcessBuffer" must be true. */
#if ( ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES == 0 )
if( eReturned == eProcessBuffer )
if( eConsiderFrameForProcessing( pxNetworkBuffer->pucEthernetBuffer ) == eProcessBuffer )
#endif
{
/* Interpret the received Ethernet packet. */
switch( pxEthernetHeader->usFrameType )
switch( ( ( const EthernetHeader_t * ) pxNetworkBuffer->pucEthernetBuffer )->usFrameType )
{
#if ( ipconfigUSE_IPv4 != 0 )
case ipARP_FRAME_TYPE:
Expand Down

0 comments on commit 7f37651

Please sign in to comment.