arch/mips/pic32mz: support promiscuous mode in the Ethernet driver.

With CONFIG_NET_PROMISCUOUS, also enable the multicast and "not me"
unicast receive filters (ETHRXFC MCEN and NOTMEEN), so that the MAC
accepts every frame on the link, as the option's help text describes.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
This commit is contained in:
Daniel P. Carvalho 2026-10-08 10:12:19 -03:00 • committed by Xiang Xiao
parent a4b6b8b8bf
commit c341f6855b

View file

@ -2356,11 +2356,17 @@ static int pic32mz_ifup(struct net_driver_s *dev)
* multicast addresses (if so configured). NOTE: There is a selection
* CONFIG_NET_BROADCAST, but this enables receipt of UDP broadcast packets
* inside of the stack.
*
* In promiscuous mode, also accept multicast frames and unicast frames
* sent to other stations (NOTMEEN).
*/
regval = ETH_RXFC_BCEN | ETH_RXFC_UCEN | ETH_RXFC_PMMODE_DISABLED;
#ifdef CONFIG_PIC32MZ_MULTICAST
#if defined(CONFIG_PIC32MZ_MULTICAST) || defined(CONFIG_NET_PROMISCUOUS)
regval |= ETH_RXFC_MCEN;
#endif
#ifdef CONFIG_NET_PROMISCUOUS
regval |= ETH_RXFC_NOTMEEN;
#endif
pic32mz_putreg(regval, PIC32MZ_ETH_RXFC);