summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/faraday/ftmac100.c
diff options
context:
space:
mode:
authorSergei Antonov <saproj@gmail.com>2023-01-16 21:27:16 +0300
committerDavid S. Miller <davem@davemloft.net>2023-01-18 13:03:40 +0000
commit75943bc9701bdd438aa0513c4fcb51923e020289 (patch)
treefc67bd22a01542ea4e88475791cc283021abd662 /drivers/net/ethernet/faraday/ftmac100.c
parent9259f6b573cf17c00f50c4b626983a5347b1abe9 (diff)
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 Signed-off-by: Sergei Antonov <saproj@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/faraday/ftmac100.c')
-rw-r--r--drivers/net/ethernet/faraday/ftmac100.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index 6c8c78018ce6..139fe66f8bcd 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -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;
}