From b43eb50eb9d932a441d3f72577865111164f1b6a Mon Sep 17 00:00:00 2001 From: Peter-Herrmann Date: Thu, 31 Aug 2023 14:36:24 -0700 Subject: [PATCH 1/8] warning cleanup - purely refactoring --- .../NetworkInterface/DriverSAM/NetworkInterface.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index 3540a324a..74194a956 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -204,14 +204,17 @@ static void hand_tx_errors( void ); static uint16_t prvGenerateCRC16( const uint8_t * pucAddress ); static void prvAddMulticastMACAddress( const uint8_t * ucMacAddress ); +/* Checks IP queue, buffers, and semaphore and logs diagnostic info if configured */ +void vCheckBuffersAndQueue( void ); + +/* return 'puc_buffer' to the pool of transmission buffers. */ +void returnTxBuffer( uint8_t * puc_buffer ); + /*-----------------------------------------------------------*/ /* A copy of PHY register 1: 'PHY_REG_01_BMSR' */ static BaseType_t xGMACSwitchRequired; -/* LLMNR multicast address. */ -static const uint8_t llmnr_mac_address[] = { 0x01, 0x00, 0x5E, 0x00, 0x00, 0xFC }; - /* The GMAC object as defined by the ASF drivers. */ static gmac_device_t gs_gmac_dev; @@ -454,8 +457,6 @@ static BaseType_t xPHY_Write( BaseType_t xAddress, static BaseType_t prvSAM_NetworkInterfaceInitialise( NetworkInterface_t * pxInterface ) { - const TickType_t x5_Seconds = 5000UL; - if( xEMACTaskHandle == NULL ) { prvGMACInit( pxInterface ); @@ -673,9 +674,7 @@ static BaseType_t prvSAM_NetworkInterfaceOutput( NetworkInterface_t * pxInterfac static BaseType_t prvGMACInit( NetworkInterface_t * pxInterface ) { - uint32_t ncfgr; NetworkEndPoint_t * pxEndPoint; - BaseType_t xEntry = 1; gmac_options_t gmac_option; @@ -1126,14 +1125,12 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; - UBaseType_t uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 ) NetworkBufferDescriptor_t * pxBuffer; #endif uint8_t * pucBuffer; BaseType_t xResult = 0; - uint32_t xStatus; const TickType_t ulMaxBlockTime = pdMS_TO_TICKS( EMAC_MAX_BLOCK_TIME_MS ); uint32_t ulISREvents = 0U; From a715759cfd6c6908f9ac183a04c6e954c9a72c99 Mon Sep 17 00:00:00 2001 From: Peter-Herrmann Date: Fri, 1 Sep 2023 08:26:04 -0700 Subject: [PATCH 2/8] Incorporated PR feedback - Made vCheckBuffersAndQueue() static - Added uxLowestSemCount back into prvEMACHandlerTask, now modifying global instead of shadowing --- .../portable/NetworkInterface/DriverSAM/NetworkInterface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index 74194a956..2bc8a03f8 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -205,7 +205,7 @@ static uint16_t prvGenerateCRC16( const uint8_t * pucAddress ); static void prvAddMulticastMACAddress( const uint8_t * ucMacAddress ); /* Checks IP queue, buffers, and semaphore and logs diagnostic info if configured */ -void vCheckBuffersAndQueue( void ); +static void vCheckBuffersAndQueue( void ); /* return 'puc_buffer' to the pool of transmission buffers. */ void returnTxBuffer( uint8_t * puc_buffer ); @@ -1064,7 +1064,7 @@ volatile UBaseType_t uxLastMinBufferCount = 0; volatile UBaseType_t uxCurrentSemCount; volatile UBaseType_t uxLowestSemCount; -void vCheckBuffersAndQueue( void ) +static void vCheckBuffersAndQueue( void ) { static UBaseType_t uxCurrentCount; @@ -1125,6 +1125,7 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; + uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 ) NetworkBufferDescriptor_t * pxBuffer; From a487b0018d5a718b6513c61fd894563e5b9b3e2f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 2 Sep 2023 06:26:50 +0000 Subject: [PATCH 3/8] Uncrustify: triggered by comment. --- source/portable/NetworkInterface/DriverSAM/NetworkInterface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index 2bc8a03f8..aef7e3482 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -1125,6 +1125,7 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; + uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 ) From d5d9fdf3be547ee23dd12912752a6601940e16cf Mon Sep 17 00:00:00 2001 From: Rahul Kar Date: Sat, 2 Sep 2023 06:38:41 +0000 Subject: [PATCH 4/8] Fix formatting --- source/portable/NetworkInterface/DriverSAM/NetworkInterface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index aef7e3482..2bc8a03f8 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -1125,7 +1125,6 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; - uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 ) From 9f804af4746d8416e8fffbddfa92d2a35e4355a6 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 5 Sep 2023 21:36:46 +0000 Subject: [PATCH 5/8] Uncrustify: triggered by comment. --- source/portable/NetworkInterface/DriverSAM/NetworkInterface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index e946211e2..7ad92f940 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -1125,6 +1125,7 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; + uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 ) From 5bfbbb491e612e2863590f4c51347d7712eefb88 Mon Sep 17 00:00:00 2001 From: Peter-Herrmann Date: Tue, 5 Sep 2023 16:24:10 -0700 Subject: [PATCH 6/8] Un-doing uncrustify commit that breaks formatting rules --- source/portable/NetworkInterface/DriverSAM/NetworkInterface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index 7ad92f940..e946211e2 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -1125,7 +1125,6 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; - uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 ) From c2eab716c5a5c5e7203d8e56e8ddd8bfaf36f61b Mon Sep 17 00:00:00 2001 From: Peter-Herrmann Date: Tue, 5 Sep 2023 16:32:21 -0700 Subject: [PATCH 7/8] formatting fix --- source/portable/NetworkInterface/DriverSAM/NetworkInterface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index e946211e2..84ca59951 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -1125,6 +1125,7 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; + uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 ) From 25d994cf6928ccb3b6a3f003711fe99d6d75c17b Mon Sep 17 00:00:00 2001 From: Peter-Herrmann Date: Tue, 5 Sep 2023 16:33:42 -0700 Subject: [PATCH 8/8] formatting fix --- source/portable/NetworkInterface/DriverSAM/NetworkInterface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c index 84ca59951..7ad92f940 100644 --- a/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c +++ b/source/portable/NetworkInterface/DriverSAM/NetworkInterface.c @@ -1125,7 +1125,7 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB static void prvEMACHandlerTask( void * pvParameters ) { UBaseType_t uxCount; - + uxLowestSemCount = GMAC_TX_BUFFERS + 1; #if ( ipconfigZERO_COPY_TX_DRIVER != 0 )