This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new c341f6855b3 arch/mips/pic32mz: support promiscuous mode in the
Ethernet driver.
c341f6855b3 is described below
commit c341f6855b30670dbc1dc3c623a94280aedc3ce7
Author: Daniel P. Carvalho <[email protected]>
AuthorDate: Thu Oct 8 10:12:19 2026 -0300
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 <[email protected]>
---
arch/mips/src/pic32mz/pic32mz_ethernet.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/mips/src/pic32mz/pic32mz_ethernet.c
b/arch/mips/src/pic32mz/pic32mz_ethernet.c
index 77fd4c741ab..c5988db4d96 100644
--- a/arch/mips/src/pic32mz/pic32mz_ethernet.c
+++ b/arch/mips/src/pic32mz/pic32mz_ethernet.c
@@ -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);