From e499fbc00b5ae41a5900a0e7625a86b692b84c39 Mon Sep 17 00:00:00 2001 From: Tony Josi Date: Wed, 12 Jul 2023 11:49:45 +0530 Subject: [PATCH 1/2] update debug logs, fix stm32f build when ipconfigSUPPORT_NETWORK_DOWN_EVENT is enabled --- source/FreeRTOS_Routing.c | 8 ++++---- .../portable/NetworkInterface/STM32Fxx/NetworkInterface.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/FreeRTOS_Routing.c b/source/FreeRTOS_Routing.c index d0dfbbb3d..a5a1314ef 100644 --- a/source/FreeRTOS_Routing.c +++ b/source/FreeRTOS_Routing.c @@ -594,7 +594,7 @@ struct xIPv6_Couple /* This was only for debugging. */ if( pxEndPoint == NULL ) { - FreeRTOS_printf( ( "FreeRTOS_FindEndPointOnNetMask[%d]: No match for %xip\n", + FreeRTOS_debug_printf( ( "FreeRTOS_FindEndPointOnNetMask[%d]: No match for %xip\n", ( unsigned ) ulWhere, ( unsigned ) FreeRTOS_ntohl( ulIPAddress ) ) ); } @@ -766,7 +766,7 @@ struct xIPv6_Couple if( xGatewayTarget == pdTRUE ) { - FreeRTOS_printf( ( " GW address %pip to %pip\n", + FreeRTOS_debug_printf( ( " GW address %pip to %pip\n", pxIPAddressFrom->xIP_IPv6.ucBytes, pxIPAddressTo->xIP_IPv6.ucBytes ) ); } @@ -872,7 +872,7 @@ struct xIPv6_Couple pcBufferFrom, sizeof( pcBufferFrom ) ); - FreeRTOS_printf( ( "EasyFit[%x]: %d %d %d ( %s ->%s ) BAD\n", + FreeRTOS_debug_printf( ( "EasyFit[%x]: %d %d %d ( %s ->%s ) BAD\n", usFrameType, ( unsigned ) xCount[ 0 ], ( unsigned ) xCount[ 1 ], @@ -984,7 +984,7 @@ struct xIPv6_Couple /* do nothing, coverity happy */ } - FreeRTOS_printf( ( "pxEasyFit: ARP %xip -> %xip\n", ( unsigned ) FreeRTOS_ntohl( xIPAddressFrom.ulIP_IPv4 ), ( unsigned ) FreeRTOS_ntohl( xIPAddressTo.ulIP_IPv4 ) ) ); + FreeRTOS_debug_printf( ( "pxEasyFit: ARP %xip -> %xip\n", ( unsigned ) FreeRTOS_ntohl( xIPAddressFrom.ulIP_IPv4 ), ( unsigned ) FreeRTOS_ntohl( xIPAddressTo.ulIP_IPv4 ) ) ); } xDoProcessPacket = pdTRUE; #endif /* ( ipconfigUSE_IPv4 != 0 ) */ diff --git a/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c b/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c index 0b20602ec..1ca0f186e 100644 --- a/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c +++ b/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c @@ -994,7 +994,7 @@ static BaseType_t xMayAcceptPacket( uint8_t * pucEthernetBuffer ) #endif ( *ipLOCAL_IP_ADDRESS_POINTER != 0 ) ) { - FreeRTOS_printf( ( "Drop IP %lxip\n", FreeRTOS_ntohl( ulDestinationIPAddress ) ) ); + FreeRTOS_debug_printf( ( "Drop IP %lxip\n", FreeRTOS_ntohl( ulDestinationIPAddress ) ) ); return pdFALSE; } @@ -1503,9 +1503,9 @@ static void prvEMACHandlerTask( void * pvParameters ) #if ( ipconfigSUPPORT_NETWORK_DOWN_EVENT != 0 ) { - if( xGetPhyLinkStatus() == pdFALSE ) + if( xGetPhyLinkStatus( pxMyInterface ) == pdFALSE ) { - FreeRTOS_NetworkDown(); + FreeRTOS_NetworkDown( pxMyInterface ); } } #endif /* ( ipconfigSUPPORT_NETWORK_DOWN_EVENT != 0 ) */ From d981db59a99a2bface048b4823c8d35286715094 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Wed, 12 Jul 2023 11:53:50 +0530 Subject: [PATCH 2/2] fix formatting --- source/FreeRTOS_Routing.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/FreeRTOS_Routing.c b/source/FreeRTOS_Routing.c index a5a1314ef..65304fc49 100644 --- a/source/FreeRTOS_Routing.c +++ b/source/FreeRTOS_Routing.c @@ -595,7 +595,7 @@ struct xIPv6_Couple if( pxEndPoint == NULL ) { FreeRTOS_debug_printf( ( "FreeRTOS_FindEndPointOnNetMask[%d]: No match for %xip\n", - ( unsigned ) ulWhere, ( unsigned ) FreeRTOS_ntohl( ulIPAddress ) ) ); + ( unsigned ) ulWhere, ( unsigned ) FreeRTOS_ntohl( ulIPAddress ) ) ); } return pxEndPoint; @@ -767,8 +767,8 @@ struct xIPv6_Couple if( xGatewayTarget == pdTRUE ) { FreeRTOS_debug_printf( ( " GW address %pip to %pip\n", - pxIPAddressFrom->xIP_IPv6.ucBytes, - pxIPAddressTo->xIP_IPv6.ucBytes ) ); + pxIPAddressFrom->xIP_IPv6.ucBytes, + pxIPAddressTo->xIP_IPv6.ucBytes ) ); } xTargetGlobal = ( xIPv6_GetIPType( &( pxIPAddressTo->xIP_IPv6 ) ) == eIPv6_Global ) ? pdTRUE : pdFALSE; @@ -873,12 +873,12 @@ struct xIPv6_Couple sizeof( pcBufferFrom ) ); FreeRTOS_debug_printf( ( "EasyFit[%x]: %d %d %d ( %s ->%s ) BAD\n", - usFrameType, - ( unsigned ) xCount[ 0 ], - ( unsigned ) xCount[ 1 ], - ( unsigned ) xCount[ 2 ], - ( xRetNtopFrom == NULL ) ? "INVALID" : pcBufferFrom, - ( xRetNtopTo == NULL ) ? "INVALID" : pcBufferTo ) ); + usFrameType, + ( unsigned ) xCount[ 0 ], + ( unsigned ) xCount[ 1 ], + ( unsigned ) xCount[ 2 ], + ( xRetNtopFrom == NULL ) ? "INVALID" : pcBufferFrom, + ( xRetNtopTo == NULL ) ? "INVALID" : pcBufferTo ) ); } #endif /* ( ipconfigHAS_PRINTF != 0 ) */