Skip to contentSkip to conversation

net: ftmac100: handle netdev flags IFF_PROMISC and IFF_ALLMULTI

PATCH Applied Sergei Antonov 2 participants 2 messages Jan 16, 2023 – Jan 18, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ftmac100: handle netdev flags IFF_PROMISC and IFF_ALLMULTI

When netdev->flags has IFF_PROMISC or IFF_ALLMULTI, set the corresponding bits in the MAC Control Register (MACCR).

This change is based on code from the ftgmac100 driver, see ftgmac100_start_hw() in ftgmac100.c

---
 drivers/net/ethernet/faraday/ftmac100.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/faraday/ftmac100.c +6 -0
index 6c8c78018ce6..139fe66f8bcd 100644
@@ -182,6 +182,12 @@ static int ftmac100_start_hw(struct ftmac100 *priv)
 	if (netdev->mtu > ETH_DATA_LEN)
 		maccr |= FTMAC100_MACCR_RX_FTL;
 
+	/* Add other bits as needed */
+	if (netdev->flags & IFF_PROMISC)
+		maccr |= FTMAC100_MACCR_RCV_ALL;
+	if (netdev->flags & IFF_ALLMULTI)
+		maccr |= FTMAC100_MACCR_RX_MULTIPKT;
+
 	iowrite32(maccr, priv->base + FTMAC100_OFFSET_MACCR);
 	return 0;
 }
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 9 lines · On Mon, 16 Jan 2023 21:27:16 +0300 you wrote:

When netdev->flags has IFF_PROMISC or IFF_ALLMULTI, set the corresponding bits in the MAC Control Register (MACCR).

This change is based on code from the ftgmac100 driver, see ftgmac100_start_hw() in ftgmac100.c

[...]

Here is the summary with links:
- [net-next] net: ftmac100: handle netdev flags IFF_PROMISC and IFF_ALLMULTI

    https://git.kernel.org/netdev/net-next/c/75943bc9701b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html