aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/s2io.c5
-rw-r--r--drivers/net/sb1250-mac.c6
-rw-r--r--drivers/net/sc92031.c2
-rw-r--r--drivers/net/sfc/efx.c6
-rw-r--r--drivers/net/sis190.c4
-rw-r--r--drivers/net/sis900.c5
-rw-r--r--drivers/net/skfp/skfddi.c10
-rw-r--r--drivers/net/skge.c10
-rw-r--r--drivers/net/sky2.c5
-rw-r--r--drivers/net/smsc9420.c5
-rw-r--r--drivers/net/sonic.c7
-rw-r--r--drivers/net/spider_net.c2
-rw-r--r--drivers/net/starfire.c4
-rw-r--r--drivers/net/stmmac/dwmac100.c4
-rw-r--r--drivers/net/stmmac/dwmac1000_core.c4
-rw-r--r--drivers/net/sun3_82586.c8
-rw-r--r--drivers/net/sunbmac.c5
-rw-r--r--drivers/net/sundance.c3
-rw-r--r--drivers/net/sungem.c10
-rw-r--r--drivers/net/sunhme.c20
-rw-r--r--drivers/net/sunlance.c6
-rw-r--r--drivers/net/sunqe.c9
-rw-r--r--drivers/net/sunvnet.c2
23 files changed, 55 insertions, 87 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 102be16e9b52..43bc66aa8405 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -5092,8 +5092,8 @@ static void s2io_set_multicast(struct net_device *dev)
5092 } 5092 }
5093 5093
5094 /* Create the new Rx filter list and update the same in H/W. */ 5094 /* Create the new Rx filter list and update the same in H/W. */
5095 for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev); 5095 i = 0;
5096 i++, mclist = mclist->next) { 5096 netdev_for_each_mc_addr(mclist, dev) {
5097 memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, 5097 memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,
5098 ETH_ALEN); 5098 ETH_ALEN);
5099 mac_addr = 0; 5099 mac_addr = 0;
@@ -5121,6 +5121,7 @@ static void s2io_set_multicast(struct net_device *dev)
5121 dev->name); 5121 dev->name);
5122 return; 5122 return;
5123 } 5123 }
5124 i++;
5124 } 5125 }
5125 } 5126 }
5126} 5127}
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index 564d4d7f855b..9944e5d662c0 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -2161,13 +2161,13 @@ static void sbmac_setmulti(struct sbmac_softc *sc)
2161 * XXX if the table overflows */ 2161 * XXX if the table overflows */
2162 2162
2163 idx = 1; /* skip station address */ 2163 idx = 1; /* skip station address */
2164 mclist = dev->mc_list; 2164 netdev_for_each_mc_addr(mclist, dev) {
2165 while (mclist && (idx < MAC_ADDR_COUNT)) { 2165 if (idx == MAC_ADDR_COUNT)
2166 break;
2166 reg = sbmac_addr2reg(mclist->dmi_addr); 2167 reg = sbmac_addr2reg(mclist->dmi_addr);
2167 port = sc->sbm_base + R_MAC_ADDR_BASE+(idx * sizeof(uint64_t)); 2168 port = sc->sbm_base + R_MAC_ADDR_BASE+(idx * sizeof(uint64_t));
2168 __raw_writeq(reg, port); 2169 __raw_writeq(reg, port);
2169 idx++; 2170 idx++;
2170 mclist = mclist->next;
2171 } 2171 }
2172 2172
2173 /* 2173 /*
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 00ff8995ad69..d87c4787fffa 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -435,7 +435,7 @@ static void _sc92031_set_mar(struct net_device *dev)
435 else if (dev->flags & IFF_MULTICAST) { 435 else if (dev->flags & IFF_MULTICAST) {
436 struct dev_mc_list *mc_list; 436 struct dev_mc_list *mc_list;
437 437
438 for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) { 438 netdev_for_each_mc_addr(mc_list, dev) {
439 u32 crc; 439 u32 crc;
440 unsigned bit = 0; 440 unsigned bit = 0;
441 441
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index dc58d9fd0f32..88f2fb193abe 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1602,11 +1602,10 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data)
1602static void efx_set_multicast_list(struct net_device *net_dev) 1602static void efx_set_multicast_list(struct net_device *net_dev)
1603{ 1603{
1604 struct efx_nic *efx = netdev_priv(net_dev); 1604 struct efx_nic *efx = netdev_priv(net_dev);
1605 struct dev_mc_list *mc_list = net_dev->mc_list; 1605 struct dev_mc_list *mc_list;
1606 union efx_multicast_hash *mc_hash = &efx->multicast_hash; 1606 union efx_multicast_hash *mc_hash = &efx->multicast_hash;
1607 u32 crc; 1607 u32 crc;
1608 int bit; 1608 int bit;
1609 int i;
1610 1609
1611 efx->promiscuous = !!(net_dev->flags & IFF_PROMISC); 1610 efx->promiscuous = !!(net_dev->flags & IFF_PROMISC);
1612 1611
@@ -1615,11 +1614,10 @@ static void efx_set_multicast_list(struct net_device *net_dev)
1615 memset(mc_hash, 0xff, sizeof(*mc_hash)); 1614 memset(mc_hash, 0xff, sizeof(*mc_hash));
1616 } else { 1615 } else {
1617 memset(mc_hash, 0x00, sizeof(*mc_hash)); 1616 memset(mc_hash, 0x00, sizeof(*mc_hash));
1618 for (i = 0; i < netdev_mc_count(net_dev); i++) { 1617 netdev_for_each_mc_addr(mc_list, net_dev) {
1619 crc = ether_crc_le(ETH_ALEN, mc_list->dmi_addr); 1618 crc = ether_crc_le(ETH_ALEN, mc_list->dmi_addr);
1620 bit = crc & (EFX_MCAST_HASH_ENTRIES - 1); 1619 bit = crc & (EFX_MCAST_HASH_ENTRIES - 1);
1621 set_bit_le(bit, mc_hash->byte); 1620 set_bit_le(bit, mc_hash->byte);
1622 mc_list = mc_list->next;
1623 } 1621 }
1624 1622
1625 /* Broadcast packets go through the multicast hash filter. 1623 /* Broadcast packets go through the multicast hash filter.
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index bf2ffbb913ff..ead1d31308f8 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -849,12 +849,10 @@ static void sis190_set_rx_mode(struct net_device *dev)
849 mc_filter[1] = mc_filter[0] = 0xffffffff; 849 mc_filter[1] = mc_filter[0] = 0xffffffff;
850 } else { 850 } else {
851 struct dev_mc_list *mclist; 851 struct dev_mc_list *mclist;
852 unsigned int i;
853 852
854 rx_mode = AcceptBroadcast | AcceptMyPhys; 853 rx_mode = AcceptBroadcast | AcceptMyPhys;
855 mc_filter[1] = mc_filter[0] = 0; 854 mc_filter[1] = mc_filter[0] = 0;
856 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev); 855 netdev_for_each_mc_addr(mclist, dev) {
857 i++, mclist = mclist->next) {
858 int bit_nr = 856 int bit_nr =
859 ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3f; 857 ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3f;
860 mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); 858 mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 32ae87c09f5e..cc0c731c4f09 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -2300,9 +2300,8 @@ static void set_rx_mode(struct net_device *net_dev)
2300 * packets */ 2300 * packets */
2301 struct dev_mc_list *mclist; 2301 struct dev_mc_list *mclist;
2302 rx_mode = RFAAB; 2302 rx_mode = RFAAB;
2303 for (i = 0, mclist = net_dev->mc_list; 2303
2304 mclist && i < netdev_mc_count(net_dev); 2304 netdev_for_each_mc_addr(mclist, net_dev) {
2305 i++, mclist = mclist->next) {
2306 unsigned int bit_nr = 2305 unsigned int bit_nr =
2307 sis900_mcast_bitnr(mclist->dmi_addr, sis_priv->chipset_rev); 2306 sis900_mcast_bitnr(mclist->dmi_addr, sis_priv->chipset_rev);
2308 mc_filter[bit_nr >> 4] |= (1 << (bit_nr & 0xf)); 2307 mc_filter[bit_nr >> 4] |= (1 << (bit_nr & 0xf));
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 346adfae986f..1921a54ea995 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -852,8 +852,7 @@ static void skfp_ctl_set_multicast_list(struct net_device *dev)
852static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) 852static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
853{ 853{
854 struct s_smc *smc = netdev_priv(dev); 854 struct s_smc *smc = netdev_priv(dev);
855 struct dev_mc_list *dmi; /* ptr to multicast addr entry */ 855 struct dev_mc_list *dmi;
856 int i;
857 856
858 /* Enable promiscuous mode, if necessary */ 857 /* Enable promiscuous mode, if necessary */
859 if (dev->flags & IFF_PROMISC) { 858 if (dev->flags & IFF_PROMISC) {
@@ -877,17 +876,14 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
877 /* use exact filtering */ 876 /* use exact filtering */
878 877
879 // point to first multicast addr 878 // point to first multicast addr
880 dmi = dev->mc_list; 879 netdev_for_each_mc_addr(dmi, dev) {
881
882 for (i = 0; i < netdev_mc_count(dev); i++) {
883 mac_add_multicast(smc, 880 mac_add_multicast(smc,
884 (struct fddi_addr *)dmi->dmi_addr, 881 (struct fddi_addr *)dmi->dmi_addr,
885 1); 882 1);
886 883
887 pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n", 884 pr_debug(KERN_INFO "ENABLE MC ADDRESS: %pMF\n",
888 dmi->dmi_addr); 885 dmi->dmi_addr);
889 dmi = dmi->next; 886 }
890 } // for
891 887
892 } else { // more MC addresses than HW supports 888 } else { // more MC addresses than HW supports
893 889
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 720af1c7854b..d0058e5bb6ae 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2917,8 +2917,7 @@ static void genesis_set_multicast(struct net_device *dev)
2917 struct skge_port *skge = netdev_priv(dev); 2917 struct skge_port *skge = netdev_priv(dev);
2918 struct skge_hw *hw = skge->hw; 2918 struct skge_hw *hw = skge->hw;
2919 int port = skge->port; 2919 int port = skge->port;
2920 int i, count = netdev_mc_count(dev); 2920 struct dev_mc_list *list;
2921 struct dev_mc_list *list = dev->mc_list;
2922 u32 mode; 2921 u32 mode;
2923 u8 filter[8]; 2922 u8 filter[8];
2924 2923
@@ -2938,7 +2937,7 @@ static void genesis_set_multicast(struct net_device *dev)
2938 skge->flow_status == FLOW_STAT_SYMMETRIC) 2937 skge->flow_status == FLOW_STAT_SYMMETRIC)
2939 genesis_add_filter(filter, pause_mc_addr); 2938 genesis_add_filter(filter, pause_mc_addr);
2940 2939
2941 for (i = 0; list && i < count; i++, list = list->next) 2940 netdev_for_each_mc_addr(list, dev)
2942 genesis_add_filter(filter, list->dmi_addr); 2941 genesis_add_filter(filter, list->dmi_addr);
2943 } 2942 }
2944 2943
@@ -2957,7 +2956,7 @@ static void yukon_set_multicast(struct net_device *dev)
2957 struct skge_port *skge = netdev_priv(dev); 2956 struct skge_port *skge = netdev_priv(dev);
2958 struct skge_hw *hw = skge->hw; 2957 struct skge_hw *hw = skge->hw;
2959 int port = skge->port; 2958 int port = skge->port;
2960 struct dev_mc_list *list = dev->mc_list; 2959 struct dev_mc_list *list;
2961 int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND || 2960 int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND ||
2962 skge->flow_status == FLOW_STAT_SYMMETRIC); 2961 skge->flow_status == FLOW_STAT_SYMMETRIC);
2963 u16 reg; 2962 u16 reg;
@@ -2975,13 +2974,12 @@ static void yukon_set_multicast(struct net_device *dev)
2975 else if (netdev_mc_empty(dev) && !rx_pause)/* no multicast */ 2974 else if (netdev_mc_empty(dev) && !rx_pause)/* no multicast */
2976 reg &= ~GM_RXCR_MCF_ENA; 2975 reg &= ~GM_RXCR_MCF_ENA;
2977 else { 2976 else {
2978 int i;
2979 reg |= GM_RXCR_MCF_ENA; 2977 reg |= GM_RXCR_MCF_ENA;
2980 2978
2981 if (rx_pause) 2979 if (rx_pause)
2982 yukon_add_filter(filter, pause_mc_addr); 2980 yukon_add_filter(filter, pause_mc_addr);
2983 2981
2984 for (i = 0; list && i < netdev_mc_count(dev); i++, list = list->next) 2982 netdev_for_each_mc_addr(list, dev)
2985 yukon_add_filter(filter, list->dmi_addr); 2983 yukon_add_filter(filter, list->dmi_addr);
2986 } 2984 }
2987 2985
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index d1e98e2170ce..653bdd76ef46 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3621,7 +3621,7 @@ static void sky2_set_multicast(struct net_device *dev)
3621 struct sky2_port *sky2 = netdev_priv(dev); 3621 struct sky2_port *sky2 = netdev_priv(dev);
3622 struct sky2_hw *hw = sky2->hw; 3622 struct sky2_hw *hw = sky2->hw;
3623 unsigned port = sky2->port; 3623 unsigned port = sky2->port;
3624 struct dev_mc_list *list = dev->mc_list; 3624 struct dev_mc_list *list;
3625 u16 reg; 3625 u16 reg;
3626 u8 filter[8]; 3626 u8 filter[8];
3627 int rx_pause; 3627 int rx_pause;
@@ -3640,13 +3640,12 @@ static void sky2_set_multicast(struct net_device *dev)
3640 else if (netdev_mc_empty(dev) && !rx_pause) 3640 else if (netdev_mc_empty(dev) && !rx_pause)
3641 reg &= ~GM_RXCR_MCF_ENA; 3641 reg &= ~GM_RXCR_MCF_ENA;
3642 else { 3642 else {
3643 int i;
3644 reg |= GM_RXCR_MCF_ENA; 3643 reg |= GM_RXCR_MCF_ENA;
3645 3644
3646 if (rx_pause) 3645 if (rx_pause)
3647 sky2_add_filter(filter, pause_mc_addr); 3646 sky2_add_filter(filter, pause_mc_addr);
3648 3647
3649 for (i = 0; list && i < netdev_mc_count(dev); i++, list = list->next) 3648 netdev_for_each_mc_addr(list, dev)
3650 sky2_add_filter(filter, list->dmi_addr); 3649 sky2_add_filter(filter, list->dmi_addr);
3651 } 3650 }
3652 3651
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index 2bd3c986559a..30110a11d737 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -1063,11 +1063,11 @@ static void smsc9420_set_multicast_list(struct net_device *dev)
1063 mac_cr |= MAC_CR_MCPAS_; 1063 mac_cr |= MAC_CR_MCPAS_;
1064 mac_cr &= (~MAC_CR_HPFILT_); 1064 mac_cr &= (~MAC_CR_HPFILT_);
1065 } else if (!netdev_mc_empty(dev)) { 1065 } else if (!netdev_mc_empty(dev)) {
1066 struct dev_mc_list *mc_list = dev->mc_list; 1066 struct dev_mc_list *mc_list;
1067 u32 hash_lo = 0, hash_hi = 0; 1067 u32 hash_lo = 0, hash_hi = 0;
1068 1068
1069 smsc_dbg(HW, "Multicast filter enabled"); 1069 smsc_dbg(HW, "Multicast filter enabled");
1070 while (mc_list) { 1070 netdev_for_each_mc_addr(mc_list, dev) {
1071 u32 bit_num = smsc9420_hash(mc_list->dmi_addr); 1071 u32 bit_num = smsc9420_hash(mc_list->dmi_addr);
1072 u32 mask = 1 << (bit_num & 0x1F); 1072 u32 mask = 1 << (bit_num & 0x1F);
1073 1073
@@ -1076,7 +1076,6 @@ static void smsc9420_set_multicast_list(struct net_device *dev)
1076 else 1076 else
1077 hash_lo |= mask; 1077 hash_lo |= mask;
1078 1078
1079 mc_list = mc_list->next;
1080 } 1079 }
1081 smsc9420_reg_write(pd, HASHH, hash_hi); 1080 smsc9420_reg_write(pd, HASHH, hash_hi);
1082 smsc9420_reg_write(pd, HASHL, hash_lo); 1081 smsc9420_reg_write(pd, HASHL, hash_lo);
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c
index bd8bc66f2e00..287c251075e5 100644
--- a/drivers/net/sonic.c
+++ b/drivers/net/sonic.c
@@ -531,7 +531,7 @@ static void sonic_multicast_list(struct net_device *dev)
531{ 531{
532 struct sonic_local *lp = netdev_priv(dev); 532 struct sonic_local *lp = netdev_priv(dev);
533 unsigned int rcr; 533 unsigned int rcr;
534 struct dev_mc_list *dmi = dev->mc_list; 534 struct dev_mc_list *dmi;
535 unsigned char *addr; 535 unsigned char *addr;
536 int i; 536 int i;
537 537
@@ -549,13 +549,14 @@ static void sonic_multicast_list(struct net_device *dev)
549 printk("sonic_multicast_list: mc_count %d\n", 549 printk("sonic_multicast_list: mc_count %d\n",
550 netdev_mc_count(dev)); 550 netdev_mc_count(dev));
551 sonic_set_cam_enable(dev, 1); /* always enable our own address */ 551 sonic_set_cam_enable(dev, 1); /* always enable our own address */
552 for (i = 1; i <= netdev_mc_count(dev); i++) { 552 i = 1;
553 netdev_for_each_mc_addr(dmi, dev) {
553 addr = dmi->dmi_addr; 554 addr = dmi->dmi_addr;
554 dmi = dmi->next;
555 sonic_cda_put(dev, i, SONIC_CD_CAP0, addr[1] << 8 | addr[0]); 555 sonic_cda_put(dev, i, SONIC_CD_CAP0, addr[1] << 8 | addr[0]);
556 sonic_cda_put(dev, i, SONIC_CD_CAP1, addr[3] << 8 | addr[2]); 556 sonic_cda_put(dev, i, SONIC_CD_CAP1, addr[3] << 8 | addr[2]);
557 sonic_cda_put(dev, i, SONIC_CD_CAP2, addr[5] << 8 | addr[4]); 557 sonic_cda_put(dev, i, SONIC_CD_CAP2, addr[5] << 8 | addr[4]);
558 sonic_set_cam_enable(dev, sonic_get_cam_enable(dev) | (1 << i)); 558 sonic_set_cam_enable(dev, sonic_get_cam_enable(dev) | (1 << i));
559 i++;
559 } 560 }
560 SONIC_WRITE(SONIC_CDC, 16); 561 SONIC_WRITE(SONIC_CDC, 16);
561 /* issue Load CAM command */ 562 /* issue Load CAM command */
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 16191998ac67..2f8a8c32021e 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -646,7 +646,7 @@ spider_net_set_multi(struct net_device *netdev)
646 hash = spider_net_get_multicast_hash(netdev, netdev->broadcast); */ 646 hash = spider_net_get_multicast_hash(netdev, netdev->broadcast); */
647 set_bit(0xfd, bitmask); 647 set_bit(0xfd, bitmask);
648 648
649 for (mc = netdev->mc_list; mc; mc = mc->next) { 649 netdev_for_each_mc_addr(mc, netdev) {
650 hash = spider_net_get_multicast_hash(netdev, mc->dmi_addr); 650 hash = spider_net_get_multicast_hash(netdev, mc->dmi_addr);
651 set_bit(hash, bitmask); 651 set_bit(hash, bitmask);
652 } 652 }
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 58bc7ac086cf..0f405ef51858 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1804,14 +1804,14 @@ static void set_rx_mode(struct net_device *dev)
1804 /* Use the 16 element perfect filter, skip first two entries. */ 1804 /* Use the 16 element perfect filter, skip first two entries. */
1805 void __iomem *filter_addr = ioaddr + PerfFilterTable + 2 * 16; 1805 void __iomem *filter_addr = ioaddr + PerfFilterTable + 2 * 16;
1806 __be16 *eaddrs; 1806 __be16 *eaddrs;
1807 for (i = 2, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev) + 2; 1807 netdev_for_each_mc_addr(mclist, dev) {
1808 i++, mclist = mclist->next) {
1809 eaddrs = (__be16 *)mclist->dmi_addr; 1808 eaddrs = (__be16 *)mclist->dmi_addr;
1810 writew(be16_to_cpu(eaddrs[2]), filter_addr); filter_addr += 4; 1809 writew(be16_to_cpu(eaddrs[2]), filter_addr); filter_addr += 4;
1811 writew(be16_to_cpu(eaddrs[1]), filter_addr); filter_addr += 4; 1810 writew(be16_to_cpu(eaddrs[1]), filter_addr); filter_addr += 4;
1812 writew(be16_to_cpu(eaddrs[0]), filter_addr); filter_addr += 8; 1811 writew(be16_to_cpu(eaddrs[0]), filter_addr); filter_addr += 8;
1813 } 1812 }
1814 eaddrs = (__be16 *)dev->dev_addr; 1813 eaddrs = (__be16 *)dev->dev_addr;
1814 i = netdev_mc_count(dev) + 2;
1815 while (i++ < 16) { 1815 while (i++ < 16) {
1816 writew(be16_to_cpu(eaddrs[0]), filter_addr); filter_addr += 4; 1816 writew(be16_to_cpu(eaddrs[0]), filter_addr); filter_addr += 4;
1817 writew(be16_to_cpu(eaddrs[1]), filter_addr); filter_addr += 4; 1817 writew(be16_to_cpu(eaddrs[1]), filter_addr); filter_addr += 4;
diff --git a/drivers/net/stmmac/dwmac100.c b/drivers/net/stmmac/dwmac100.c
index 576b256ee388..803b0373d843 100644
--- a/drivers/net/stmmac/dwmac100.c
+++ b/drivers/net/stmmac/dwmac100.c
@@ -315,7 +315,6 @@ static void dwmac100_set_filter(struct net_device *dev)
315 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_PR | MAC_CONTROL_IF | 315 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_PR | MAC_CONTROL_IF |
316 MAC_CONTROL_HO | MAC_CONTROL_HP); 316 MAC_CONTROL_HO | MAC_CONTROL_HP);
317 } else { 317 } else {
318 int i;
319 u32 mc_filter[2]; 318 u32 mc_filter[2];
320 struct dev_mc_list *mclist; 319 struct dev_mc_list *mclist;
321 320
@@ -326,8 +325,7 @@ static void dwmac100_set_filter(struct net_device *dev)
326 MAC_CONTROL_IF | MAC_CONTROL_HO); 325 MAC_CONTROL_IF | MAC_CONTROL_HO);
327 326
328 memset(mc_filter, 0, sizeof(mc_filter)); 327 memset(mc_filter, 0, sizeof(mc_filter));
329 for (i = 0, mclist = dev->mc_list; 328 netdev_for_each_mc_addr(mclist, dev) {
330 mclist && i < netdev_mc_count(dev); i++, mclist = mclist->next) {
331 /* The upper 6 bits of the calculated CRC are used to 329 /* The upper 6 bits of the calculated CRC are used to
332 * index the contens of the hash table */ 330 * index the contens of the hash table */
333 int bit_nr = 331 int bit_nr =
diff --git a/drivers/net/stmmac/dwmac1000_core.c b/drivers/net/stmmac/dwmac1000_core.c
index 90dbb4f41ef3..a6538ae4694c 100644
--- a/drivers/net/stmmac/dwmac1000_core.c
+++ b/drivers/net/stmmac/dwmac1000_core.c
@@ -93,7 +93,6 @@ static void dwmac1000_set_filter(struct net_device *dev)
93 writel(0xffffffff, ioaddr + GMAC_HASH_HIGH); 93 writel(0xffffffff, ioaddr + GMAC_HASH_HIGH);
94 writel(0xffffffff, ioaddr + GMAC_HASH_LOW); 94 writel(0xffffffff, ioaddr + GMAC_HASH_LOW);
95 } else if (!netdev_mc_empty(dev)) { 95 } else if (!netdev_mc_empty(dev)) {
96 int i;
97 u32 mc_filter[2]; 96 u32 mc_filter[2];
98 struct dev_mc_list *mclist; 97 struct dev_mc_list *mclist;
99 98
@@ -101,8 +100,7 @@ static void dwmac1000_set_filter(struct net_device *dev)
101 value = GMAC_FRAME_FILTER_HMC; 100 value = GMAC_FRAME_FILTER_HMC;
102 101
103 memset(mc_filter, 0, sizeof(mc_filter)); 102 memset(mc_filter, 0, sizeof(mc_filter));
104 for (i = 0, mclist = dev->mc_list; 103 netdev_for_each_mc_addr(mclist, dev) {
105 mclist && i < netdev_mc_count(dev); i++, mclist = mclist->next) {
106 /* The upper 6 bits of the calculated CRC are used to 104 /* The upper 6 bits of the calculated CRC are used to
107 index the contens of the hash table */ 105 index the contens of the hash table */
108 int bit_nr = 106 int bit_nr =
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c
index efedc252e4be..2f6a760e5f21 100644
--- a/drivers/net/sun3_82586.c
+++ b/drivers/net/sun3_82586.c
@@ -413,7 +413,7 @@ static int init586(struct net_device *dev)
413 volatile struct iasetup_cmd_struct *ias_cmd; 413 volatile struct iasetup_cmd_struct *ias_cmd;
414 volatile struct tdr_cmd_struct *tdr_cmd; 414 volatile struct tdr_cmd_struct *tdr_cmd;
415 volatile struct mcsetup_cmd_struct *mc_cmd; 415 volatile struct mcsetup_cmd_struct *mc_cmd;
416 struct dev_mc_list *dmi=dev->mc_list; 416 struct dev_mc_list *dmi;
417 int num_addrs=netdev_mc_count(dev); 417 int num_addrs=netdev_mc_count(dev);
418 418
419 ptr = (void *) ((char *)p->scb + sizeof(struct scb_struct)); 419 ptr = (void *) ((char *)p->scb + sizeof(struct scb_struct));
@@ -536,8 +536,10 @@ static int init586(struct net_device *dev)
536 mc_cmd->cmd_link = 0xffff; 536 mc_cmd->cmd_link = 0xffff;
537 mc_cmd->mc_cnt = swab16(num_addrs * 6); 537 mc_cmd->mc_cnt = swab16(num_addrs * 6);
538 538
539 for(i=0;i<num_addrs;i++,dmi=dmi->next) 539 i = 0;
540 memcpy((char *) mc_cmd->mc_list[i], dmi->dmi_addr,6); 540 netdev_for_each_mc_addr(dmi, dev)
541 memcpy((char *) mc_cmd->mc_list[i++],
542 dmi->dmi_addr, ETH_ALEN);
541 543
542 p->scb->cbl_offset = make16(mc_cmd); 544 p->scb->cbl_offset = make16(mc_cmd);
543 p->scb->cmd_cuc = CUC_START; 545 p->scb->cmd_cuc = CUC_START;
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index dfea56fa39e3..a0bd361d5eca 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -999,7 +999,7 @@ static void bigmac_set_multicast(struct net_device *dev)
999{ 999{
1000 struct bigmac *bp = netdev_priv(dev); 1000 struct bigmac *bp = netdev_priv(dev);
1001 void __iomem *bregs = bp->bregs; 1001 void __iomem *bregs = bp->bregs;
1002 struct dev_mc_list *dmi = dev->mc_list; 1002 struct dev_mc_list *dmi;
1003 char *addrs; 1003 char *addrs;
1004 int i; 1004 int i;
1005 u32 tmp, crc; 1005 u32 tmp, crc;
@@ -1028,9 +1028,8 @@ static void bigmac_set_multicast(struct net_device *dev)
1028 for (i = 0; i < 4; i++) 1028 for (i = 0; i < 4; i++)
1029 hash_table[i] = 0; 1029 hash_table[i] = 0;
1030 1030
1031 for (i = 0; i < netdev_mc_count(dev); i++) { 1031 netdev_for_each_mc_addr(dmi, dev) {
1032 addrs = dmi->dmi_addr; 1032 addrs = dmi->dmi_addr;
1033 dmi = dmi->next;
1034 1033
1035 if (!(*addrs & 1)) 1034 if (!(*addrs & 1))
1036 continue; 1035 continue;
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 4171259590b2..a855934dfc3b 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1528,8 +1528,7 @@ static void set_rx_mode(struct net_device *dev)
1528 int index; 1528 int index;
1529 int crc; 1529 int crc;
1530 memset (mc_filter, 0, sizeof (mc_filter)); 1530 memset (mc_filter, 0, sizeof (mc_filter));
1531 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev); 1531 netdev_for_each_mc_addr(mclist, dev) {
1532 i++, mclist = mclist->next) {
1533 crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr); 1532 crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr);
1534 for (index=0, bit=0; bit < 6; bit++, crc <<= 1) 1533 for (index=0, bit=0; bit < 6; bit++, crc <<= 1)
1535 if (crc & 0x80000000) index |= 1 << bit; 1534 if (crc & 0x80000000) index |= 1 << bit;
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index d497ec053953..4344017bfaef 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1846,17 +1846,13 @@ static u32 gem_setup_multicast(struct gem *gp)
1846 } else { 1846 } else {
1847 u16 hash_table[16]; 1847 u16 hash_table[16];
1848 u32 crc; 1848 u32 crc;
1849 struct dev_mc_list *dmi = gp->dev->mc_list; 1849 struct dev_mc_list *dmi;
1850 int i; 1850 int i;
1851 1851
1852 for (i = 0; i < 16; i++) 1852 memset(hash_table, 0, sizeof(hash_table));
1853 hash_table[i] = 0; 1853 netdev_for_each_mc_addr(dmi, gp->dev) {
1854
1855 for (i = 0; i < netdev_mc_count(gp->dev); i++) {
1856 char *addrs = dmi->dmi_addr; 1854 char *addrs = dmi->dmi_addr;
1857 1855
1858 dmi = dmi->next;
1859
1860 if (!(*addrs & 1)) 1856 if (!(*addrs & 1))
1861 continue; 1857 continue;
1862 1858
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 905df35ff78a..b17dbb11bd67 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -1523,17 +1523,13 @@ static int happy_meal_init(struct happy_meal *hp)
1523 hme_write32(hp, bregs + BMAC_HTABLE3, 0xffff); 1523 hme_write32(hp, bregs + BMAC_HTABLE3, 0xffff);
1524 } else if ((hp->dev->flags & IFF_PROMISC) == 0) { 1524 } else if ((hp->dev->flags & IFF_PROMISC) == 0) {
1525 u16 hash_table[4]; 1525 u16 hash_table[4];
1526 struct dev_mc_list *dmi = hp->dev->mc_list; 1526 struct dev_mc_list *dmi;
1527 char *addrs; 1527 char *addrs;
1528 int i;
1529 u32 crc; 1528 u32 crc;
1530 1529
1531 for (i = 0; i < 4; i++) 1530 memset(hash_table, 0, sizeof(hash_table));
1532 hash_table[i] = 0; 1531 netdev_for_each_mc_addr(dmi, hp->dev) {
1533
1534 for (i = 0; i < netdev_mc_count(hp->dev); i++) {
1535 addrs = dmi->dmi_addr; 1532 addrs = dmi->dmi_addr;
1536 dmi = dmi->next;
1537 1533
1538 if (!(*addrs & 1)) 1534 if (!(*addrs & 1))
1539 continue; 1535 continue;
@@ -2366,9 +2362,8 @@ static void happy_meal_set_multicast(struct net_device *dev)
2366{ 2362{
2367 struct happy_meal *hp = netdev_priv(dev); 2363 struct happy_meal *hp = netdev_priv(dev);
2368 void __iomem *bregs = hp->bigmacregs; 2364 void __iomem *bregs = hp->bigmacregs;
2369 struct dev_mc_list *dmi = dev->mc_list; 2365 struct dev_mc_list *dmi;
2370 char *addrs; 2366 char *addrs;
2371 int i;
2372 u32 crc; 2367 u32 crc;
2373 2368
2374 spin_lock_irq(&hp->happy_lock); 2369 spin_lock_irq(&hp->happy_lock);
@@ -2384,12 +2379,9 @@ static void happy_meal_set_multicast(struct net_device *dev)
2384 } else { 2379 } else {
2385 u16 hash_table[4]; 2380 u16 hash_table[4];
2386 2381
2387 for (i = 0; i < 4; i++) 2382 memset(hash_table, 0, sizeof(hash_table));
2388 hash_table[i] = 0; 2383 netdev_for_each_mc_addr(dmi, dev) {
2389
2390 for (i = 0; i < netdev_mc_count(dev); i++) {
2391 addrs = dmi->dmi_addr; 2384 addrs = dmi->dmi_addr;
2392 dmi = dmi->next;
2393 2385
2394 if (!(*addrs & 1)) 2386 if (!(*addrs & 1))
2395 continue; 2387 continue;
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index cf9d5bb9e1e9..d7c73f478ef5 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1170,9 +1170,8 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
1170static void lance_load_multicast(struct net_device *dev) 1170static void lance_load_multicast(struct net_device *dev)
1171{ 1171{
1172 struct lance_private *lp = netdev_priv(dev); 1172 struct lance_private *lp = netdev_priv(dev);
1173 struct dev_mc_list *dmi = dev->mc_list; 1173 struct dev_mc_list *dmi;
1174 char *addrs; 1174 char *addrs;
1175 int i;
1176 u32 crc; 1175 u32 crc;
1177 u32 val; 1176 u32 val;
1178 1177
@@ -1196,9 +1195,8 @@ static void lance_load_multicast(struct net_device *dev)
1196 return; 1195 return;
1197 1196
1198 /* Add addresses */ 1197 /* Add addresses */
1199 for (i = 0; i < netdev_mc_count(dev); i++) { 1198 netdev_for_each_mc_addr(dmi, dev) {
1200 addrs = dmi->dmi_addr; 1199 addrs = dmi->dmi_addr;
1201 dmi = dmi->next;
1202 1200
1203 /* multicast address? */ 1201 /* multicast address? */
1204 if (!(*addrs & 1)) 1202 if (!(*addrs & 1))
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 3bc35d86ed66..be637dce944c 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -627,7 +627,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
627static void qe_set_multicast(struct net_device *dev) 627static void qe_set_multicast(struct net_device *dev)
628{ 628{
629 struct sunqe *qep = netdev_priv(dev); 629 struct sunqe *qep = netdev_priv(dev);
630 struct dev_mc_list *dmi = dev->mc_list; 630 struct dev_mc_list *dmi;
631 u8 new_mconfig = qep->mconfig; 631 u8 new_mconfig = qep->mconfig;
632 char *addrs; 632 char *addrs;
633 int i; 633 int i;
@@ -650,12 +650,9 @@ static void qe_set_multicast(struct net_device *dev)
650 u16 hash_table[4]; 650 u16 hash_table[4];
651 u8 *hbytes = (unsigned char *) &hash_table[0]; 651 u8 *hbytes = (unsigned char *) &hash_table[0];
652 652
653 for (i = 0; i < 4; i++) 653 memset(hash_table, 0, sizeof(hash_table));
654 hash_table[i] = 0; 654 netdev_for_each_mc_addr(dmi, dev) {
655
656 for (i = 0; i < netdev_mc_count(dev); i++) {
657 addrs = dmi->dmi_addr; 655 addrs = dmi->dmi_addr;
658 dmi = dmi->next;
659 656
660 if (!(*addrs & 1)) 657 if (!(*addrs & 1))
661 continue; 658 continue;
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c
index d65764ea1d83..6b1b7cea7f6b 100644
--- a/drivers/net/sunvnet.c
+++ b/drivers/net/sunvnet.c
@@ -765,7 +765,7 @@ static void __update_mc_list(struct vnet *vp, struct net_device *dev)
765{ 765{
766 struct dev_addr_list *p; 766 struct dev_addr_list *p;
767 767
768 for (p = dev->mc_list; p; p = p->next) { 768 netdev_for_each_mc_addr(p, dev) {
769 struct vnet_mcast_entry *m; 769 struct vnet_mcast_entry *m;
770 770
771 m = __vnet_mc_find(vp, p->dmi_addr); 771 m = __vnet_mc_find(vp, p->dmi_addr);