diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index bced5def661..8c9e955b7b6 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -704,7 +704,11 @@ static void stm32_rxdescinit(FAR struct stm32_ethmac_s *priv); #if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) static int stm32_phyintenable(FAR struct stm32_ethmac_s *priv); #endif +#if defined(CONFIG_STM32_AUTONEG) ||\ + defined(CONFIG_NETDEV_PHY_IOCTL) ||\ + defined(CONFIG_ETH0_PHY_DM9161) static int stm32_phyread(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t *value); +#endif static int stm32_phywrite(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t value); #ifdef CONFIG_ETH0_PHY_DM9161 static inline int stm32_dm9161(FAR struct stm32_ethmac_s *priv); @@ -3098,6 +3102,9 @@ static int stm32_phyintenable(struct stm32_ethmac_s *priv) * ****************************************************************************/ +#if defined(CONFIG_STM32_AUTONEG) ||\ + defined(CONFIG_NETDEV_PHY_IOCTL) ||\ + defined(CONFIG_ETH0_PHY_DM9161) static int stm32_phyread(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t *value) { volatile uint32_t timeout; @@ -3134,6 +3141,7 @@ static int stm32_phyread(uint16_t phydevaddr, uint16_t phyregaddr, uint16_t *val return -ETIMEDOUT; } +#endif /**************************************************************************** * Function: stm32_phywrite @@ -3278,7 +3286,10 @@ static inline int stm32_dm9161(FAR struct stm32_ethmac_s *priv) static int stm32_phyinit(FAR struct stm32_ethmac_s *priv) { +#ifdef CONFIG_STM32_AUTOGEN volatile uint32_t timeout; +#endif + uint32_t regval; uint16_t phyval; int ret;