up_initialize(): As noted by Roland Takacs in Bitbucket issue 141, there is a compilation error for STM32 if CONFIG_NET and CONFIG_NETDEV_LATEINIT are selected. That was due in part to commit 19e16cb
which extended up_netinitialize() with a !defined(CONFIG_NETDEV_LATEINIT) guard but did not add the guard to concrete implementations. I say "in part" because I don't think that the original intent of commit 19e16cb
was to enable an alternative initialization of MCU internal Ethernet support but rather to enable support of external Ethernet devices that may have dependencies on, for example, SPI. However, this is still a proper fix to avoid the compilation error that can occur with this combination of configuration options.
This commit is contained in:
parent
ffd37a0175
commit
df64811269
@ -2580,7 +2580,7 @@ int imxrt_netinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_IMXRT_ENET_NETHIFS == 1
|
||||
#if CONFIG_IMXRT_ENET_NETHIFS == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)imxrt_netinitialize(0);
|
||||
|
@ -2182,7 +2182,7 @@ int kinetis_netinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_KINETIS_ENETNETHIFS == 1
|
||||
#if CONFIG_KINETIS_ENETNETHIFS == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)kinetis_netinitialize(0);
|
||||
|
@ -2983,7 +2983,7 @@ static void lpc17_ethreset(struct lpc17_driver_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_LPC17_NINTERFACES > 1
|
||||
#if CONFIG_LPC17_NINTERFACES > 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
int lpc17_ethinitialize(int intf)
|
||||
#else
|
||||
static inline int lpc17_ethinitialize(int intf)
|
||||
@ -3079,7 +3079,7 @@ static inline int lpc17_ethinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_LPC17_NINTERFACES == 1
|
||||
#if CONFIG_LPC17_NINTERFACES == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)lpc17_ethinitialize(0);
|
||||
|
@ -3878,9 +3878,11 @@ static inline int lpc43_ethinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_NETDEV_LATEINIT
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)lpc43_ethinitialize();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_NET && CONFIG_LPC43_ETHERNET */
|
||||
|
@ -4022,10 +4022,9 @@ static int stm32_ethconfig(FAR struct stm32_ethmac_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if STM32_NETHERNET == 1
|
||||
#if STM32_NETHERNET == 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
static inline
|
||||
#endif
|
||||
|
||||
int stm32_ethinitialize(int intf)
|
||||
{
|
||||
struct stm32_ethmac_s *priv;
|
||||
@ -4106,7 +4105,7 @@ int stm32_ethinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if STM32_NETHERNET == 1
|
||||
#if STM32_NETHERNET == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)stm32_ethinitialize(0);
|
||||
|
@ -82,7 +82,7 @@ extern "C"
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if STM32_NETHERNET > 1
|
||||
#if STM32_NETHERNET > 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
int stm32_ethinitialize(int intf);
|
||||
#endif
|
||||
|
||||
|
@ -4075,10 +4075,9 @@ static int stm32_ethconfig(struct stm32_ethmac_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if STM32F7_NETHERNET == 1
|
||||
#if STM32F7_NETHERNET == 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
static inline
|
||||
#endif
|
||||
|
||||
int stm32_ethinitialize(int intf)
|
||||
{
|
||||
struct stm32_ethmac_s *priv;
|
||||
@ -4154,7 +4153,7 @@ int stm32_ethinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if STM32F7_NETHERNET == 1
|
||||
#if STM32F7_NETHERNET == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)stm32_ethinitialize(0);
|
||||
|
@ -79,7 +79,7 @@ extern "C"
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if STM32F7_NETHERNET > 1
|
||||
#if STM32F7_NETHERNET > 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
int stm32_ethinitialize(int intf);
|
||||
#endif
|
||||
|
||||
|
@ -1656,7 +1656,7 @@ static int tiva_rmmac(struct net_driver_s *dev, const uint8_t *mac)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if TIVA_NETHCONTROLLERS > 1
|
||||
#if TIVA_NETHCONTROLLERS > 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
int tiva_ethinitialize(int intf)
|
||||
#else
|
||||
static inline int tiva_ethinitialize(int intf)
|
||||
@ -1748,7 +1748,7 @@ static inline int tiva_ethinitialize(int intf)
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if TIVA_NETHCONTROLLERS == 1
|
||||
#if TIVA_NETHCONTROLLERS == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)tiva_ethinitialize(0);
|
||||
|
@ -94,7 +94,7 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if TIVA_NETHCONTROLLERS > 1
|
||||
#if TIVA_NETHCONTROLLERS > 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
int tiva_ethinitialize(int intf);
|
||||
#endif
|
||||
|
||||
|
@ -4020,10 +4020,9 @@ static int tive_emac_configure(FAR struct tiva_ethmac_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if TIVA_NETHCONTROLLERS == 1
|
||||
#if TIVA_NETHCONTROLLERS == 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
static inline
|
||||
#endif
|
||||
|
||||
int tiva_ethinitialize(int intf)
|
||||
{
|
||||
struct tiva_ethmac_s *priv;
|
||||
@ -4161,7 +4160,7 @@ int tiva_ethinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if TIVA_NETHCONTROLLERS == 1
|
||||
#if TIVA_NETHCONTROLLERS == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)tiva_ethinitialize(0);
|
||||
|
@ -3320,7 +3320,7 @@ static void pic32mx_ethreset(struct pic32mx_driver_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_PIC32MX_NINTERFACES > 1
|
||||
#if CONFIG_PIC32MX_NINTERFACES > 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
int pic32mx_ethinitialize(int intf)
|
||||
#else
|
||||
static inline int pic32mx_ethinitialize(int intf)
|
||||
@ -3394,7 +3394,7 @@ static inline int pic32mx_ethinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_PIC32MX_NINTERFACES == 1
|
||||
#if CONFIG_PIC32MX_NINTERFACES == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)pic32mx_ethinitialize(0);
|
||||
|
@ -3356,7 +3356,7 @@ static void pic32mz_ethreset(struct pic32mz_driver_s *priv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_PIC32MZ_NINTERFACES > 1
|
||||
#if CONFIG_PIC32MZ_NINTERFACES > 1 || defined(CONFIG_NETDEV_LATEINIT)
|
||||
int pic32mz_ethinitialize(int intf)
|
||||
#else
|
||||
static inline int pic32mz_ethinitialize(int intf)
|
||||
@ -3433,7 +3433,7 @@ static inline int pic32mz_ethinitialize(int intf)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_PIC32MZ_NINTERFACES == 1
|
||||
#if CONFIG_PIC32MZ_NINTERFACES == 1 && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
(void)pic32mz_ethinitialize(0);
|
||||
|
@ -47,6 +47,9 @@
|
||||
* Name: up_netinitialize
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -162,7 +162,7 @@ static int up_read_dreq(FAR const struct vs1053_lower_s *lower)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_netinitialize
|
||||
* Name: up_vs1053initialize
|
||||
****************************************************************************/
|
||||
|
||||
void up_vs1053initialize(FAR struct spi_dev_s* spi)
|
||||
|
@ -77,7 +77,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
}
|
||||
|
@ -47,6 +47,9 @@
|
||||
* Name: up_netinitialize
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT)
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user