aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorPrabhanjan Sarnaik <sarnaik@marvell.com>2009-06-18 07:35:02 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-19 04:12:52 -0400
commit6877f54e6a3326c99aaf84b7bff6a3019da0b847 (patch)
treef8ff9050739f64627b4a3a352047576dc1a8e76d /drivers/net
parent40c27eeac42600b21d483087ff3885b31e6857c9 (diff)
mv643xx_eth: fix unicast filter programming in promiscuous mode
The Unicast Promiscious Mode (UPM) bit in the mv643xx_eth port configuration register doesn't do exactly what its name would suggest: setting this bit merely enables reception of all unicast frames with a destination address that differs from our local MAC address in bits [47:4]. In particular, it doesn't have any effect on unicast frames with a destination address that matches our MAC address in bits [47:4] -- these will still be tested against the 16-entry unicast address filter table. Therefore, if the interface is set to promiscuous mode, just setting the unicast promiscuous bit isn't enough -- we need to set all filter bits in the unicast filter table to 1 as well. Reported-by: Sachin Sanap <ssanap@marvell.com> Signed-off-by: Prabhanjan Sarnaik <sarnaik@marvell.com> Tested-by: Siddarth Gore <gores@marvell.com> Tested-by: Mahavir Jain <mjain@marvell.com> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Cc: stable@kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/mv643xx_eth.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 745ae8b4a2e8..0f32db3e92ad 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1750,12 +1750,12 @@ static void mv643xx_eth_program_unicast_filter(struct net_device *dev)
1750 1750
1751 uc_addr_set(mp, dev->dev_addr); 1751 uc_addr_set(mp, dev->dev_addr);
1752 1752
1753 port_config = rdlp(mp, PORT_CONFIG); 1753 port_config = rdlp(mp, PORT_CONFIG) & ~UNICAST_PROMISCUOUS_MODE;
1754
1754 nibbles = uc_addr_filter_mask(dev); 1755 nibbles = uc_addr_filter_mask(dev);
1755 if (!nibbles) { 1756 if (!nibbles) {
1756 port_config |= UNICAST_PROMISCUOUS_MODE; 1757 port_config |= UNICAST_PROMISCUOUS_MODE;
1757 wrlp(mp, PORT_CONFIG, port_config); 1758 nibbles = 0xffff;
1758 return;
1759 } 1759 }
1760 1760
1761 for (i = 0; i < 16; i += 4) { 1761 for (i = 0; i < 16; i += 4) {
@@ -1776,7 +1776,6 @@ static void mv643xx_eth_program_unicast_filter(struct net_device *dev)
1776 wrl(mp, off, v); 1776 wrl(mp, off, v);
1777 } 1777 }
1778 1778
1779 port_config &= ~UNICAST_PROMISCUOUS_MODE;
1780 wrlp(mp, PORT_CONFIG, port_config); 1779 wrlp(mp, PORT_CONFIG, port_config);
1781} 1780}
1782 1781