Skip to content

Commit 64f2af7

Browse files
committed
drivers: ethernet: eth_stm32_hal: fix API_V2 multicast
After API_V2 auto-negotiation support was added by zephyrproject-rtos#86621 setup_mac_filter() was called before HAL_ETH_Init(), which resulted in received multicast packets being discarded. This removes that call to setup_mac_filter() when API_V2 in enabled and calls it from eth_init_api_v2() instead, after HAL_ETH_Init(). I've verified the problem and tested the fix on a Nucleo-H563ZI with a simple application that just starts up and makes an mDNS query (which depends on working multicast). Signed-off-by: Kevin ORourke <[email protected]>
1 parent b3ea4f8 commit 64f2af7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/ethernet/eth_stm32_hal.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,10 @@ static int eth_initialize(const struct device *dev)
967967
&dma_tx_buffer[0][0], ETH_TXBUFNB);
968968
HAL_ETH_DMARxDescListInit(heth, dma_rx_desc_tab,
969969
&dma_rx_buffer[0][0], ETH_RXBUFNB);
970-
#endif /* !CONFIG_ETH_STM32_HAL_API_V1 */
971970

972971
setup_mac_filter(heth);
973972

973+
#endif /* !CONFIG_ETH_STM32_HAL_API_V1 */
974974

975975
LOG_DBG("MAC %02x:%02x:%02x:%02x:%02x:%02x",
976976
dev_data->mac_addr[0], dev_data->mac_addr[1],
@@ -1062,6 +1062,8 @@ static int eth_init_api_v2(const struct device *dev)
10621062
return -EINVAL;
10631063
}
10641064

1065+
setup_mac_filter(heth);
1066+
10651067
#if defined(CONFIG_PTP_CLOCK_STM32_HAL)
10661068
/* Enable timestamping of RX packets. We enable all packets to be
10671069
* timestamped to cover both IEEE 1588 and gPTP.

0 commit comments

Comments
 (0)