aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arm/ixp4xx_eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/arm/ixp4xx_eth.c')
-rw-r--r--drivers/net/arm/ixp4xx_eth.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c
index 1a5f78b160f9..6e2ae1d06df1 100644
--- a/drivers/net/arm/ixp4xx_eth.c
+++ b/drivers/net/arm/ixp4xx_eth.c
@@ -735,22 +735,25 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev)
735static void eth_set_mcast_list(struct net_device *dev) 735static void eth_set_mcast_list(struct net_device *dev)
736{ 736{
737 struct port *port = netdev_priv(dev); 737 struct port *port = netdev_priv(dev);
738 struct dev_mc_list *mclist = dev->mc_list; 738 struct dev_mc_list *mclist;
739 u8 diffs[ETH_ALEN], *addr; 739 u8 diffs[ETH_ALEN], *addr;
740 int cnt = netdev_mc_count(dev), i; 740 int i;
741 741
742 if ((dev->flags & IFF_PROMISC) || !mclist || !cnt) { 742 if ((dev->flags & IFF_PROMISC) || netdev_mc_empty(dev)) {
743 __raw_writel(DEFAULT_RX_CNTRL0 & ~RX_CNTRL0_ADDR_FLTR_EN, 743 __raw_writel(DEFAULT_RX_CNTRL0 & ~RX_CNTRL0_ADDR_FLTR_EN,
744 &port->regs->rx_control[0]); 744 &port->regs->rx_control[0]);
745 return; 745 return;
746 } 746 }
747 747
748 memset(diffs, 0, ETH_ALEN); 748 memset(diffs, 0, ETH_ALEN);
749 addr = mclist->dmi_addr; /* first MAC address */
750 749
751 while (--cnt && (mclist = mclist->next)) 750 addr = NULL;
751 netdev_for_each_mc_addr(mclist, dev) {
752 if (!addr)
753 addr = mclist->dmi_addr; /* first MAC address */
752 for (i = 0; i < ETH_ALEN; i++) 754 for (i = 0; i < ETH_ALEN; i++)
753 diffs[i] |= addr[i] ^ mclist->dmi_addr[i]; 755 diffs[i] |= addr[i] ^ mclist->dmi_addr[i];
756 }
754 757
755 for (i = 0; i < ETH_ALEN; i++) { 758 for (i = 0; i < ETH_ALEN; i++) {
756 __raw_writel(addr[i], &port->regs->mcast_addr[i]); 759 __raw_writel(addr[i], &port->regs->mcast_addr[i]);