1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-24 20:29:40 +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 )
#endif
#if ( ipconfigUSE_TCP != 0 )
/* Disable IPv6 by default. */
#ifndef ipconfigUSE_DHCPv6
#define ipconfigUSE_DHCPv6 ( 0 )
#endif
#ifndef ipconfigUSE_DHCPv6
#define ipconfigUSE_DHCPv6 ( 0 )
#endif
#if ( ipconfigUSE_TCP != 0 )
/* 'ipconfigUSE_TCP_WIN' enables support for TCP sliding windows. When
* 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 );
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_MDNS != 0 ) || ( ipconfigUSE_IPv6 != 0 )
/*
* For LLMNR, an extra MAC-address must be configured to
* be able to receive the multicast messages.
*/
static void prvMACAddressConfig( ETH_HandleTypeDef * heth,
uint32_t ulIndex,
uint8_t * Addr );
#endif
static void prvMACAddressConfig( ETH_HandleTypeDef * heth,
uint32_t ulIndex,
uint8_t * Addr );
/* FreeRTOS+TCP/multi :
* Each network device has 3 access functions:
@@ -452,9 +450,7 @@ BaseType_t xSTM32F_NetworkInterfaceInitialise( NetworkInterface_t * pxInterface
BaseType_t xResult;
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. */
#endif
BaseType_t xMACEntry = ETH_MAC_ADDRESS1; /* ETH_MAC_ADDRESS0 reserved for the primary MAC-address. */
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. */
ulTempReg = 0x80000000ul | ( ( uint32_t ) Addr[ 5 ] << 8 ) | ( uint32_t ) Addr[ 4 ];
( void ) heth;
/* Load the selected MAC address high register. */
( *( __IO uint32_t * ) ( ( uint32_t ) ( ETH_MAC_ADDR_HBASE + ulIndex ) ) ) = ulTempReg;
/* Calculate the selected MAC address high register. */
ulTempReg = 0x80000000ul | ( ( uint32_t ) Addr[ 5 ] << 8 ) | ( uint32_t ) Addr[ 4 ];
/* 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 high register. */
( *( __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,