1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-25 04:56:15 +08:00

Fix build issue with network interface of STM32F4 (#778)

* fix build errors with STM32F4 netwrok interface

* moves the default config for ipconfigUSE_DHCPv6 outside of ipconfigUSE_TCP check

* Uncrustify: triggered by comment.

---------

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tony Josi
2023-03-13 15:42:03 +05:30
committed by GitHub
parent f6d167d4e2
commit b4a928b354
2 changed files with 26 additions and 30 deletions

View File

@@ -189,12 +189,12 @@
#define ipconfigMULTI_INTERFACE ( 1 ) #define ipconfigMULTI_INTERFACE ( 1 )
#endif #endif
#if ( ipconfigUSE_TCP != 0 )
/* Disable IPv6 by default. */ /* Disable IPv6 by default. */
#ifndef ipconfigUSE_DHCPv6 #ifndef ipconfigUSE_DHCPv6
#define ipconfigUSE_DHCPv6 ( 0 ) #define ipconfigUSE_DHCPv6 ( 0 )
#endif #endif
#if ( ipconfigUSE_TCP != 0 )
/* 'ipconfigUSE_TCP_WIN' enables support for TCP sliding windows. When /* 'ipconfigUSE_TCP_WIN' enables support for TCP sliding windows. When
* defined as zero, each TCP packet must be acknowledged individually. * defined as zero, each TCP packet must be acknowledged individually.

View File

@@ -182,16 +182,14 @@ static void prvEthernetUpdateConfig( BaseType_t xForce );
*/ */
static BaseType_t prvNetworkInterfaceInput( void ); static BaseType_t prvNetworkInterfaceInput( void );
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_MDNS != 0 ) || ( ipconfigUSE_IPv6 != 0 )
/* /*
* For LLMNR, an extra MAC-address must be configured to * For LLMNR, an extra MAC-address must be configured to
* be able to receive the multicast messages. * be able to receive the multicast messages.
*/ */
static void prvMACAddressConfig( ETH_HandleTypeDef * heth, static void prvMACAddressConfig( ETH_HandleTypeDef * heth,
uint32_t ulIndex, uint32_t ulIndex,
uint8_t * Addr ); uint8_t * Addr );
#endif
/* FreeRTOS+TCP/multi : /* FreeRTOS+TCP/multi :
* Each network device has 3 access functions: * Each network device has 3 access functions:
@@ -452,9 +450,7 @@ BaseType_t xSTM32F_NetworkInterfaceInitialise( NetworkInterface_t * pxInterface
BaseType_t xResult; BaseType_t xResult;
NetworkEndPoint_t * pxEndPoint; NetworkEndPoint_t * pxEndPoint;
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_MDNS != 0 ) BaseType_t xMACEntry = ETH_MAC_ADDRESS1; /* ETH_MAC_ADDRESS0 reserved for the primary MAC-address. */
BaseType_t xMACEntry = ETH_MAC_ADDRESS1; /* ETH_MAC_ADDRESS0 reserved for the primary MAC-address. */
#endif
if( xMacInitStatus == eMACInit ) if( xMacInitStatus == eMACInit )
{ {
@@ -757,28 +753,28 @@ static void prvDMARxDescListInit()
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_MDNS != 0 )
static void prvMACAddressConfig( ETH_HandleTypeDef * heth,
uint32_t ulIndex,
uint8_t * Addr )
{
uint32_t ulTempReg;
( void ) heth; static void prvMACAddressConfig( ETH_HandleTypeDef * heth,
uint32_t ulIndex,
uint8_t * Addr )
{
uint32_t ulTempReg;
/* Calculate the selected MAC address high register. */ ( void ) heth;
ulTempReg = 0x80000000ul | ( ( uint32_t ) Addr[ 5 ] << 8 ) | ( uint32_t ) Addr[ 4 ];
/* Load the selected MAC address high register. */ /* Calculate the selected MAC address high register. */
( *( __IO uint32_t * ) ( ( uint32_t ) ( ETH_MAC_ADDR_HBASE + ulIndex ) ) ) = ulTempReg; ulTempReg = 0x80000000ul | ( ( uint32_t ) Addr[ 5 ] << 8 ) | ( uint32_t ) Addr[ 4 ];
/* Calculate the selected MAC address low register. */ /* Load the selected MAC address high register. */
ulTempReg = ( ( uint32_t ) Addr[ 3 ] << 24 ) | ( ( uint32_t ) Addr[ 2 ] << 16 ) | ( ( uint32_t ) Addr[ 1 ] << 8 ) | Addr[ 0 ]; ( *( __IO uint32_t * ) ( ( uint32_t ) ( ETH_MAC_ADDR_HBASE + ulIndex ) ) ) = ulTempReg;
/* Calculate the selected MAC address low register. */
ulTempReg = ( ( uint32_t ) Addr[ 3 ] << 24 ) | ( ( uint32_t ) Addr[ 2 ] << 16 ) | ( ( uint32_t ) Addr[ 1 ] << 8 ) | Addr[ 0 ];
/* Load the selected MAC address low register */
( *( __IO uint32_t * ) ( ( uint32_t ) ( ETH_MAC_ADDR_LBASE + ulIndex ) ) ) = ulTempReg;
}
/* Load the selected MAC address low register */
( *( __IO uint32_t * ) ( ( uint32_t ) ( ETH_MAC_ADDR_LBASE + ulIndex ) ) ) = ulTempReg;
}
#endif /* if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_MDNS != 0 ) */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static BaseType_t xSTM32F_NetworkInterfaceOutput( NetworkInterface_t * pxInterface, static BaseType_t xSTM32F_NetworkInterfaceOutput( NetworkInterface_t * pxInterface,