aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-07 23:30:35 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-12 14:38:58 -0500
commit4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 (patch)
tree99f57f6374a58022e1e5ed1cbc12699288c7eae1 /drivers/net
parent8e5574211d96c0552f84c757718475fdb4021be7 (diff)
net: use netdev_mc_count and netdev_mc_empty when appropriate
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c505.c6
-rw-r--r--drivers/net/3c509.c10
-rw-r--r--drivers/net/3c523.c4
-rw-r--r--drivers/net/3c527.c11
-rw-r--r--drivers/net/7990.c2
-rw-r--r--drivers/net/82596.c8
-rw-r--r--drivers/net/a2065.c2
-rw-r--r--drivers/net/acenic.c2
-rw-r--r--drivers/net/amd8111e.c7
-rw-r--r--drivers/net/ariadne.c2
-rw-r--r--drivers/net/arm/at91_ether.c4
-rw-r--r--drivers/net/arm/ether3.c2
-rw-r--r--drivers/net/arm/ixp4xx_eth.c2
-rw-r--r--drivers/net/arm/ks8695net.c4
-rw-r--r--drivers/net/at1700.c6
-rw-r--r--drivers/net/atarilance.c2
-rw-r--r--drivers/net/atp.c7
-rw-r--r--drivers/net/au1000_eth.c4
-rw-r--r--drivers/net/b44.c4
-rw-r--r--drivers/net/bcm63xx_enet.c4
-rw-r--r--drivers/net/benet/be_main.c5
-rw-r--r--drivers/net/bfin_mac.c4
-rw-r--r--drivers/net/bmac.c8
-rw-r--r--drivers/net/bnx2.c2
-rw-r--r--drivers/net/bnx2x_main.c7
-rw-r--r--drivers/net/chelsio/common.h4
-rw-r--r--drivers/net/cpmac.c2
-rw-r--r--drivers/net/cris/eth_v10.c2
-rw-r--r--drivers/net/davinci_emac.c4
-rw-r--r--drivers/net/de620.c2
-rw-r--r--drivers/net/declance.c2
-rw-r--r--drivers/net/defxx.c4
-rw-r--r--drivers/net/depca.c2
-rw-r--r--drivers/net/dl2k.c6
-rw-r--r--drivers/net/dm9000.c2
-rw-r--r--drivers/net/e100.c6
-rw-r--r--drivers/net/eepro.c15
-rw-r--r--drivers/net/eexpress.c6
-rw-r--r--drivers/net/ehea/ehea_main.c6
-rw-r--r--drivers/net/enc28j60.c2
-rw-r--r--drivers/net/enic/enic_main.c4
-rw-r--r--drivers/net/epic100.c6
-rw-r--r--drivers/net/eth16i.c2
-rw-r--r--drivers/net/ewrk3.c2
-rw-r--r--drivers/net/fealnx.c4
-rw-r--r--drivers/net/fec.c2
-rw-r--r--drivers/net/fec_mpc52xx.c2
-rw-r--r--drivers/net/fs_enet/mac-fcc.c2
-rw-r--r--drivers/net/fs_enet/mac-fec.c2
-rw-r--r--drivers/net/fs_enet/mac-scc.c2
-rw-r--r--drivers/net/gianfar.c2
-rw-r--r--drivers/net/hamachi.c6
-rw-r--r--drivers/net/hp100.c7
-rw-r--r--drivers/net/ibm_newemac/core.c6
-rw-r--r--drivers/net/ibmveth.c5
-rw-r--r--drivers/net/igb/igb_main.c8
-rw-r--r--drivers/net/igbvf/netdev.c6
-rw-r--r--drivers/net/ioc3-eth.c5
-rw-r--r--drivers/net/ipg.c4
-rw-r--r--drivers/net/isa-skeleton.c5
-rw-r--r--drivers/net/iseries_veth.c4
-rw-r--r--drivers/net/ixgb/ixgb_main.c6
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c2
-rw-r--r--drivers/net/ixgbevf/ixgbevf_main.c2
-rw-r--r--drivers/net/jme.c2
-rw-r--r--drivers/net/korina.c6
-rw-r--r--drivers/net/ks8851.c4
-rw-r--r--drivers/net/ks8851_mll.c4
-rw-r--r--drivers/net/lance.c2
-rw-r--r--drivers/net/lib82596.c6
-rw-r--r--drivers/net/ll_temac_main.c6
-rw-r--r--drivers/net/lp486e.c12
-rw-r--r--drivers/net/macb.c4
-rw-r--r--drivers/net/mace.c2
-rw-r--r--drivers/net/macmace.c2
-rw-r--r--drivers/net/natsemi.c4
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c10
-rw-r--r--drivers/net/ni52.c2
-rw-r--r--drivers/net/ni65.c2
-rw-r--r--drivers/net/niu.c4
-rw-r--r--drivers/net/ns83820.c2
-rw-r--r--drivers/net/octeon/octeon_mgmt.c6
-rw-r--r--drivers/net/pci-skeleton.c4
-rw-r--r--drivers/net/pcmcia/3c574_cs.c2
-rw-r--r--drivers/net/pcmcia/3c589_cs.c2
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c6
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c14
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c4
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c8
-rw-r--r--drivers/net/pcnet32.c2
-rw-r--r--drivers/net/ps3_gelic_net.c2
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c4
-rw-r--r--drivers/net/qlge/qlge_main.c4
-rw-r--r--drivers/net/r6040.c11
-rw-r--r--drivers/net/r8169.c4
-rw-r--r--drivers/net/s2io.c8
-rw-r--r--drivers/net/sc92031.c2
-rw-r--r--drivers/net/sfc/efx.c2
-rw-r--r--drivers/net/sgiseeq.c2
-rw-r--r--drivers/net/sis190.c4
-rw-r--r--drivers/net/sis900.c4
-rw-r--r--drivers/net/skfp/skfddi.c6
-rw-r--r--drivers/net/skge.c6
-rw-r--r--drivers/net/sky2.c4
-rw-r--r--drivers/net/smc911x.c6
-rw-r--r--drivers/net/smc9194.c4
-rw-r--r--drivers/net/smc91x.c6
-rw-r--r--drivers/net/smsc911x.c4
-rw-r--r--drivers/net/smsc9420.c2
-rw-r--r--drivers/net/sonic.c8
-rw-r--r--drivers/net/starfire.c8
-rw-r--r--drivers/net/stmmac/dwmac100.c6
-rw-r--r--drivers/net/stmmac/dwmac1000_core.c8
-rw-r--r--drivers/net/sun3_82586.c2
-rw-r--r--drivers/net/sun3lance.c2
-rw-r--r--drivers/net/sunbmac.c4
-rw-r--r--drivers/net/sundance.c6
-rw-r--r--drivers/net/sungem.c4
-rw-r--r--drivers/net/sunhme.c8
-rw-r--r--drivers/net/sunlance.c2
-rw-r--r--drivers/net/sunqe.c4
-rw-r--r--drivers/net/tc35815.c6
-rw-r--r--drivers/net/tehuti.c4
-rw-r--r--drivers/net/tg3.c4
-rw-r--r--drivers/net/tlan.c2
-rw-r--r--drivers/net/tokenring/3c359.c2
-rw-r--r--drivers/net/tokenring/ibmtr.c2
-rw-r--r--drivers/net/tokenring/lanstreamer.c2
-rw-r--r--drivers/net/tokenring/olympic.c2
-rw-r--r--drivers/net/tokenring/tms380tr.c2
-rw-r--r--drivers/net/tsi108_eth.c2
-rw-r--r--drivers/net/tulip/de2104x.c8
-rw-r--r--drivers/net/tulip/de4x5.c6
-rw-r--r--drivers/net/tulip/dmfe.c15
-rw-r--r--drivers/net/tulip/tulip_core.c18
-rw-r--r--drivers/net/tulip/uli526x.c12
-rw-r--r--drivers/net/tulip/winbond-840.c7
-rw-r--r--drivers/net/typhoon.c9
-rw-r--r--drivers/net/ucc_geth.c3
-rw-r--r--drivers/net/usb/asix.c12
-rw-r--r--drivers/net/usb/catc.c4
-rw-r--r--drivers/net/usb/int51x1.c2
-rw-r--r--drivers/net/usb/kaweth.c2
-rw-r--r--drivers/net/usb/mcs7830.c6
-rw-r--r--drivers/net/usb/pegasus.c2
-rw-r--r--drivers/net/usb/rtl8150.c2
-rw-r--r--drivers/net/usb/smsc95xx.c4
-rw-r--r--drivers/net/via-rhine.c5
-rw-r--r--drivers/net/via-velocity.c6
-rw-r--r--drivers/net/virtio_net.c13
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c8
-rw-r--r--drivers/net/vxge/vxge-main.c6
-rw-r--r--drivers/net/wireless/airo.c2
-rw-r--r--drivers/net/wireless/orinoco/main.c4
-rw-r--r--drivers/net/wireless/ray_cs.c2
-rw-r--r--drivers/net/wireless/rndis_wlan.c6
-rw-r--r--drivers/net/wireless/zd1201.c7
-rw-r--r--drivers/net/yellowfin.c7
158 files changed, 395 insertions, 360 deletions
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index 9257d7ce0378..dadb46a8833a 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -1229,8 +1229,8 @@ static void elp_set_mc_list(struct net_device *dev)
1229 /* send a "load multicast list" command to the board, max 10 addrs/cmd */ 1229 /* send a "load multicast list" command to the board, max 10 addrs/cmd */
1230 /* if num_addrs==0 the list will be cleared */ 1230 /* if num_addrs==0 the list will be cleared */
1231 adapter->tx_pcb.command = CMD_LOAD_MULTICAST_LIST; 1231 adapter->tx_pcb.command = CMD_LOAD_MULTICAST_LIST;
1232 adapter->tx_pcb.length = 6 * dev->mc_count; 1232 adapter->tx_pcb.length = 6 * netdev_mc_count(dev);
1233 for (i = 0; i < dev->mc_count; i++) { 1233 for (i = 0; i < netdev_mc_count(dev); i++) {
1234 memcpy(adapter->tx_pcb.data.multicast[i], dmi->dmi_addr, 6); 1234 memcpy(adapter->tx_pcb.data.multicast[i], dmi->dmi_addr, 6);
1235 dmi = dmi->next; 1235 dmi = dmi->next;
1236 } 1236 }
@@ -1244,7 +1244,7 @@ static void elp_set_mc_list(struct net_device *dev)
1244 TIMEOUT_MSG(__LINE__); 1244 TIMEOUT_MSG(__LINE__);
1245 } 1245 }
1246 } 1246 }
1247 if (dev->mc_count) 1247 if (!netdev_mc_empty(dev))
1248 adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD | RECV_MULTI; 1248 adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD | RECV_MULTI;
1249 else /* num_addrs == 0 */ 1249 else /* num_addrs == 0 */
1250 adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD; 1250 adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD;
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index 9d85efce5916..902435a76466 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -1111,12 +1111,14 @@ set_multicast_list(struct net_device *dev)
1111 unsigned long flags; 1111 unsigned long flags;
1112 struct el3_private *lp = netdev_priv(dev); 1112 struct el3_private *lp = netdev_priv(dev);
1113 int ioaddr = dev->base_addr; 1113 int ioaddr = dev->base_addr;
1114 int mc_count = netdev_mc_count(dev);
1114 1115
1115 if (el3_debug > 1) { 1116 if (el3_debug > 1) {
1116 static int old; 1117 static int old;
1117 if (old != dev->mc_count) { 1118 if (old != mc_count) {
1118 old = dev->mc_count; 1119 old = mc_count;
1119 pr_debug("%s: Setting Rx mode to %d addresses.\n", dev->name, dev->mc_count); 1120 pr_debug("%s: Setting Rx mode to %d addresses.\n",
1121 dev->name, mc_count);
1120 } 1122 }
1121 } 1123 }
1122 spin_lock_irqsave(&lp->lock, flags); 1124 spin_lock_irqsave(&lp->lock, flags);
@@ -1124,7 +1126,7 @@ set_multicast_list(struct net_device *dev)
1124 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm, 1126 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
1125 ioaddr + EL3_CMD); 1127 ioaddr + EL3_CMD);
1126 } 1128 }
1127 else if (dev->mc_count || (dev->flags&IFF_ALLMULTI)) { 1129 else if (mc_count || (dev->flags&IFF_ALLMULTI)) {
1128 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast, ioaddr + EL3_CMD); 1130 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast, ioaddr + EL3_CMD);
1129 } 1131 }
1130 else 1132 else
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index 27d80ca5e4c0..6948d667fc5e 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -626,7 +626,7 @@ static int init586(struct net_device *dev)
626 volatile struct tdr_cmd_struct *tdr_cmd; 626 volatile struct tdr_cmd_struct *tdr_cmd;
627 volatile struct mcsetup_cmd_struct *mc_cmd; 627 volatile struct mcsetup_cmd_struct *mc_cmd;
628 struct dev_mc_list *dmi = dev->mc_list; 628 struct dev_mc_list *dmi = dev->mc_list;
629 int num_addrs = dev->mc_count; 629 int num_addrs = netdev_mc_count(dev);
630 630
631 ptr = (void *) ((char *) p->scb + sizeof(struct scb_struct)); 631 ptr = (void *) ((char *) p->scb + sizeof(struct scb_struct));
632 632
@@ -771,7 +771,7 @@ static int init586(struct net_device *dev)
771 * Multicast setup 771 * Multicast setup
772 */ 772 */
773 773
774 if (dev->mc_count) { 774 if (num_addrs) {
775 /* I don't understand this: do we really need memory after the init? */ 775 /* I don't understand this: do we really need memory after the init? */
776 int len = ((char *) p->iscp - (char *) ptr - 8) / 6; 776 int len = ((char *) p->iscp - (char *) ptr - 8) / 6;
777 if (len <= 0) { 777 if (len <= 0) {
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index 36c4191e7bca..ce9826980517 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -1526,10 +1526,10 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
1526 1526
1527 if ((dev->flags&IFF_PROMISC) || 1527 if ((dev->flags&IFF_PROMISC) ||
1528 (dev->flags&IFF_ALLMULTI) || 1528 (dev->flags&IFF_ALLMULTI) ||
1529 dev->mc_count > 10) 1529 netdev_mc_count(dev) > 10)
1530 /* Enable promiscuous mode */ 1530 /* Enable promiscuous mode */
1531 filt |= 1; 1531 filt |= 1;
1532 else if(dev->mc_count) 1532 else if (!netdev_mc_empty(dev))
1533 { 1533 {
1534 unsigned char block[62]; 1534 unsigned char block[62];
1535 unsigned char *bp; 1535 unsigned char *bp;
@@ -1542,16 +1542,17 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
1542 if(!lp->mc_list_valid) 1542 if(!lp->mc_list_valid)
1543 { 1543 {
1544 block[1]=0; 1544 block[1]=0;
1545 block[0]=dev->mc_count; 1545 block[0]=netdev_mc_count(dev);
1546 bp=block+2; 1546 bp=block+2;
1547 1547
1548 for(i=0;i<dev->mc_count;i++) 1548 for(i=0;i<netdev_mc_count(dev);i++)
1549 { 1549 {
1550 memcpy(bp, dmc->dmi_addr, 6); 1550 memcpy(bp, dmc->dmi_addr, 6);
1551 bp+=6; 1551 bp+=6;
1552 dmc=dmc->next; 1552 dmc=dmc->next;
1553 } 1553 }
1554 if(mc32_command_nowait(dev, 2, block, 2+6*dev->mc_count)==-1) 1554 if(mc32_command_nowait(dev, 2, block,
1555 2+6*netdev_mc_count(dev))==-1)
1555 { 1556 {
1556 lp->mc_reload_wait = 1; 1557 lp->mc_reload_wait = 1;
1557 return; 1558 return;
diff --git a/drivers/net/7990.c b/drivers/net/7990.c
index b1e5764628c6..079d0be37821 100644
--- a/drivers/net/7990.c
+++ b/drivers/net/7990.c
@@ -611,7 +611,7 @@ static void lance_load_multicast (struct net_device *dev)
611 ib->filter [1] = 0; 611 ib->filter [1] = 0;
612 612
613 /* Add addresses */ 613 /* Add addresses */
614 for (i = 0; i < dev->mc_count; i++){ 614 for (i = 0; i < netdev_mc_count(dev); i++){
615 addrs = dmi->dmi_addr; 615 addrs = dmi->dmi_addr;
616 dmi = dmi->next; 616 dmi = dmi->next;
617 617
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index 1663bc9e45de..638ce3b29854 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -1505,7 +1505,7 @@ static void set_multicast_list(struct net_device *dev)
1505 int config = 0, cnt; 1505 int config = 0, cnt;
1506 1506
1507 DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n", 1507 DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n",
1508 dev->name, dev->mc_count, 1508 dev->name, netdev_mc_count(dev),
1509 dev->flags & IFF_PROMISC ? "ON" : "OFF", 1509 dev->flags & IFF_PROMISC ? "ON" : "OFF",
1510 dev->flags & IFF_ALLMULTI ? "ON" : "OFF")); 1510 dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
1511 1511
@@ -1533,7 +1533,7 @@ static void set_multicast_list(struct net_device *dev)
1533 i596_add_cmd(dev, &lp->cf_cmd.cmd); 1533 i596_add_cmd(dev, &lp->cf_cmd.cmd);
1534 } 1534 }
1535 1535
1536 cnt = dev->mc_count; 1536 cnt = netdev_mc_count(dev);
1537 if (cnt > MAX_MC_CNT) 1537 if (cnt > MAX_MC_CNT)
1538 { 1538 {
1539 cnt = MAX_MC_CNT; 1539 cnt = MAX_MC_CNT;
@@ -1541,7 +1541,7 @@ static void set_multicast_list(struct net_device *dev)
1541 dev->name, cnt); 1541 dev->name, cnt);
1542 } 1542 }
1543 1543
1544 if (dev->mc_count > 0) { 1544 if (!netdev_mc_empty(dev)) {
1545 struct dev_mc_list *dmi; 1545 struct dev_mc_list *dmi;
1546 unsigned char *cp; 1546 unsigned char *cp;
1547 struct mc_cmd *cmd; 1547 struct mc_cmd *cmd;
@@ -1550,7 +1550,7 @@ static void set_multicast_list(struct net_device *dev)
1550 return; 1550 return;
1551 cmd = &lp->mc_cmd; 1551 cmd = &lp->mc_cmd;
1552 cmd->cmd.command = CmdMulticastList; 1552 cmd->cmd.command = CmdMulticastList;
1553 cmd->mc_cnt = dev->mc_count * 6; 1553 cmd->mc_cnt = netdev_mc_count(dev) * 6;
1554 cp = cmd->mc_addrs; 1554 cp = cmd->mc_addrs;
1555 for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) { 1555 for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
1556 memcpy(cp, dmi->dmi_addr, 6); 1556 memcpy(cp, dmi->dmi_addr, 6);
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index b7ec0368d7e8..6a65f660c192 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -619,7 +619,7 @@ static void lance_load_multicast (struct net_device *dev)
619 ib->filter [1] = 0; 619 ib->filter [1] = 0;
620 620
621 /* Add addresses */ 621 /* Add addresses */
622 for (i = 0; i < dev->mc_count; i++){ 622 for (i = 0; i < netdev_mc_count(dev); i++){
623 addrs = dmi->dmi_addr; 623 addrs = dmi->dmi_addr;
624 dmi = dmi->next; 624 dmi = dmi->next;
625 625
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index ec624ab03e88..4ae750ef1e10 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -2845,7 +2845,7 @@ static void ace_set_multicast_list(struct net_device *dev)
2845 * set the entire multicast list at a time and keeping track of 2845 * set the entire multicast list at a time and keeping track of
2846 * it here is going to be messy. 2846 * it here is going to be messy.
2847 */ 2847 */
2848 if ((dev->mc_count) && !(ap->mcast_all)) { 2848 if (!netdev_mc_empty(dev) && !ap->mcast_all) {
2849 cmd.evt = C_SET_MULTICAST_MODE; 2849 cmd.evt = C_SET_MULTICAST_MODE;
2850 cmd.code = C_C_MCAST_ENABLE; 2850 cmd.code = C_C_MCAST_ENABLE;
2851 cmd.idx = 0; 2851 cmd.idx = 0;
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index bb27b27d9672..bdffdfb4c88b 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -1387,7 +1387,8 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
1387 } 1387 }
1388 else 1388 else
1389 writel( PROM, lp->mmio + CMD2); 1389 writel( PROM, lp->mmio + CMD2);
1390 if(dev->flags & IFF_ALLMULTI || dev->mc_count > MAX_FILTER_SIZE){ 1390 if (dev->flags & IFF_ALLMULTI ||
1391 netdev_mc_count(dev) > MAX_FILTER_SIZE) {
1391 /* get all multicast packet */ 1392 /* get all multicast packet */
1392 mc_filter[1] = mc_filter[0] = 0xffffffff; 1393 mc_filter[1] = mc_filter[0] = 0xffffffff;
1393 lp->mc_list = dev->mc_list; 1394 lp->mc_list = dev->mc_list;
@@ -1395,7 +1396,7 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
1395 amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); 1396 amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF);
1396 return; 1397 return;
1397 } 1398 }
1398 if( dev->mc_count == 0 ){ 1399 if (netdev_mc_empty(dev)) {
1399 /* get only own packets */ 1400 /* get only own packets */
1400 mc_filter[1] = mc_filter[0] = 0; 1401 mc_filter[1] = mc_filter[0] = 0;
1401 lp->mc_list = NULL; 1402 lp->mc_list = NULL;
@@ -1409,7 +1410,7 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
1409 lp->options |= OPTION_MULTICAST_ENABLE; 1410 lp->options |= OPTION_MULTICAST_ENABLE;
1410 lp->mc_list = dev->mc_list; 1411 lp->mc_list = dev->mc_list;
1411 mc_filter[1] = mc_filter[0] = 0; 1412 mc_filter[1] = mc_filter[0] = 0;
1412 for (i = 0, mc_ptr = dev->mc_list; mc_ptr && i < dev->mc_count; 1413 for (i = 0, mc_ptr = dev->mc_list; mc_ptr && i < netdev_mc_count(dev);
1413 i++, mc_ptr = mc_ptr->next) { 1414 i++, mc_ptr = mc_ptr->next) {
1414 bit_num = (ether_crc_le(ETH_ALEN, mc_ptr->dmi_addr) >> 26) & 0x3f; 1415 bit_num = (ether_crc_le(ETH_ALEN, mc_ptr->dmi_addr) >> 26) & 0x3f;
1415 mc_filter[bit_num >> 5] |= 1 << (bit_num & 31); 1416 mc_filter[bit_num >> 5] |= 1 << (bit_num & 31);
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c
index e2c202493fa7..08d8be47dae0 100644
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -819,7 +819,7 @@ static void set_multicast_list(struct net_device *dev)
819 lance->RDP = PROM; /* Set promiscuous mode */ 819 lance->RDP = PROM; /* Set promiscuous mode */
820 } else { 820 } else {
821 short multicast_table[4]; 821 short multicast_table[4];
822 int num_addrs = dev->mc_count; 822 int num_addrs = netdev_mc_count(dev);
823 int i; 823 int i;
824 /* We don't use the multicast table, but rely on upper-layer filtering. */ 824 /* We don't use the multicast table, but rely on upper-layer filtering. */
825 memset(multicast_table, (num_addrs == 0) ? 0 : -1, 825 memset(multicast_table, (num_addrs == 0) ? 0 : -1,
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index c8bc60a7040c..17d85d98987d 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -563,7 +563,7 @@ static void at91ether_sethashtable(struct net_device *dev)
563 mc_filter[0] = mc_filter[1] = 0; 563 mc_filter[0] = mc_filter[1] = 0;
564 564
565 curr = dev->mc_list; 565 curr = dev->mc_list;
566 for (i = 0; i < dev->mc_count; i++, curr = curr->next) { 566 for (i = 0; i < netdev_mc_count(dev); i++, curr = curr->next) {
567 if (!curr) break; /* unexpected end of list */ 567 if (!curr) break; /* unexpected end of list */
568 568
569 bitnr = hash_get_index(curr->dmi_addr); 569 bitnr = hash_get_index(curr->dmi_addr);
@@ -592,7 +592,7 @@ static void at91ether_set_multicast_list(struct net_device *dev)
592 at91_emac_write(AT91_EMAC_HSH, -1); 592 at91_emac_write(AT91_EMAC_HSH, -1);
593 at91_emac_write(AT91_EMAC_HSL, -1); 593 at91_emac_write(AT91_EMAC_HSL, -1);
594 cfg |= AT91_EMAC_MTI; 594 cfg |= AT91_EMAC_MTI;
595 } else if (dev->mc_count > 0) { /* Enable specific multicasts */ 595 } else if (!netdev_mc_empty(dev)) { /* Enable specific multicasts */
596 at91ether_sethashtable(dev); 596 at91ether_sethashtable(dev);
597 cfg |= AT91_EMAC_MTI; 597 cfg |= AT91_EMAC_MTI;
598 } else if (dev->flags & (~IFF_ALLMULTI)) { /* Disable all multicast mode */ 598 } else if (dev->flags & (~IFF_ALLMULTI)) { /* Disable all multicast mode */
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c
index 1f7a69c929a6..d9de9bce2395 100644
--- a/drivers/net/arm/ether3.c
+++ b/drivers/net/arm/ether3.c
@@ -463,7 +463,7 @@ static void ether3_setmulticastlist(struct net_device *dev)
463 if (dev->flags & IFF_PROMISC) { 463 if (dev->flags & IFF_PROMISC) {
464 /* promiscuous mode */ 464 /* promiscuous mode */
465 priv(dev)->regs.config1 |= CFG1_RECVPROMISC; 465 priv(dev)->regs.config1 |= CFG1_RECVPROMISC;
466 } else if (dev->flags & IFF_ALLMULTI || dev->mc_count) { 466 } else if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev)) {
467 priv(dev)->regs.config1 |= CFG1_RECVSPECBRMULTI; 467 priv(dev)->regs.config1 |= CFG1_RECVSPECBRMULTI;
468 } else 468 } else
469 priv(dev)->regs.config1 |= CFG1_RECVSPECBROAD; 469 priv(dev)->regs.config1 |= CFG1_RECVSPECBROAD;
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c
index c3dfbdd2cdcf..1a5f78b160f9 100644
--- a/drivers/net/arm/ixp4xx_eth.c
+++ b/drivers/net/arm/ixp4xx_eth.c
@@ -737,7 +737,7 @@ static void eth_set_mcast_list(struct net_device *dev)
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 = dev->mc_list;
739 u8 diffs[ETH_ALEN], *addr; 739 u8 diffs[ETH_ALEN], *addr;
740 int cnt = dev->mc_count, i; 740 int cnt = netdev_mc_count(dev), i;
741 741
742 if ((dev->flags & IFF_PROMISC) || !mclist || !cnt) { 742 if ((dev->flags & IFF_PROMISC) || !mclist || !cnt) {
743 __raw_writel(DEFAULT_RX_CNTRL0 & ~RX_CNTRL0_ADDR_FLTR_EN, 743 __raw_writel(DEFAULT_RX_CNTRL0 & ~RX_CNTRL0_ADDR_FLTR_EN,
diff --git a/drivers/net/arm/ks8695net.c b/drivers/net/arm/ks8695net.c
index be256b34cea8..1dc181a9fbc3 100644
--- a/drivers/net/arm/ks8695net.c
+++ b/drivers/net/arm/ks8695net.c
@@ -1207,7 +1207,7 @@ ks8695_set_multicast(struct net_device *ndev)
1207 if (ndev->flags & IFF_ALLMULTI) { 1207 if (ndev->flags & IFF_ALLMULTI) {
1208 /* enable all multicast mode */ 1208 /* enable all multicast mode */
1209 ctrl |= DRXC_RM; 1209 ctrl |= DRXC_RM;
1210 } else if (ndev->mc_count > KS8695_NR_ADDRESSES) { 1210 } else if (netdev_mc_count(ndev) > KS8695_NR_ADDRESSES) {
1211 /* more specific multicast addresses than can be 1211 /* more specific multicast addresses than can be
1212 * handled in hardware 1212 * handled in hardware
1213 */ 1213 */
@@ -1216,7 +1216,7 @@ ks8695_set_multicast(struct net_device *ndev)
1216 /* enable specific multicasts */ 1216 /* enable specific multicasts */
1217 ctrl &= ~DRXC_RM; 1217 ctrl &= ~DRXC_RM;
1218 ks8695_init_partial_multicast(ksp, ndev->mc_list, 1218 ks8695_init_partial_multicast(ksp, ndev->mc_list,
1219 ndev->mc_count); 1219 netdev_mc_count(ndev));
1220 } 1220 }
1221 1221
1222 ks8695_writereg(ksp, KS8695_DRXC, ctrl); 1222 ks8695_writereg(ksp, KS8695_DRXC, ctrl);
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index b14f4799d5d1..fe60cd02c86c 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -839,12 +839,12 @@ set_rx_mode(struct net_device *dev)
839 if (dev->flags & IFF_PROMISC) { 839 if (dev->flags & IFF_PROMISC) {
840 memset(mc_filter, 0xff, sizeof(mc_filter)); 840 memset(mc_filter, 0xff, sizeof(mc_filter));
841 outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ 841 outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
842 } else if (dev->mc_count > MC_FILTERBREAK || 842 } else if (netdev_mc_count(dev) > MC_FILTERBREAK ||
843 (dev->flags & IFF_ALLMULTI)) { 843 (dev->flags & IFF_ALLMULTI)) {
844 /* Too many to filter perfectly -- accept all multicasts. */ 844 /* Too many to filter perfectly -- accept all multicasts. */
845 memset(mc_filter, 0xff, sizeof(mc_filter)); 845 memset(mc_filter, 0xff, sizeof(mc_filter));
846 outb(2, ioaddr + RX_MODE); /* Use normal mode. */ 846 outb(2, ioaddr + RX_MODE); /* Use normal mode. */
847 } else if (dev->mc_count == 0) { 847 } else if (netdev_mc_empty(dev)) {
848 memset(mc_filter, 0x00, sizeof(mc_filter)); 848 memset(mc_filter, 0x00, sizeof(mc_filter));
849 outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */ 849 outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */
850 } else { 850 } else {
@@ -852,7 +852,7 @@ set_rx_mode(struct net_device *dev)
852 int i; 852 int i;
853 853
854 memset(mc_filter, 0, sizeof(mc_filter)); 854 memset(mc_filter, 0, sizeof(mc_filter));
855 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 855 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
856 i++, mclist = mclist->next) { 856 i++, mclist = mclist->next) {
857 unsigned int bit = 857 unsigned int bit =
858 ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26; 858 ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26;
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index cc9ed8643910..280cfff48b49 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -1097,7 +1097,7 @@ static void set_multicast_list( struct net_device *dev )
1097 REGA( CSR15 ) = 0x8000; /* Set promiscuous mode */ 1097 REGA( CSR15 ) = 0x8000; /* Set promiscuous mode */
1098 } else { 1098 } else {
1099 short multicast_table[4]; 1099 short multicast_table[4];
1100 int num_addrs = dev->mc_count; 1100 int num_addrs = netdev_mc_count(dev);
1101 int i; 1101 int i;
1102 /* We don't use the multicast table, but rely on upper-layer 1102 /* We don't use the multicast table, but rely on upper-layer
1103 * filtering. */ 1103 * filtering. */
diff --git a/drivers/net/atp.c b/drivers/net/atp.c
index 2f8261c9614a..a841feb5df20 100644
--- a/drivers/net/atp.c
+++ b/drivers/net/atp.c
@@ -861,7 +861,7 @@ static void set_rx_mode_8002(struct net_device *dev)
861 struct net_local *lp = netdev_priv(dev); 861 struct net_local *lp = netdev_priv(dev);
862 long ioaddr = dev->base_addr; 862 long ioaddr = dev->base_addr;
863 863
864 if (dev->mc_count > 0 || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC))) 864 if (!netdev_mc_empty(dev) || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC)))
865 lp->addr_mode = CMR2h_PROMISC; 865 lp->addr_mode = CMR2h_PROMISC;
866 else 866 else
867 lp->addr_mode = CMR2h_Normal; 867 lp->addr_mode = CMR2h_Normal;
@@ -877,7 +877,8 @@ static void set_rx_mode_8012(struct net_device *dev)
877 877
878 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 878 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
879 new_mode = CMR2h_PROMISC; 879 new_mode = CMR2h_PROMISC;
880 } else if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) { 880 } else if ((netdev_mc_count(dev) > 1000) ||
881 (dev->flags & IFF_ALLMULTI)) {
881 /* Too many to filter perfectly -- accept all multicasts. */ 882 /* Too many to filter perfectly -- accept all multicasts. */
882 memset(mc_filter, 0xff, sizeof(mc_filter)); 883 memset(mc_filter, 0xff, sizeof(mc_filter));
883 new_mode = CMR2h_Normal; 884 new_mode = CMR2h_Normal;
@@ -885,7 +886,7 @@ static void set_rx_mode_8012(struct net_device *dev)
885 struct dev_mc_list *mclist; 886 struct dev_mc_list *mclist;
886 887
887 memset(mc_filter, 0, sizeof(mc_filter)); 888 memset(mc_filter, 0, sizeof(mc_filter));
888 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 889 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
889 i++, mclist = mclist->next) 890 i++, mclist = mclist->next)
890 { 891 {
891 int filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; 892 int filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f;
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 6bac04603a88..9337d023919c 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -1013,7 +1013,7 @@ static void au1000_multicast_list(struct net_device *dev)
1013 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1013 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1014 aup->mac->control |= MAC_PROMISCUOUS; 1014 aup->mac->control |= MAC_PROMISCUOUS;
1015 } else if ((dev->flags & IFF_ALLMULTI) || 1015 } else if ((dev->flags & IFF_ALLMULTI) ||
1016 dev->mc_count > MULTICAST_FILTER_LIMIT) { 1016 netdev_mc_count(dev) > MULTICAST_FILTER_LIMIT) {
1017 aup->mac->control |= MAC_PASS_ALL_MULTI; 1017 aup->mac->control |= MAC_PASS_ALL_MULTI;
1018 aup->mac->control &= ~MAC_PROMISCUOUS; 1018 aup->mac->control &= ~MAC_PROMISCUOUS;
1019 printk(KERN_INFO "%s: Pass all multicast\n", dev->name); 1019 printk(KERN_INFO "%s: Pass all multicast\n", dev->name);
@@ -1023,7 +1023,7 @@ static void au1000_multicast_list(struct net_device *dev)
1023 u32 mc_filter[2]; /* Multicast hash filter */ 1023 u32 mc_filter[2]; /* Multicast hash filter */
1024 1024
1025 mc_filter[1] = mc_filter[0] = 0; 1025 mc_filter[1] = mc_filter[0] = 0;
1026 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1026 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1027 i++, mclist = mclist->next) { 1027 i++, mclist = mclist->next) {
1028 set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26, 1028 set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26,
1029 (long *)mc_filter); 1029 (long *)mc_filter);
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 44b66be38134..9091c6574b1c 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -1691,7 +1691,7 @@ static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
1691 struct dev_mc_list *mclist; 1691 struct dev_mc_list *mclist;
1692 int i, num_ents; 1692 int i, num_ents;
1693 1693
1694 num_ents = min_t(int, dev->mc_count, B44_MCAST_TABLE_SIZE); 1694 num_ents = min_t(int, netdev_mc_count(dev), B44_MCAST_TABLE_SIZE);
1695 mclist = dev->mc_list; 1695 mclist = dev->mc_list;
1696 for (i = 0; mclist && i < num_ents; i++, mclist = mclist->next) { 1696 for (i = 0; mclist && i < num_ents; i++, mclist = mclist->next) {
1697 __b44_cam_write(bp, mclist->dmi_addr, i + 1); 1697 __b44_cam_write(bp, mclist->dmi_addr, i + 1);
@@ -1716,7 +1716,7 @@ static void __b44_set_rx_mode(struct net_device *dev)
1716 __b44_set_mac_addr(bp); 1716 __b44_set_mac_addr(bp);
1717 1717
1718 if ((dev->flags & IFF_ALLMULTI) || 1718 if ((dev->flags & IFF_ALLMULTI) ||
1719 (dev->mc_count > B44_MCAST_TABLE_SIZE)) 1719 (netdev_mc_count(dev) > B44_MCAST_TABLE_SIZE))
1720 val |= RXCONFIG_ALLMULTI; 1720 val |= RXCONFIG_ALLMULTI;
1721 else 1721 else
1722 i = __b44_load_mcast(bp, dev); 1722 i = __b44_load_mcast(bp, dev);
diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c
index 0bd47d32ec42..0927ffa0d753 100644
--- a/drivers/net/bcm63xx_enet.c
+++ b/drivers/net/bcm63xx_enet.c
@@ -619,7 +619,7 @@ static void bcm_enet_set_multicast_list(struct net_device *dev)
619 619
620 /* only 3 perfect match registers left, first one is used for 620 /* only 3 perfect match registers left, first one is used for
621 * own mac address */ 621 * own mac address */
622 if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > 3) 622 if ((dev->flags & IFF_ALLMULTI) || netdev_mc_count(dev) > 3)
623 val |= ENET_RXCFG_ALLMCAST_MASK; 623 val |= ENET_RXCFG_ALLMCAST_MASK;
624 else 624 else
625 val &= ~ENET_RXCFG_ALLMCAST_MASK; 625 val &= ~ENET_RXCFG_ALLMCAST_MASK;
@@ -632,7 +632,7 @@ static void bcm_enet_set_multicast_list(struct net_device *dev)
632 } 632 }
633 633
634 for (i = 0, mc_list = dev->mc_list; 634 for (i = 0, mc_list = dev->mc_list;
635 (mc_list != NULL) && (i < dev->mc_count) && (i < 3); 635 (mc_list != NULL) && (i < netdev_mc_count(dev)) && (i < 3);
636 i++, mc_list = mc_list->next) { 636 i++, mc_list = mc_list->next) {
637 u8 *dmi_addr; 637 u8 *dmi_addr;
638 u32 tmp; 638 u32 tmp;
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 626b76c0ebc7..0014a4e86446 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -565,14 +565,15 @@ static void be_set_multicast_list(struct net_device *netdev)
565 } 565 }
566 566
567 /* Enable multicast promisc if num configured exceeds what we support */ 567 /* Enable multicast promisc if num configured exceeds what we support */
568 if (netdev->flags & IFF_ALLMULTI || netdev->mc_count > BE_MAX_MC) { 568 if (netdev->flags & IFF_ALLMULTI ||
569 netdev_mc_count(netdev) > BE_MAX_MC) {
569 be_cmd_multicast_set(adapter, adapter->if_handle, NULL, 0, 570 be_cmd_multicast_set(adapter, adapter->if_handle, NULL, 0,
570 &adapter->mc_cmd_mem); 571 &adapter->mc_cmd_mem);
571 goto done; 572 goto done;
572 } 573 }
573 574
574 be_cmd_multicast_set(adapter, adapter->if_handle, netdev->mc_list, 575 be_cmd_multicast_set(adapter, adapter->if_handle, netdev->mc_list,
575 netdev->mc_count, &adapter->mc_cmd_mem); 576 netdev_mc_count(netdev), &adapter->mc_cmd_mem);
576done: 577done:
577 return; 578 return;
578} 579}
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 0b23bc4f56c6..ef7f77113e26 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -819,7 +819,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
819 819
820 emac_hashhi = emac_hashlo = 0; 820 emac_hashhi = emac_hashlo = 0;
821 821
822 for (i = 0; i < dev->mc_count; i++) { 822 for (i = 0; i < netdev_mc_count(dev); i++) {
823 addrs = dmi->dmi_addr; 823 addrs = dmi->dmi_addr;
824 dmi = dmi->next; 824 dmi = dmi->next;
825 825
@@ -862,7 +862,7 @@ static void bfin_mac_set_multicast_list(struct net_device *dev)
862 sysctl = bfin_read_EMAC_OPMODE(); 862 sysctl = bfin_read_EMAC_OPMODE();
863 sysctl |= PAM; 863 sysctl |= PAM;
864 bfin_write_EMAC_OPMODE(sysctl); 864 bfin_write_EMAC_OPMODE(sysctl);
865 } else if (dev->mc_count) { 865 } else if (!netdev_mc_empty(dev)) {
866 /* set up multicast hash table */ 866 /* set up multicast hash table */
867 sysctl = bfin_read_EMAC_OPMODE(); 867 sysctl = bfin_read_EMAC_OPMODE();
868 sysctl |= HM; 868 sysctl |= HM;
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 9b587c344194..189fa69c2094 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -973,7 +973,7 @@ static void bmac_set_multicast(struct net_device *dev)
973{ 973{
974 struct dev_mc_list *dmi; 974 struct dev_mc_list *dmi;
975 struct bmac_data *bp = netdev_priv(dev); 975 struct bmac_data *bp = netdev_priv(dev);
976 int num_addrs = dev->mc_count; 976 int num_addrs = netdev_mc_count(dev);
977 unsigned short rx_cfg; 977 unsigned short rx_cfg;
978 int i; 978 int i;
979 979
@@ -982,7 +982,7 @@ static void bmac_set_multicast(struct net_device *dev)
982 982
983 XXDEBUG(("bmac: enter bmac_set_multicast, n_addrs=%d\n", num_addrs)); 983 XXDEBUG(("bmac: enter bmac_set_multicast, n_addrs=%d\n", num_addrs));
984 984
985 if((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) { 985 if((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
986 for (i=0; i<4; i++) bp->hash_table_mask[i] = 0xffff; 986 for (i=0; i<4; i++) bp->hash_table_mask[i] = 0xffff;
987 bmac_update_hash_table_mask(dev, bp); 987 bmac_update_hash_table_mask(dev, bp);
988 rx_cfg = bmac_rx_on(dev, 1, 0); 988 rx_cfg = bmac_rx_on(dev, 1, 0);
@@ -1021,7 +1021,7 @@ static void bmac_set_multicast(struct net_device *dev)
1021 unsigned short rx_cfg; 1021 unsigned short rx_cfg;
1022 u32 crc; 1022 u32 crc;
1023 1023
1024 if((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) { 1024 if((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
1025 bmwrite(dev, BHASH0, 0xffff); 1025 bmwrite(dev, BHASH0, 0xffff);
1026 bmwrite(dev, BHASH1, 0xffff); 1026 bmwrite(dev, BHASH1, 0xffff);
1027 bmwrite(dev, BHASH2, 0xffff); 1027 bmwrite(dev, BHASH2, 0xffff);
@@ -1039,7 +1039,7 @@ static void bmac_set_multicast(struct net_device *dev)
1039 1039
1040 for(i = 0; i < 4; i++) hash_table[i] = 0; 1040 for(i = 0; i < 4; i++) hash_table[i] = 0;
1041 1041
1042 for(i = 0; i < dev->mc_count; i++) { 1042 for(i = 0; i < netdev_mc_count(dev); i++) {
1043 addrs = dmi->dmi_addr; 1043 addrs = dmi->dmi_addr;
1044 dmi = dmi->next; 1044 dmi = dmi->next;
1045 1045
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 5917b941aca2..c7f5515ddaa4 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3560,7 +3560,7 @@ bnx2_set_rx_mode(struct net_device *dev)
3560 3560
3561 memset(mc_filter, 0, 4 * NUM_MC_HASH_REGISTERS); 3561 memset(mc_filter, 0, 4 * NUM_MC_HASH_REGISTERS);
3562 3562
3563 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 3563 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
3564 i++, mclist = mclist->next) { 3564 i++, mclist = mclist->next) {
3565 3565
3566 crc = ether_crc_le(ETH_ALEN, mclist->dmi_addr); 3566 crc = ether_crc_le(ETH_ALEN, mclist->dmi_addr);
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ffc7381969ae..6d8559052ee6 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -11471,7 +11471,8 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
11471 rx_mode = BNX2X_RX_MODE_PROMISC; 11471 rx_mode = BNX2X_RX_MODE_PROMISC;
11472 11472
11473 else if ((dev->flags & IFF_ALLMULTI) || 11473 else if ((dev->flags & IFF_ALLMULTI) ||
11474 ((dev->mc_count > BNX2X_MAX_MULTICAST) && CHIP_IS_E1(bp))) 11474 ((netdev_mc_count(dev) > BNX2X_MAX_MULTICAST) &&
11475 CHIP_IS_E1(bp)))
11475 rx_mode = BNX2X_RX_MODE_ALLMULTI; 11476 rx_mode = BNX2X_RX_MODE_ALLMULTI;
11476 11477
11477 else { /* some multicasts */ 11478 else { /* some multicasts */
@@ -11482,7 +11483,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
11482 bnx2x_sp(bp, mcast_config); 11483 bnx2x_sp(bp, mcast_config);
11483 11484
11484 for (i = 0, mclist = dev->mc_list; 11485 for (i = 0, mclist = dev->mc_list;
11485 mclist && (i < dev->mc_count); 11486 mclist && (i < netdev_mc_count(dev));
11486 i++, mclist = mclist->next) { 11487 i++, mclist = mclist->next) {
11487 11488
11488 config->config_table[i]. 11489 config->config_table[i].
@@ -11554,7 +11555,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
11554 memset(mc_filter, 0, 4 * MC_HASH_SIZE); 11555 memset(mc_filter, 0, 4 * MC_HASH_SIZE);
11555 11556
11556 for (i = 0, mclist = dev->mc_list; 11557 for (i = 0, mclist = dev->mc_list;
11557 mclist && (i < dev->mc_count); 11558 mclist && (i < netdev_mc_count(dev));
11558 i++, mclist = mclist->next) { 11559 i++, mclist = mclist->next) {
11559 11560
11560 DP(NETIF_MSG_IFUP, "Adding mcast MAC: %pM\n", 11561 DP(NETIF_MSG_IFUP, "Adding mcast MAC: %pM\n",
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index f6462b54f823..bb159d9603bf 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -97,13 +97,13 @@ struct t1_rx_mode {
97 97
98#define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC) 98#define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC)
99#define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI) 99#define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI)
100#define t1_rx_mode_mc_cnt(rm) (rm->dev->mc_count) 100#define t1_rx_mode_mc_cnt(rm) (netdev_mc_count(rm->dev))
101 101
102static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm) 102static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm)
103{ 103{
104 u8 *addr = NULL; 104 u8 *addr = NULL;
105 105
106 if (rm->idx++ < rm->dev->mc_count) { 106 if (rm->idx++ < t1_rx_mode_mc_cnt(rm)) {
107 addr = rm->list->dmi_addr; 107 addr = rm->list->dmi_addr;
108 rm->list = rm->list->next; 108 rm->list = rm->list->next;
109 } 109 }
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index 8d0be26f94e3..c9c537be4ab9 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -340,7 +340,7 @@ static void cpmac_set_multicast_list(struct net_device *dev)
340 * cpmac uses some strange mac address hashing 340 * cpmac uses some strange mac address hashing
341 * (not crc32) 341 * (not crc32)
342 */ 342 */
343 for (i = 0, iter = dev->mc_list; i < dev->mc_count; 343 for (i = 0, iter = dev->mc_list; i < netdev_mc_count(dev);
344 i++, iter = iter->next) { 344 i++, iter = iter->next) {
345 bit = 0; 345 bit = 0;
346 tmp = iter->dmi_addr[0]; 346 tmp = iter->dmi_addr[0];
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index a24be34a3f7a..c9309eadebc1 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -1564,7 +1564,7 @@ static void
1564set_multicast_list(struct net_device *dev) 1564set_multicast_list(struct net_device *dev)
1565{ 1565{
1566 struct net_local *lp = netdev_priv(dev); 1566 struct net_local *lp = netdev_priv(dev);
1567 int num_addr = dev->mc_count; 1567 int num_addr = netdev_mc_count(dev);
1568 unsigned long int lo_bits; 1568 unsigned long int lo_bits;
1569 unsigned long int hi_bits; 1569 unsigned long int hi_bits;
1570 1570
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index faffad409985..d1e03b5984c0 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -956,11 +956,11 @@ static void emac_dev_mcast_set(struct net_device *ndev)
956 } else { 956 } else {
957 mbp_enable = (mbp_enable & ~EMAC_MBP_RXPROMISC); 957 mbp_enable = (mbp_enable & ~EMAC_MBP_RXPROMISC);
958 if ((ndev->flags & IFF_ALLMULTI) || 958 if ((ndev->flags & IFF_ALLMULTI) ||
959 (ndev->mc_count > EMAC_DEF_MAX_MULTICAST_ADDRESSES)) { 959 netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
960 mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); 960 mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
961 emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL); 961 emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
962 } 962 }
963 if (ndev->mc_count > 0) { 963 if (!netdev_mc_empty(ndev)) {
964 struct dev_mc_list *mc_ptr; 964 struct dev_mc_list *mc_ptr;
965 mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); 965 mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
966 emac_add_mcast(priv, EMAC_ALL_MULTI_CLR, NULL); 966 emac_add_mcast(priv, EMAC_ALL_MULTI_CLR, NULL);
diff --git a/drivers/net/de620.c b/drivers/net/de620.c
index 45794f6cb0f6..a0a6830b5e6d 100644
--- a/drivers/net/de620.c
+++ b/drivers/net/de620.c
@@ -464,7 +464,7 @@ static int de620_close(struct net_device *dev)
464 464
465static void de620_set_multicast_list(struct net_device *dev) 465static void de620_set_multicast_list(struct net_device *dev)
466{ 466{
467 if (dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC)) 467 if (!netdev_mc_empty(dev) || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
468 { /* Enable promiscuous mode */ 468 { /* Enable promiscuous mode */
469 de620_set_register(dev, W_TCR, (TCR_DEF & ~RXPBM) | RXALL); 469 de620_set_register(dev, W_TCR, (TCR_DEF & ~RXPBM) | RXALL);
470 } 470 }
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index be9590253aa1..76e0de6a4263 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -960,7 +960,7 @@ static void lance_load_multicast(struct net_device *dev)
960 *lib_ptr(ib, filter[3], lp->type) = 0; 960 *lib_ptr(ib, filter[3], lp->type) = 0;
961 961
962 /* Add addresses */ 962 /* Add addresses */
963 for (i = 0; i < dev->mc_count; i++) { 963 for (i = 0; i < netdev_mc_count(dev); i++) {
964 addrs = dmi->dmi_addr; 964 addrs = dmi->dmi_addr;
965 dmi = dmi->next; 965 dmi = dmi->next;
966 966
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index 98da085445e6..5adb1e03956d 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -2227,7 +2227,7 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev)
2227 * perfect filtering will be used. 2227 * perfect filtering will be used.
2228 */ 2228 */
2229 2229
2230 if (dev->mc_count > (PI_CMD_ADDR_FILTER_K_SIZE - bp->uc_count)) 2230 if (netdev_mc_count(dev) > (PI_CMD_ADDR_FILTER_K_SIZE - bp->uc_count))
2231 { 2231 {
2232 bp->group_prom = PI_FSTATE_K_PASS; /* Enable LLC group prom mode */ 2232 bp->group_prom = PI_FSTATE_K_PASS; /* Enable LLC group prom mode */
2233 bp->mc_count = 0; /* Don't add mc addrs to CAM */ 2233 bp->mc_count = 0; /* Don't add mc addrs to CAM */
@@ -2235,7 +2235,7 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev)
2235 else 2235 else
2236 { 2236 {
2237 bp->group_prom = PI_FSTATE_K_BLOCK; /* Disable LLC group prom mode */ 2237 bp->group_prom = PI_FSTATE_K_BLOCK; /* Disable LLC group prom mode */
2238 bp->mc_count = dev->mc_count; /* Add mc addrs to CAM */ 2238 bp->mc_count = netdev_mc_count(dev); /* Add mc addrs to CAM */
2239 } 2239 }
2240 2240
2241 /* Copy addresses to multicast address table, then update adapter CAM */ 2241 /* Copy addresses to multicast address table, then update adapter CAM */
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 0c1f491d20bf..314bc96689f4 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -1287,7 +1287,7 @@ static void SetMulticastFilter(struct net_device *dev)
1287 lp->init_block.mcast_table[i] = 0; 1287 lp->init_block.mcast_table[i] = 0;
1288 } 1288 }
1289 /* Add multicast addresses */ 1289 /* Add multicast addresses */
1290 for (i = 0; i < dev->mc_count; i++) { /* for each address in the list */ 1290 for (i = 0; i < netdev_mc_count(dev); i++) { /* for each address in the list */
1291 addrs = dmi->dmi_addr; 1291 addrs = dmi->dmi_addr;
1292 dmi = dmi->next; 1292 dmi = dmi->next;
1293 if ((*addrs & 0x01) == 1) { /* multicast address? */ 1293 if ((*addrs & 0x01) == 1) { /* multicast address? */
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 2a8b6a7c0b87..dea40953ed1b 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -1128,17 +1128,17 @@ set_multicast (struct net_device *dev)
1128 /* Receive all frames promiscuously. */ 1128 /* Receive all frames promiscuously. */
1129 rx_mode = ReceiveAllFrames; 1129 rx_mode = ReceiveAllFrames;
1130 } else if ((dev->flags & IFF_ALLMULTI) || 1130 } else if ((dev->flags & IFF_ALLMULTI) ||
1131 (dev->mc_count > multicast_filter_limit)) { 1131 (netdev_mc_count(dev) > multicast_filter_limit)) {
1132 /* Receive broadcast and multicast frames */ 1132 /* Receive broadcast and multicast frames */
1133 rx_mode = ReceiveBroadcast | ReceiveMulticast | ReceiveUnicast; 1133 rx_mode = ReceiveBroadcast | ReceiveMulticast | ReceiveUnicast;
1134 } else if (dev->mc_count > 0) { 1134 } else if (!netdev_mc_empty(dev)) {
1135 int i; 1135 int i;
1136 struct dev_mc_list *mclist; 1136 struct dev_mc_list *mclist;
1137 /* Receive broadcast frames and multicast frames filtering 1137 /* Receive broadcast frames and multicast frames filtering
1138 by Hashtable */ 1138 by Hashtable */
1139 rx_mode = 1139 rx_mode =
1140 ReceiveBroadcast | ReceiveMulticastHash | ReceiveUnicast; 1140 ReceiveBroadcast | ReceiveMulticastHash | ReceiveUnicast;
1141 for (i=0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1141 for (i=0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1142 i++, mclist=mclist->next) 1142 i++, mclist=mclist->next)
1143 { 1143 {
1144 int bit, index = 0; 1144 int bit, index = 0;
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index b37730065688..da0985a7a87a 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -725,7 +725,7 @@ dm9000_hash_table(struct net_device *dev)
725{ 725{
726 board_info_t *db = netdev_priv(dev); 726 board_info_t *db = netdev_priv(dev);
727 struct dev_mc_list *mcptr = dev->mc_list; 727 struct dev_mc_list *mcptr = dev->mc_list;
728 int mc_cnt = dev->mc_count; 728 int mc_cnt = netdev_mc_count(dev);
729 int i, oft; 729 int i, oft;
730 u32 hash_val; 730 u32 hash_val;
731 u16 hash_table[4]; 731 u16 hash_table[4];
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 5c7a155e849a..e8c0e823a06f 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1538,7 +1538,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
1538{ 1538{
1539 struct net_device *netdev = nic->netdev; 1539 struct net_device *netdev = nic->netdev;
1540 struct dev_mc_list *list = netdev->mc_list; 1540 struct dev_mc_list *list = netdev->mc_list;
1541 u16 i, count = min(netdev->mc_count, E100_MAX_MULTICAST_ADDRS); 1541 u16 i, count = min(netdev_mc_count(netdev), E100_MAX_MULTICAST_ADDRS);
1542 1542
1543 cb->command = cpu_to_le16(cb_multi); 1543 cb->command = cpu_to_le16(cb_multi);
1544 cb->u.multi.count = cpu_to_le16(count * ETH_ALEN); 1544 cb->u.multi.count = cpu_to_le16(count * ETH_ALEN);
@@ -1552,7 +1552,7 @@ static void e100_set_multicast_list(struct net_device *netdev)
1552 struct nic *nic = netdev_priv(netdev); 1552 struct nic *nic = netdev_priv(netdev);
1553 1553
1554 DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n", 1554 DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n",
1555 netdev->mc_count, netdev->flags); 1555 netdev_mc_count(netdev), netdev->flags);
1556 1556
1557 if (netdev->flags & IFF_PROMISC) 1557 if (netdev->flags & IFF_PROMISC)
1558 nic->flags |= promiscuous; 1558 nic->flags |= promiscuous;
@@ -1560,7 +1560,7 @@ static void e100_set_multicast_list(struct net_device *netdev)
1560 nic->flags &= ~promiscuous; 1560 nic->flags &= ~promiscuous;
1561 1561
1562 if (netdev->flags & IFF_ALLMULTI || 1562 if (netdev->flags & IFF_ALLMULTI ||
1563 netdev->mc_count > E100_MAX_MULTICAST_ADDRS) 1563 netdev_mc_count(netdev) > E100_MAX_MULTICAST_ADDRS)
1564 nic->flags |= multicast_all; 1564 nic->flags |= multicast_all;
1565 else 1565 else
1566 nic->flags &= ~multicast_all; 1566 nic->flags &= ~multicast_all;
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 94c59498cdb6..488bc13cc7e6 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -1288,8 +1288,9 @@ set_multicast_list(struct net_device *dev)
1288 short ioaddr = dev->base_addr; 1288 short ioaddr = dev->base_addr;
1289 unsigned short mode; 1289 unsigned short mode;
1290 struct dev_mc_list *dmi=dev->mc_list; 1290 struct dev_mc_list *dmi=dev->mc_list;
1291 int mc_count = mc_count;
1291 1292
1292 if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || dev->mc_count > 63) 1293 if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || mc_count > 63)
1293 { 1294 {
1294 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ 1295 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
1295 mode = inb(ioaddr + REG2); 1296 mode = inb(ioaddr + REG2);
@@ -1299,7 +1300,7 @@ set_multicast_list(struct net_device *dev)
1299 eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */ 1300 eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */
1300 } 1301 }
1301 1302
1302 else if (dev->mc_count==0 ) 1303 else if (mc_count == 0)
1303 { 1304 {
1304 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ 1305 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
1305 mode = inb(ioaddr + REG2); 1306 mode = inb(ioaddr + REG2);
@@ -1329,9 +1330,9 @@ set_multicast_list(struct net_device *dev)
1329 outw(MC_SETUP, ioaddr + IO_PORT); 1330 outw(MC_SETUP, ioaddr + IO_PORT);
1330 outw(0, ioaddr + IO_PORT); 1331 outw(0, ioaddr + IO_PORT);
1331 outw(0, ioaddr + IO_PORT); 1332 outw(0, ioaddr + IO_PORT);
1332 outw(6*(dev->mc_count + 1), ioaddr + IO_PORT); 1333 outw(6 * (mc_count + 1), ioaddr + IO_PORT);
1333 1334
1334 for (i = 0; i < dev->mc_count; i++) 1335 for (i = 0; i < mc_count; i++)
1335 { 1336 {
1336 eaddrs=(unsigned short *)dmi->dmi_addr; 1337 eaddrs=(unsigned short *)dmi->dmi_addr;
1337 dmi=dmi->next; 1338 dmi=dmi->next;
@@ -1348,7 +1349,7 @@ set_multicast_list(struct net_device *dev)
1348 outb(MC_SETUP, ioaddr); 1349 outb(MC_SETUP, ioaddr);
1349 1350
1350 /* Update the transmit queue */ 1351 /* Update the transmit queue */
1351 i = lp->tx_end + XMT_HEADER + 6*(dev->mc_count + 1); 1352 i = lp->tx_end + XMT_HEADER + 6 * (mc_count + 1);
1352 1353
1353 if (lp->tx_start != lp->tx_end) 1354 if (lp->tx_start != lp->tx_end)
1354 { 1355 {
@@ -1380,8 +1381,8 @@ set_multicast_list(struct net_device *dev)
1380 break; 1381 break;
1381 } else if ((i & 0x0f) == 0x03) { /* MC-Done */ 1382 } else if ((i & 0x0f) == 0x03) { /* MC-Done */
1382 printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n", 1383 printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n",
1383 dev->name, dev->mc_count, 1384 dev->name, mc_count,
1384 dev->mc_count > 1 ? "es":""); 1385 mc_count > 1 ? "es":"");
1385 break; 1386 break;
1386 } 1387 }
1387 } 1388 }
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c
index 6fbfc8eee632..d804ff18eda8 100644
--- a/drivers/net/eexpress.c
+++ b/drivers/net/eexpress.c
@@ -1578,7 +1578,7 @@ static void eexp_setup_filter(struct net_device *dev)
1578{ 1578{
1579 struct dev_mc_list *dmi; 1579 struct dev_mc_list *dmi;
1580 unsigned short ioaddr = dev->base_addr; 1580 unsigned short ioaddr = dev->base_addr;
1581 int count = dev->mc_count; 1581 int count = netdev_mc_count(dev);
1582 int i; 1582 int i;
1583 if (count > 8) { 1583 if (count > 8) {
1584 printk(KERN_INFO "%s: too many multicast addresses (%d)\n", 1584 printk(KERN_INFO "%s: too many multicast addresses (%d)\n",
@@ -1627,9 +1627,9 @@ eexp_set_multicast(struct net_device *dev)
1627 } 1627 }
1628 if (!(dev->flags & IFF_PROMISC)) { 1628 if (!(dev->flags & IFF_PROMISC)) {
1629 eexp_setup_filter(dev); 1629 eexp_setup_filter(dev);
1630 if (lp->old_mc_count != dev->mc_count) { 1630 if (lp->old_mc_count != netdev_mc_count(dev)) {
1631 kick = 1; 1631 kick = 1;
1632 lp->old_mc_count = dev->mc_count; 1632 lp->old_mc_count = netdev_mc_count(dev);
1633 } 1633 }
1634 } 1634 }
1635 if (kick) { 1635 if (kick) {
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 7b62336e6736..99e4f8360d2f 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1981,7 +1981,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
1981 } 1981 }
1982 ehea_allmulti(dev, 0); 1982 ehea_allmulti(dev, 0);
1983 1983
1984 if (dev->mc_count) { 1984 if (!netdev_mc_empty(dev)) {
1985 ret = ehea_drop_multicast_list(dev); 1985 ret = ehea_drop_multicast_list(dev);
1986 if (ret) { 1986 if (ret) {
1987 /* Dropping the current multicast list failed. 1987 /* Dropping the current multicast list failed.
@@ -1990,14 +1990,14 @@ static void ehea_set_multicast_list(struct net_device *dev)
1990 ehea_allmulti(dev, 1); 1990 ehea_allmulti(dev, 1);
1991 } 1991 }
1992 1992
1993 if (dev->mc_count > port->adapter->max_mc_mac) { 1993 if (netdev_mc_count(dev) > port->adapter->max_mc_mac) {
1994 ehea_info("Mcast registration limit reached (0x%llx). " 1994 ehea_info("Mcast registration limit reached (0x%llx). "
1995 "Use ALLMULTI!", 1995 "Use ALLMULTI!",
1996 port->adapter->max_mc_mac); 1996 port->adapter->max_mc_mac);
1997 goto out; 1997 goto out;
1998 } 1998 }
1999 1999
2000 for (i = 0, k_mcl_entry = dev->mc_list; i < dev->mc_count; i++, 2000 for (i = 0, k_mcl_entry = dev->mc_list; i < netdev_mc_count(dev); i++,
2001 k_mcl_entry = k_mcl_entry->next) 2001 k_mcl_entry = k_mcl_entry->next)
2002 ehea_add_multicast_entry(port, k_mcl_entry->dmi_addr); 2002 ehea_add_multicast_entry(port, k_mcl_entry->dmi_addr);
2003 2003
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
index 66813c91a720..3ee32e58c7ec 100644
--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -1413,7 +1413,7 @@ static void enc28j60_set_multicast_list(struct net_device *dev)
1413 if (netif_msg_link(priv)) 1413 if (netif_msg_link(priv))
1414 dev_info(&dev->dev, "promiscuous mode\n"); 1414 dev_info(&dev->dev, "promiscuous mode\n");
1415 priv->rxfilter = RXFILTER_PROMISC; 1415 priv->rxfilter = RXFILTER_PROMISC;
1416 } else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count) { 1416 } else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev)) {
1417 if (netif_msg_link(priv)) 1417 if (netif_msg_link(priv))
1418 dev_info(&dev->dev, "%smulticast mode\n", 1418 dev_info(&dev->dev, "%smulticast mode\n",
1419 (dev->flags & IFF_ALLMULTI) ? "all-" : ""); 1419 (dev->flags & IFF_ALLMULTI) ? "all-" : "");
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index c81bc4b1816f..94749ebaaea8 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -827,11 +827,11 @@ static void enic_set_multicast_list(struct net_device *netdev)
827 int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0; 827 int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
828 int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0; 828 int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
829 int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0; 829 int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
830 unsigned int mc_count = netdev_mc_count(netdev);
830 int allmulti = (netdev->flags & IFF_ALLMULTI) || 831 int allmulti = (netdev->flags & IFF_ALLMULTI) ||
831 (netdev->mc_count > ENIC_MULTICAST_PERFECT_FILTERS); 832 mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
832 unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0); 833 unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
833 u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN]; 834 u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
834 unsigned int mc_count = netdev->mc_count;
835 unsigned int i, j; 835 unsigned int i, j;
836 836
837 if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS) 837 if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 1f8b11449fad..31a3adb65566 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -1390,20 +1390,20 @@ static void set_rx_mode(struct net_device *dev)
1390 outl(0x002C, ioaddr + RxCtrl); 1390 outl(0x002C, ioaddr + RxCtrl);
1391 /* Unconditionally log net taps. */ 1391 /* Unconditionally log net taps. */
1392 memset(mc_filter, 0xff, sizeof(mc_filter)); 1392 memset(mc_filter, 0xff, sizeof(mc_filter));
1393 } else if ((dev->mc_count > 0) || (dev->flags & IFF_ALLMULTI)) { 1393 } else if ((!netdev_mc_empty(dev)) || (dev->flags & IFF_ALLMULTI)) {
1394 /* There is apparently a chip bug, so the multicast filter 1394 /* There is apparently a chip bug, so the multicast filter
1395 is never enabled. */ 1395 is never enabled. */
1396 /* Too many to filter perfectly -- accept all multicasts. */ 1396 /* Too many to filter perfectly -- accept all multicasts. */
1397 memset(mc_filter, 0xff, sizeof(mc_filter)); 1397 memset(mc_filter, 0xff, sizeof(mc_filter));
1398 outl(0x000C, ioaddr + RxCtrl); 1398 outl(0x000C, ioaddr + RxCtrl);
1399 } else if (dev->mc_count == 0) { 1399 } else if (netdev_mc_empty(dev)) {
1400 outl(0x0004, ioaddr + RxCtrl); 1400 outl(0x0004, ioaddr + RxCtrl);
1401 return; 1401 return;
1402 } else { /* Never executed, for now. */ 1402 } else { /* Never executed, for now. */
1403 struct dev_mc_list *mclist; 1403 struct dev_mc_list *mclist;
1404 1404
1405 memset(mc_filter, 0, sizeof(mc_filter)); 1405 memset(mc_filter, 0, sizeof(mc_filter));
1406 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1406 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1407 i++, mclist = mclist->next) { 1407 i++, mclist = mclist->next) {
1408 unsigned int bit_nr = 1408 unsigned int bit_nr =
1409 ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; 1409 ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f;
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c
index 71bfeec33a0b..d3abeee3f110 100644
--- a/drivers/net/eth16i.c
+++ b/drivers/net/eth16i.c
@@ -1359,7 +1359,7 @@ static void eth16i_multicast(struct net_device *dev)
1359{ 1359{
1360 int ioaddr = dev->base_addr; 1360 int ioaddr = dev->base_addr;
1361 1361
1362 if(dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC)) 1362 if (!netdev_mc_empty(dev) || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
1363 { 1363 {
1364 outb(3, ioaddr + RECEIVE_MODE_REG); 1364 outb(3, ioaddr + RECEIVE_MODE_REG);
1365 } else { 1365 } else {
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c
index dd4ba01fd92d..96817a872f47 100644
--- a/drivers/net/ewrk3.c
+++ b/drivers/net/ewrk3.c
@@ -1213,7 +1213,7 @@ static void SetMulticastFilter(struct net_device *dev)
1213 } 1213 }
1214 1214
1215 /* Update table */ 1215 /* Update table */
1216 for (i = 0; i < dev->mc_count; i++) { /* for each address in the list */ 1216 for (i = 0; i < netdev_mc_count(dev); i++) { /* for each address in the list */
1217 addrs = dmi->dmi_addr; 1217 addrs = dmi->dmi_addr;
1218 dmi = dmi->next; 1218 dmi = dmi->next;
1219 if ((*addrs & 0x01) == 1) { /* multicast address? */ 1219 if ((*addrs & 0x01) == 1) { /* multicast address? */
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index e6a98129d787..f95b5ff0587d 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -1786,7 +1786,7 @@ static void __set_rx_mode(struct net_device *dev)
1786 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1786 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1787 memset(mc_filter, 0xff, sizeof(mc_filter)); 1787 memset(mc_filter, 0xff, sizeof(mc_filter));
1788 rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM; 1788 rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM;
1789 } else if ((dev->mc_count > multicast_filter_limit) || 1789 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1790 (dev->flags & IFF_ALLMULTI)) { 1790 (dev->flags & IFF_ALLMULTI)) {
1791 /* Too many to match, or accept all multicasts. */ 1791 /* Too many to match, or accept all multicasts. */
1792 memset(mc_filter, 0xff, sizeof(mc_filter)); 1792 memset(mc_filter, 0xff, sizeof(mc_filter));
@@ -1796,7 +1796,7 @@ static void __set_rx_mode(struct net_device *dev)
1796 int i; 1796 int i;
1797 1797
1798 memset(mc_filter, 0, sizeof(mc_filter)); 1798 memset(mc_filter, 0, sizeof(mc_filter));
1799 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1799 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1800 i++, mclist = mclist->next) { 1800 i++, mclist = mclist->next) {
1801 unsigned int bit; 1801 unsigned int bit;
1802 bit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F; 1802 bit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F;
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 5d0d33268155..d9d14c83f51c 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1606,7 +1606,7 @@ static void set_multicast_list(struct net_device *dev)
1606 1606
1607 dmi = dev->mc_list; 1607 dmi = dev->mc_list;
1608 1608
1609 for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) { 1609 for (j = 0; j < netdev_mc_count(dev); j++, dmi = dmi->next) {
1610 /* Only support group multicast for now */ 1610 /* Only support group multicast for now */
1611 if (!(dmi->dmi_addr[0] & 1)) 1611 if (!(dmi->dmi_addr[0] & 1))
1612 continue; 1612 continue;
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index 848e8407ea8f..10903b75802f 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -581,7 +581,7 @@ static void mpc52xx_fec_set_multicast_list(struct net_device *dev)
581 u32 gaddr2 = 0x00000000; 581 u32 gaddr2 = 0x00000000;
582 582
583 dmi = dev->mc_list; 583 dmi = dev->mc_list;
584 for (i=0; i<dev->mc_count; i++) { 584 for (i=0; i<netdev_mc_count(dev); i++) {
585 crc = ether_crc_le(6, dmi->dmi_addr) >> 26; 585 crc = ether_crc_le(6, dmi->dmi_addr) >> 26;
586 if (crc >= 32) 586 if (crc >= 32)
587 gaddr1 |= 1 << (crc-32); 587 gaddr1 |= 1 << (crc-32);
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index 22e5a847a588..482f27d5f7d4 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -218,7 +218,7 @@ static void set_multicast_finish(struct net_device *dev)
218 218
219 /* if all multi or too many multicasts; just enable all */ 219 /* if all multi or too many multicasts; just enable all */
220 if ((dev->flags & IFF_ALLMULTI) != 0 || 220 if ((dev->flags & IFF_ALLMULTI) != 0 ||
221 dev->mc_count > FCC_MAX_MULTICAST_ADDRS) { 221 netdev_mc_count(dev) > FCC_MAX_MULTICAST_ADDRS) {
222 222
223 W32(ep, fen_gaddrh, 0xffffffff); 223 W32(ep, fen_gaddrh, 0xffffffff);
224 W32(ep, fen_gaddrl, 0xffffffff); 224 W32(ep, fen_gaddrl, 0xffffffff);
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index ca7bcb8ab3a1..ddf13ef8ac87 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -220,7 +220,7 @@ static void set_multicast_finish(struct net_device *dev)
220 220
221 /* if all multi or too many multicasts; just enable all */ 221 /* if all multi or too many multicasts; just enable all */
222 if ((dev->flags & IFF_ALLMULTI) != 0 || 222 if ((dev->flags & IFF_ALLMULTI) != 0 ||
223 dev->mc_count > FEC_MAX_MULTICAST_ADDRS) { 223 netdev_mc_count(dev) > FEC_MAX_MULTICAST_ADDRS) {
224 fep->fec.hthi = 0xffffffffU; 224 fep->fec.hthi = 0xffffffffU;
225 fep->fec.htlo = 0xffffffffU; 225 fep->fec.htlo = 0xffffffffU;
226 } 226 }
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index 008cdd9cc536..141dbc91e5e7 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -213,7 +213,7 @@ static void set_multicast_finish(struct net_device *dev)
213 213
214 /* if all multi or too many multicasts; just enable all */ 214 /* if all multi or too many multicasts; just enable all */
215 if ((dev->flags & IFF_ALLMULTI) != 0 || 215 if ((dev->flags & IFF_ALLMULTI) != 0 ||
216 dev->mc_count > SCC_MAX_MULTICAST_ADDRS) { 216 netdev_mc_count(dev) > SCC_MAX_MULTICAST_ADDRS) {
217 217
218 W16(ep, sen_gaddr1, 0xffff); 218 W16(ep, sen_gaddr1, 0xffff);
219 W16(ep, sen_gaddr2, 0xffff); 219 W16(ep, sen_gaddr2, 0xffff);
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 8bd3c9f17532..c9be090485dd 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -2863,7 +2863,7 @@ static void gfar_set_multi(struct net_device *dev)
2863 em_num = 0; 2863 em_num = 0;
2864 } 2864 }
2865 2865
2866 if (dev->mc_count == 0) 2866 if (netdev_mc_empty(dev))
2867 return; 2867 return;
2868 2868
2869 /* Parse the list, and set the appropriate bits */ 2869 /* Parse the list, and set the appropriate bits */
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index dd72c5025e6a..c70b147b4feb 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -1854,13 +1854,13 @@ static void set_rx_mode(struct net_device *dev)
1854 1854
1855 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1855 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1856 writew(0x000F, ioaddr + AddrMode); 1856 writew(0x000F, ioaddr + AddrMode);
1857 } else if ((dev->mc_count > 63) || (dev->flags & IFF_ALLMULTI)) { 1857 } else if ((netdev_mc_count(dev) > 63) || (dev->flags & IFF_ALLMULTI)) {
1858 /* Too many to match, or accept all multicasts. */ 1858 /* Too many to match, or accept all multicasts. */
1859 writew(0x000B, ioaddr + AddrMode); 1859 writew(0x000B, ioaddr + AddrMode);
1860 } else if (dev->mc_count > 0) { /* Must use the CAM filter. */ 1860 } else if (!netdev_mc_empty(dev)) { /* Must use the CAM filter. */
1861 struct dev_mc_list *mclist; 1861 struct dev_mc_list *mclist;
1862 int i; 1862 int i;
1863 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1863 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1864 i++, mclist = mclist->next) { 1864 i++, mclist = mclist->next) {
1865 writel(*(u32*)(mclist->dmi_addr), ioaddr + 0x100 + i*8); 1865 writel(*(u32*)(mclist->dmi_addr), ioaddr + 0x100 + i*8);
1866 writel(0x20000 | (*(u16*)&mclist->dmi_addr[4]), 1866 writel(0x20000 | (*(u16*)&mclist->dmi_addr[4]),
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 0c2f2e8b1c47..debac1bc6799 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -2090,7 +2090,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
2090 lp->mac2_mode = HP100_MAC2MODE6; /* promiscuous mode = get all good */ 2090 lp->mac2_mode = HP100_MAC2MODE6; /* promiscuous mode = get all good */
2091 lp->mac1_mode = HP100_MAC1MODE6; /* packets on the net */ 2091 lp->mac1_mode = HP100_MAC1MODE6; /* packets on the net */
2092 memset(&lp->hash_bytes, 0xff, 8); 2092 memset(&lp->hash_bytes, 0xff, 8);
2093 } else if (dev->mc_count || (dev->flags & IFF_ALLMULTI)) { 2093 } else if (!netdev_mc_empty(dev) || (dev->flags & IFF_ALLMULTI)) {
2094 lp->mac2_mode = HP100_MAC2MODE5; /* multicast mode = get packets for */ 2094 lp->mac2_mode = HP100_MAC2MODE5; /* multicast mode = get packets for */
2095 lp->mac1_mode = HP100_MAC1MODE5; /* me, broadcasts and all multicasts */ 2095 lp->mac1_mode = HP100_MAC1MODE5; /* me, broadcasts and all multicasts */
2096#ifdef HP100_MULTICAST_FILTER /* doesn't work!!! */ 2096#ifdef HP100_MULTICAST_FILTER /* doesn't work!!! */
@@ -2104,9 +2104,10 @@ static void hp100_set_multicast_list(struct net_device *dev)
2104 2104
2105 memset(&lp->hash_bytes, 0x00, 8); 2105 memset(&lp->hash_bytes, 0x00, 8);
2106#ifdef HP100_DEBUG 2106#ifdef HP100_DEBUG
2107 printk("hp100: %s: computing hash filter - mc_count = %i\n", dev->name, dev->mc_count); 2107 printk("hp100: %s: computing hash filter - mc_count = %i\n",
2108 dev->name, netdev_mc_count(dev));
2108#endif 2109#endif
2109 for (i = 0, dmi = dev->mc_list; i < dev->mc_count; i++, dmi = dmi->next) { 2110 for (i = 0, dmi = dev->mc_list; i < netdev_mc_count(dev); i++, dmi = dmi->next) {
2110 addrs = dmi->dmi_addr; 2111 addrs = dmi->dmi_addr;
2111 if ((*addrs & 0x01) == 0x01) { /* multicast address? */ 2112 if ((*addrs & 0x01) == 0x01) { /* multicast address? */
2112#ifdef HP100_DEBUG 2113#ifdef HP100_DEBUG
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index fb5e019169ee..b75d27e82a3d 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -391,7 +391,7 @@ static void emac_hash_mc(struct emac_instance *dev)
391 struct dev_mc_list *dmi; 391 struct dev_mc_list *dmi;
392 int i; 392 int i;
393 393
394 DBG(dev, "hash_mc %d" NL, dev->ndev->mc_count); 394 DBG(dev, "hash_mc %d" NL, netdev_mc_count(dev->ndev));
395 395
396 memset(gaht_temp, 0, sizeof (gaht_temp)); 396 memset(gaht_temp, 0, sizeof (gaht_temp));
397 397
@@ -425,9 +425,9 @@ static inline u32 emac_iff2rmr(struct net_device *ndev)
425 if (ndev->flags & IFF_PROMISC) 425 if (ndev->flags & IFF_PROMISC)
426 r |= EMAC_RMR_PME; 426 r |= EMAC_RMR_PME;
427 else if (ndev->flags & IFF_ALLMULTI || 427 else if (ndev->flags & IFF_ALLMULTI ||
428 (ndev->mc_count > EMAC_XAHT_SLOTS(dev))) 428 (netdev_mc_count(ndev) > EMAC_XAHT_SLOTS(dev)))
429 r |= EMAC_RMR_PMME; 429 r |= EMAC_RMR_PMME;
430 else if (ndev->mc_count > 0) 430 else if (!netdev_mc_empty(ndev))
431 r |= EMAC_RMR_MAE; 431 r |= EMAC_RMR_MAE;
432 432
433 return r; 433 return r;
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index a86693906ac8..41b9c0efcbdd 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1062,7 +1062,8 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
1062 struct ibmveth_adapter *adapter = netdev_priv(netdev); 1062 struct ibmveth_adapter *adapter = netdev_priv(netdev);
1063 unsigned long lpar_rc; 1063 unsigned long lpar_rc;
1064 1064
1065 if((netdev->flags & IFF_PROMISC) || (netdev->mc_count > adapter->mcastFilterSize)) { 1065 if ((netdev->flags & IFF_PROMISC) ||
1066 (netdev_mc_count(netdev) > adapter->mcastFilterSize)) {
1066 lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, 1067 lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
1067 IbmVethMcastEnableRecv | 1068 IbmVethMcastEnableRecv |
1068 IbmVethMcastDisableFiltering, 1069 IbmVethMcastDisableFiltering,
@@ -1083,7 +1084,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
1083 ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc); 1084 ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc);
1084 } 1085 }
1085 /* add the addresses to the filter table */ 1086 /* add the addresses to the filter table */
1086 for(i = 0; i < netdev->mc_count; ++i, mclist = mclist->next) { 1087 for(i = 0; i < netdev_mc_count(netdev); ++i, mclist = mclist->next) {
1087 // add the multicast address to the filter table 1088 // add the multicast address to the filter table
1088 unsigned long mcast_addr = 0; 1089 unsigned long mcast_addr = 0;
1089 memcpy(((char *)&mcast_addr)+2, mclist->dmi_addr, 6); 1090 memcpy(((char *)&mcast_addr)+2, mclist->dmi_addr, 6);
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 83cd0d7417d0..28371d648208 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2848,14 +2848,14 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
2848 u32 vmolr = 0; 2848 u32 vmolr = 0;
2849 int i; 2849 int i;
2850 2850
2851 if (!netdev->mc_count) { 2851 if (netdev_mc_empty(netdev)) {
2852 /* nothing to program, so clear mc list */ 2852 /* nothing to program, so clear mc list */
2853 igb_update_mc_addr_list(hw, NULL, 0); 2853 igb_update_mc_addr_list(hw, NULL, 0);
2854 igb_restore_vf_multicasts(adapter); 2854 igb_restore_vf_multicasts(adapter);
2855 return 0; 2855 return 0;
2856 } 2856 }
2857 2857
2858 mta_list = kzalloc(netdev->mc_count * 6, GFP_ATOMIC); 2858 mta_list = kzalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
2859 if (!mta_list) 2859 if (!mta_list)
2860 return -ENOMEM; 2860 return -ENOMEM;
2861 2861
@@ -2865,7 +2865,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
2865 /* The shared function expects a packed array of only addresses. */ 2865 /* The shared function expects a packed array of only addresses. */
2866 mc_ptr = netdev->mc_list; 2866 mc_ptr = netdev->mc_list;
2867 2867
2868 for (i = 0; i < netdev->mc_count; i++) { 2868 for (i = 0; i < netdev_mc_count(netdev); i++) {
2869 if (!mc_ptr) 2869 if (!mc_ptr)
2870 break; 2870 break;
2871 memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN); 2871 memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
@@ -2874,7 +2874,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
2874 igb_update_mc_addr_list(hw, mta_list, i); 2874 igb_update_mc_addr_list(hw, mta_list, i);
2875 kfree(mta_list); 2875 kfree(mta_list);
2876 2876
2877 return netdev->mc_count; 2877 return netdev_mc_count(netdev);
2878} 2878}
2879 2879
2880/** 2880/**
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 23ce07d3de08..6029c400f2be 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -1403,8 +1403,8 @@ static void igbvf_set_multi(struct net_device *netdev)
1403 u8 *mta_list = NULL; 1403 u8 *mta_list = NULL;
1404 int i; 1404 int i;
1405 1405
1406 if (netdev->mc_count) { 1406 if (!netdev_mc_empty(netdev)) {
1407 mta_list = kmalloc(netdev->mc_count * 6, GFP_ATOMIC); 1407 mta_list = kmalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
1408 if (!mta_list) { 1408 if (!mta_list) {
1409 dev_err(&adapter->pdev->dev, 1409 dev_err(&adapter->pdev->dev,
1410 "failed to allocate multicast filter list\n"); 1410 "failed to allocate multicast filter list\n");
@@ -1415,7 +1415,7 @@ static void igbvf_set_multi(struct net_device *netdev)
1415 /* prepare a packed array of only addresses. */ 1415 /* prepare a packed array of only addresses. */
1416 mc_ptr = netdev->mc_list; 1416 mc_ptr = netdev->mc_list;
1417 1417
1418 for (i = 0; i < netdev->mc_count; i++) { 1418 for (i = 0; i < netdev_mc_count(netdev); i++) {
1419 if (!mc_ptr) 1419 if (!mc_ptr)
1420 break; 1420 break;
1421 memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, 1421 memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr,
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 81a4c5d30733..0bd5fef22d49 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -1681,14 +1681,15 @@ static void ioc3_set_multicast_list(struct net_device *dev)
1681 ioc3_w_emcr(ip->emcr); /* Clear promiscuous. */ 1681 ioc3_w_emcr(ip->emcr); /* Clear promiscuous. */
1682 (void) ioc3_r_emcr(); 1682 (void) ioc3_r_emcr();
1683 1683
1684 if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) { 1684 if ((dev->flags & IFF_ALLMULTI) ||
1685 (netdev_mc_count(dev) > 64)) {
1685 /* Too many for hashing to make sense or we want all 1686 /* Too many for hashing to make sense or we want all
1686 multicast packets anyway, so skip computing all the 1687 multicast packets anyway, so skip computing all the
1687 hashes and just accept all packets. */ 1688 hashes and just accept all packets. */
1688 ip->ehar_h = 0xffffffff; 1689 ip->ehar_h = 0xffffffff;
1689 ip->ehar_l = 0xffffffff; 1690 ip->ehar_l = 0xffffffff;
1690 } else { 1691 } else {
1691 for (i = 0; i < dev->mc_count; i++) { 1692 for (i = 0; i < netdev_mc_count(dev); i++) {
1692 char *addr = dmi->dmi_addr; 1693 char *addr = dmi->dmi_addr;
1693 dmi = dmi->next; 1694 dmi = dmi->next;
1694 1695
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 49f35e2ed19f..dbdebd5efe86 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -585,11 +585,11 @@ static void ipg_nic_set_multicast_list(struct net_device *dev)
585 receivemode = IPG_RM_RECEIVEALLFRAMES; 585 receivemode = IPG_RM_RECEIVEALLFRAMES;
586 } else if ((dev->flags & IFF_ALLMULTI) || 586 } else if ((dev->flags & IFF_ALLMULTI) ||
587 ((dev->flags & IFF_MULTICAST) && 587 ((dev->flags & IFF_MULTICAST) &&
588 (dev->mc_count > IPG_MULTICAST_HASHTABLE_SIZE))) { 588 (netdev_mc_count(dev) > IPG_MULTICAST_HASHTABLE_SIZE))) {
589 /* NIC to be configured to receive all multicast 589 /* NIC to be configured to receive all multicast
590 * frames. */ 590 * frames. */
591 receivemode |= IPG_RM_RECEIVEMULTICAST; 591 receivemode |= IPG_RM_RECEIVEMULTICAST;
592 } else if ((dev->flags & IFF_MULTICAST) && (dev->mc_count > 0)) { 592 } else if ((dev->flags & IFF_MULTICAST) && !netdev_mc_empty(dev)) {
593 /* NIC to be configured to receive selected 593 /* NIC to be configured to receive selected
594 * multicast addresses. */ 594 * multicast addresses. */
595 receivemode |= IPG_RM_RECEIVEMULTICASTHASH; 595 receivemode |= IPG_RM_RECEIVEMULTICASTHASH;
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c
index 04d0502726c0..bb4a3cda6e4b 100644
--- a/drivers/net/isa-skeleton.c
+++ b/drivers/net/isa-skeleton.c
@@ -655,14 +655,15 @@ set_multicast_list(struct net_device *dev)
655 /* Enable promiscuous mode */ 655 /* Enable promiscuous mode */
656 outw(MULTICAST|PROMISC, ioaddr); 656 outw(MULTICAST|PROMISC, ioaddr);
657 } 657 }
658 else if((dev->flags&IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) 658 else if ((dev->flags&IFF_ALLMULTI) ||
659 netdev_mc_count(dev) > HW_MAX_ADDRS)
659 { 660 {
660 /* Disable promiscuous mode, use normal mode. */ 661 /* Disable promiscuous mode, use normal mode. */
661 hardware_set_filter(NULL); 662 hardware_set_filter(NULL);
662 663
663 outw(MULTICAST, ioaddr); 664 outw(MULTICAST, ioaddr);
664 } 665 }
665 else if(dev->mc_count) 666 else if (!netdev_mc_empty(dev))
666 { 667 {
667 /* Walk the address list, and load the filter */ 668 /* Walk the address list, and load the filter */
668 hardware_set_filter(dev->mc_list); 669 hardware_set_filter(dev->mc_list);
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 16c91910d6c1..ff015e15f5d1 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -958,7 +958,7 @@ static void veth_set_multicast_list(struct net_device *dev)
958 write_lock_irqsave(&port->mcast_gate, flags); 958 write_lock_irqsave(&port->mcast_gate, flags);
959 959
960 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) || 960 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
961 (dev->mc_count > VETH_MAX_MCAST)) { 961 (netdev_mc_count(dev) > VETH_MAX_MCAST)) {
962 port->promiscuous = 1; 962 port->promiscuous = 1;
963 } else { 963 } else {
964 struct dev_mc_list *dmi = dev->mc_list; 964 struct dev_mc_list *dmi = dev->mc_list;
@@ -969,7 +969,7 @@ static void veth_set_multicast_list(struct net_device *dev)
969 /* Update table */ 969 /* Update table */
970 port->num_mcast = 0; 970 port->num_mcast = 0;
971 971
972 for (i = 0; i < dev->mc_count; i++) { 972 for (i = 0; i < netdev_mc_count(dev); i++) {
973 u8 *addr = dmi->dmi_addr; 973 u8 *addr = dmi->dmi_addr;
974 u64 xaddr = 0; 974 u64 xaddr = 0;
975 975
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index c56ea69762cd..6a7b2ccef72c 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1077,7 +1077,7 @@ ixgb_set_multi(struct net_device *netdev)
1077 rctl |= IXGB_RCTL_VFE; 1077 rctl |= IXGB_RCTL_VFE;
1078 } 1078 }
1079 1079
1080 if (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES) { 1080 if (netdev_mc_count(netdev) > IXGB_MAX_NUM_MULTICAST_ADDRESSES) {
1081 rctl |= IXGB_RCTL_MPE; 1081 rctl |= IXGB_RCTL_MPE;
1082 IXGB_WRITE_REG(hw, RCTL, rctl); 1082 IXGB_WRITE_REG(hw, RCTL, rctl);
1083 } else { 1083 } else {
@@ -1092,7 +1092,7 @@ ixgb_set_multi(struct net_device *netdev)
1092 memcpy(&mta[i * IXGB_ETH_LENGTH_OF_ADDRESS], 1092 memcpy(&mta[i * IXGB_ETH_LENGTH_OF_ADDRESS],
1093 mc_ptr->dmi_addr, IXGB_ETH_LENGTH_OF_ADDRESS); 1093 mc_ptr->dmi_addr, IXGB_ETH_LENGTH_OF_ADDRESS);
1094 1094
1095 ixgb_mc_addr_list_update(hw, mta, netdev->mc_count, 0); 1095 ixgb_mc_addr_list_update(hw, mta, netdev_mc_count(netdev), 0);
1096 } 1096 }
1097} 1097}
1098 1098
@@ -1616,7 +1616,7 @@ ixgb_update_stats(struct ixgb_adapter *adapter)
1616 return; 1616 return;
1617 1617
1618 if ((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) || 1618 if ((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
1619 (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES)) { 1619 (netdev_mc_count(netdev) > IXGB_MAX_NUM_MULTICAST_ADDRESSES)) {
1620 u64 multi = IXGB_READ_REG(&adapter->hw, MPRCL); 1620 u64 multi = IXGB_READ_REG(&adapter->hw, MPRCL);
1621 u32 bcast_l = IXGB_READ_REG(&adapter->hw, BPRCL); 1621 u32 bcast_l = IXGB_READ_REG(&adapter->hw, BPRCL);
1622 u32 bcast_h = IXGB_READ_REG(&adapter->hw, BPRCH); 1622 u32 bcast_h = IXGB_READ_REG(&adapter->hw, BPRCH);
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 382bf8945d11..0792f151de99 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2571,7 +2571,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
2571 hw->mac.ops.update_uc_addr_list(hw, netdev); 2571 hw->mac.ops.update_uc_addr_list(hw, netdev);
2572 2572
2573 /* reprogram multicast list */ 2573 /* reprogram multicast list */
2574 addr_count = netdev->mc_count; 2574 addr_count = netdev_mc_count(netdev);
2575 if (addr_count) 2575 if (addr_count)
2576 addr_list = netdev->mc_list->dmi_addr; 2576 addr_list = netdev->mc_list->dmi_addr;
2577 hw->mac.ops.update_mc_addr_list(hw, addr_list, addr_count, 2577 hw->mac.ops.update_mc_addr_list(hw, addr_list, addr_count,
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index b9f10d05049d..235b5fd4b8d4 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -1527,7 +1527,7 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev)
1527 int addr_count = 0; 1527 int addr_count = 0;
1528 1528
1529 /* reprogram multicast list */ 1529 /* reprogram multicast list */
1530 addr_count = netdev->mc_count; 1530 addr_count = netdev_mc_count(netdev);
1531 if (addr_count) 1531 if (addr_count)
1532 addr_list = netdev->mc_list->dmi_addr; 1532 addr_list = netdev->mc_list->dmi_addr;
1533 if (hw->mac.ops.update_mc_addr_list) 1533 if (hw->mac.ops.update_mc_addr_list)
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 26eed49d3208..d44c39dfbef1 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -2013,7 +2013,7 @@ jme_set_multi(struct net_device *netdev)
2013 2013
2014 jme->reg_rxmcs |= RXMCS_MULFRAME | RXMCS_MULFILTERED; 2014 jme->reg_rxmcs |= RXMCS_MULFRAME | RXMCS_MULFILTERED;
2015 for (i = 0, mclist = netdev->mc_list; 2015 for (i = 0, mclist = netdev->mc_list;
2016 mclist && i < netdev->mc_count; 2016 mclist && i < netdev_mc_count(netdev);
2017 ++i, mclist = mclist->next) { 2017 ++i, mclist = mclist->next) {
2018 2018
2019 bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3F; 2019 bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3F;
diff --git a/drivers/net/korina.c b/drivers/net/korina.c
index 25e2af6997e4..af0c764130e6 100644
--- a/drivers/net/korina.c
+++ b/drivers/net/korina.c
@@ -490,19 +490,19 @@ static void korina_multicast_list(struct net_device *dev)
490 if (dev->flags & IFF_PROMISC) 490 if (dev->flags & IFF_PROMISC)
491 recognise |= ETH_ARC_PRO; 491 recognise |= ETH_ARC_PRO;
492 492
493 else if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 4)) 493 else if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 4))
494 /* All multicast and broadcast */ 494 /* All multicast and broadcast */
495 recognise |= ETH_ARC_AM; 495 recognise |= ETH_ARC_AM;
496 496
497 /* Build the hash table */ 497 /* Build the hash table */
498 if (dev->mc_count > 4) { 498 if (netdev_mc_count(dev) > 4) {
499 u16 hash_table[4]; 499 u16 hash_table[4];
500 u32 crc; 500 u32 crc;
501 501
502 for (i = 0; i < 4; i++) 502 for (i = 0; i < 4; i++)
503 hash_table[i] = 0; 503 hash_table[i] = 0;
504 504
505 for (i = 0; i < dev->mc_count; i++) { 505 for (i = 0; i < netdev_mc_count(dev); i++) {
506 char *addrs = dmi->dmi_addr; 506 char *addrs = dmi->dmi_addr;
507 507
508 dmi = dmi->next; 508 dmi = dmi->next;
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
index 6d3ac65bc35c..9845ab1e5573 100644
--- a/drivers/net/ks8851.c
+++ b/drivers/net/ks8851.c
@@ -965,14 +965,14 @@ static void ks8851_set_rx_mode(struct net_device *dev)
965 965
966 rxctrl.rxcr1 = (RXCR1_RXME | RXCR1_RXAE | 966 rxctrl.rxcr1 = (RXCR1_RXME | RXCR1_RXAE |
967 RXCR1_RXPAFMA | RXCR1_RXMAFMA); 967 RXCR1_RXPAFMA | RXCR1_RXMAFMA);
968 } else if (dev->flags & IFF_MULTICAST && dev->mc_count > 0) { 968 } else if (dev->flags & IFF_MULTICAST && !netdev_mc_empty(dev)) {
969 struct dev_mc_list *mcptr = dev->mc_list; 969 struct dev_mc_list *mcptr = dev->mc_list;
970 u32 crc; 970 u32 crc;
971 int i; 971 int i;
972 972
973 /* accept some multicast */ 973 /* accept some multicast */
974 974
975 for (i = dev->mc_count; i > 0; i--) { 975 for (i = netdev_mc_count(dev); i > 0; i--) {
976 crc = ether_crc(ETH_ALEN, mcptr->dmi_addr); 976 crc = ether_crc(ETH_ALEN, mcptr->dmi_addr);
977 crc >>= (32 - 6); /* get top six bits */ 977 crc >>= (32 - 6); /* get top six bits */
978 978
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
index c0ceebccaa49..ffffb3889704 100644
--- a/drivers/net/ks8851_mll.c
+++ b/drivers/net/ks8851_mll.c
@@ -1193,8 +1193,8 @@ static void ks_set_rx_mode(struct net_device *netdev)
1193 else 1193 else
1194 ks_set_promis(ks, false); 1194 ks_set_promis(ks, false);
1195 1195
1196 if ((netdev->flags & IFF_MULTICAST) && netdev->mc_count) { 1196 if ((netdev->flags & IFF_MULTICAST) && netdev_mc_count(netdev)) {
1197 if (netdev->mc_count <= MAX_MCAST_LST) { 1197 if (netdev_mc_count(netdev) <= MAX_MCAST_LST) {
1198 int i = 0; 1198 int i = 0;
1199 for (ptr = netdev->mc_list; ptr; ptr = ptr->next) { 1199 for (ptr = netdev->mc_list; ptr; ptr = ptr->next) {
1200 if (!(*ptr->dmi_addr & 1)) 1200 if (!(*ptr->dmi_addr & 1))
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index 8d7d3d4625f6..7b9447646f8a 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -1288,7 +1288,7 @@ static void set_multicast_list(struct net_device *dev)
1288 } else { 1288 } else {
1289 short multicast_table[4]; 1289 short multicast_table[4];
1290 int i; 1290 int i;
1291 int num_addrs=dev->mc_count; 1291 int num_addrs=netdev_mc_count(dev);
1292 if(dev->flags&IFF_ALLMULTI) 1292 if(dev->flags&IFF_ALLMULTI)
1293 num_addrs=1; 1293 num_addrs=1;
1294 /* FIXIT: We don't use the multicast table, but rely on upper-layer filtering. */ 1294 /* FIXIT: We don't use the multicast table, but rely on upper-layer filtering. */
diff --git a/drivers/net/lib82596.c b/drivers/net/lib82596.c
index b60efd4bd017..371b58b1d151 100644
--- a/drivers/net/lib82596.c
+++ b/drivers/net/lib82596.c
@@ -1380,21 +1380,21 @@ static void set_multicast_list(struct net_device *dev)
1380 } 1380 }
1381 } 1381 }
1382 1382
1383 cnt = dev->mc_count; 1383 cnt = netdev_mc_count(dev);
1384 if (cnt > MAX_MC_CNT) { 1384 if (cnt > MAX_MC_CNT) {
1385 cnt = MAX_MC_CNT; 1385 cnt = MAX_MC_CNT;
1386 printk(KERN_NOTICE "%s: Only %d multicast addresses supported", 1386 printk(KERN_NOTICE "%s: Only %d multicast addresses supported",
1387 dev->name, cnt); 1387 dev->name, cnt);
1388 } 1388 }
1389 1389
1390 if (dev->mc_count > 0) { 1390 if (!netdev_mc_empty(dev)) {
1391 struct dev_mc_list *dmi; 1391 struct dev_mc_list *dmi;
1392 unsigned char *cp; 1392 unsigned char *cp;
1393 struct mc_cmd *cmd; 1393 struct mc_cmd *cmd;
1394 1394
1395 cmd = &dma->mc_cmd; 1395 cmd = &dma->mc_cmd;
1396 cmd->cmd.command = SWAP16(CmdMulticastList); 1396 cmd->cmd.command = SWAP16(CmdMulticastList);
1397 cmd->mc_cnt = SWAP16(dev->mc_count * 6); 1397 cmd->mc_cnt = SWAP16(netdev_mc_count(dev) * 6);
1398 cp = cmd->mc_addrs; 1398 cp = cmd->mc_addrs;
1399 for (dmi = dev->mc_list; 1399 for (dmi = dev->mc_list;
1400 cnt && dmi != NULL; 1400 cnt && dmi != NULL;
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index a8522bd73ae7..8442c47e93e8 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -232,7 +232,7 @@ static void temac_set_multicast_list(struct net_device *ndev)
232 232
233 mutex_lock(&lp->indirect_mutex); 233 mutex_lock(&lp->indirect_mutex);
234 if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) || 234 if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) ||
235 ndev->mc_count > MULTICAST_CAM_TABLE_NUM) { 235 netdev_mc_count(ndev) > MULTICAST_CAM_TABLE_NUM) {
236 /* 236 /*
237 * We must make the kernel realise we had to move 237 * We must make the kernel realise we had to move
238 * into promisc mode or we start all out war on 238 * into promisc mode or we start all out war on
@@ -242,9 +242,9 @@ static void temac_set_multicast_list(struct net_device *ndev)
242 ndev->flags |= IFF_PROMISC; 242 ndev->flags |= IFF_PROMISC;
243 temac_indirect_out32(lp, XTE_AFM_OFFSET, XTE_AFM_EPPRM_MASK); 243 temac_indirect_out32(lp, XTE_AFM_OFFSET, XTE_AFM_EPPRM_MASK);
244 dev_info(&ndev->dev, "Promiscuous mode enabled.\n"); 244 dev_info(&ndev->dev, "Promiscuous mode enabled.\n");
245 } else if (ndev->mc_count) { 245 } else if (!netdev_mc_empty(ndev)) {
246 struct dev_mc_list *mclist = ndev->mc_list; 246 struct dev_mc_list *mclist = ndev->mc_list;
247 for (i = 0; mclist && i < ndev->mc_count; i++) { 247 for (i = 0; mclist && i < netdev_mc_count(ndev); i++) {
248 248
249 if (i >= MULTICAST_CAM_TABLE_NUM) 249 if (i >= MULTICAST_CAM_TABLE_NUM)
250 break; 250 break;
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c
index e20fefc73c8b..b1f5d79af61f 100644
--- a/drivers/net/lp486e.c
+++ b/drivers/net/lp486e.c
@@ -1253,18 +1253,19 @@ static void set_multicast_list(struct net_device *dev) {
1253 1253
1254 if (i596_debug > 1) 1254 if (i596_debug > 1)
1255 printk ("%s: set multicast list %d\n", 1255 printk ("%s: set multicast list %d\n",
1256 dev->name, dev->mc_count); 1256 dev->name, netdev_mc_count(dev));
1257 1257
1258 if (dev->mc_count > 0) { 1258 if (!netdev_mc_empty(dev)) {
1259 struct dev_mc_list *dmi; 1259 struct dev_mc_list *dmi;
1260 char *cp; 1260 char *cp;
1261 cmd = kmalloc(sizeof(struct i596_cmd)+2+dev->mc_count*6, GFP_ATOMIC); 1261 cmd = kmalloc(sizeof(struct i596_cmd) + 2 +
1262 netdev_mc_count(dev) * 6, GFP_ATOMIC);
1262 if (cmd == NULL) { 1263 if (cmd == NULL) {
1263 printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name); 1264 printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name);
1264 return; 1265 return;
1265 } 1266 }
1266 cmd->command = CmdMulticastList; 1267 cmd->command = CmdMulticastList;
1267 *((unsigned short *) (cmd + 1)) = dev->mc_count * 6; 1268 *((unsigned short *) (cmd + 1)) = netdev_mc_count(dev) * 6;
1268 cp = ((char *)(cmd + 1))+2; 1269 cp = ((char *)(cmd + 1))+2;
1269 for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { 1270 for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) {
1270 memcpy(cp, dmi,6); 1271 memcpy(cp, dmi,6);
@@ -1277,7 +1278,8 @@ static void set_multicast_list(struct net_device *dev) {
1277 if (lp->set_conf.pa_next != I596_NULL) { 1278 if (lp->set_conf.pa_next != I596_NULL) {
1278 return; 1279 return;
1279 } 1280 }
1280 if (dev->mc_count == 0 && !(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) { 1281 if (netdev_mc_empty(dev) &&
1282 !(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) {
1281 lp->i596_config[8] &= ~0x01; 1283 lp->i596_config[8] &= ~0x01;
1282 } else { 1284 } else {
1283 lp->i596_config[8] |= 0x01; 1285 lp->i596_config[8] |= 0x01;
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 1d0d4d9ab623..fbc371fa19b5 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -901,7 +901,7 @@ static void macb_sethashtable(struct net_device *dev)
901 mc_filter[0] = mc_filter[1] = 0; 901 mc_filter[0] = mc_filter[1] = 0;
902 902
903 curr = dev->mc_list; 903 curr = dev->mc_list;
904 for (i = 0; i < dev->mc_count; i++, curr = curr->next) { 904 for (i = 0; i < netdev_mc_count(dev); i++, curr = curr->next) {
905 if (!curr) break; /* unexpected end of list */ 905 if (!curr) break; /* unexpected end of list */
906 906
907 bitnr = hash_get_index(curr->dmi_addr); 907 bitnr = hash_get_index(curr->dmi_addr);
@@ -934,7 +934,7 @@ static void macb_set_rx_mode(struct net_device *dev)
934 macb_writel(bp, HRB, -1); 934 macb_writel(bp, HRB, -1);
935 macb_writel(bp, HRT, -1); 935 macb_writel(bp, HRT, -1);
936 cfg |= MACB_BIT(NCFGR_MTI); 936 cfg |= MACB_BIT(NCFGR_MTI);
937 } else if (dev->mc_count > 0) { 937 } else if (!netdev_mc_empty(dev)) {
938 /* Enable specific multicasts */ 938 /* Enable specific multicasts */
939 macb_sethashtable(dev); 939 macb_sethashtable(dev);
940 cfg |= MACB_BIT(NCFGR_MTI); 940 cfg |= MACB_BIT(NCFGR_MTI);
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index d9fbad386389..fdb0bbdd6782 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -606,7 +606,7 @@ static void mace_set_multicast(struct net_device *dev)
606 } else { 606 } else {
607 for (i = 0; i < 8; i++) 607 for (i = 0; i < 8; i++)
608 multicast_filter[i] = 0; 608 multicast_filter[i] = 0;
609 for (i = 0; i < dev->mc_count; i++) { 609 for (i = 0; i < netdev_mc_count(dev); i++) {
610 crc = ether_crc_le(6, dmi->dmi_addr); 610 crc = ether_crc_le(6, dmi->dmi_addr);
611 j = crc >> 26; /* bit number in multicast_filter */ 611 j = crc >> 26; /* bit number in multicast_filter */
612 multicast_filter[j >> 3] |= 1 << (j & 7); 612 multicast_filter[j >> 3] |= 1 << (j & 7);
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c
index 44f3c2896f20..740accbf0806 100644
--- a/drivers/net/macmace.c
+++ b/drivers/net/macmace.c
@@ -518,7 +518,7 @@ static void mace_set_multicast(struct net_device *dev)
518 } else { 518 } else {
519 for (i = 0; i < 8; i++) 519 for (i = 0; i < 8; i++)
520 multicast_filter[i] = 0; 520 multicast_filter[i] = 0;
521 for (i = 0; i < dev->mc_count; i++) { 521 for (i = 0; i < netdev_mc_count(dev); i++) {
522 crc = ether_crc_le(6, dmi->dmi_addr); 522 crc = ether_crc_le(6, dmi->dmi_addr);
523 j = crc >> 26; /* bit number in multicast_filter */ 523 j = crc >> 26; /* bit number in multicast_filter */
524 multicast_filter[j >> 3] |= 1 << (j & 7); 524 multicast_filter[j >> 3] |= 1 << (j & 7);
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 2d7b3bbfed01..c64e5b0d3596 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -2488,7 +2488,7 @@ static void __set_rx_mode(struct net_device *dev)
2488 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 2488 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
2489 rx_mode = RxFilterEnable | AcceptBroadcast 2489 rx_mode = RxFilterEnable | AcceptBroadcast
2490 | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys; 2490 | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys;
2491 } else if ((dev->mc_count > multicast_filter_limit) || 2491 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
2492 (dev->flags & IFF_ALLMULTI)) { 2492 (dev->flags & IFF_ALLMULTI)) {
2493 rx_mode = RxFilterEnable | AcceptBroadcast 2493 rx_mode = RxFilterEnable | AcceptBroadcast
2494 | AcceptAllMulticast | AcceptMyPhys; 2494 | AcceptAllMulticast | AcceptMyPhys;
@@ -2496,7 +2496,7 @@ static void __set_rx_mode(struct net_device *dev)
2496 struct dev_mc_list *mclist; 2496 struct dev_mc_list *mclist;
2497 int i; 2497 int i;
2498 memset(mc_filter, 0, sizeof(mc_filter)); 2498 memset(mc_filter, 0, sizeof(mc_filter));
2499 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 2499 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
2500 i++, mclist = mclist->next) { 2500 i++, mclist = mclist->next) {
2501 int b = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 23) & 0x1ff; 2501 int b = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 23) & 0x1ff;
2502 mc_filter[b/8] |= (1 << (b & 0x07)); 2502 mc_filter[b/8] |= (1 << (b & 0x07));
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index dd45c7a9122e..25f4414cc33e 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -554,7 +554,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
554 return; 554 return;
555 } 555 }
556 556
557 if (netdev->mc_count == 0) { 557 if (netdev_mc_empty(netdev)) {
558 adapter->set_promisc(adapter, 558 adapter->set_promisc(adapter,
559 NETXEN_NIU_NON_PROMISC_MODE); 559 NETXEN_NIU_NON_PROMISC_MODE);
560 netxen_nic_disable_mcast_filter(adapter); 560 netxen_nic_disable_mcast_filter(adapter);
@@ -563,7 +563,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
563 563
564 adapter->set_promisc(adapter, NETXEN_NIU_ALLMULTI_MODE); 564 adapter->set_promisc(adapter, NETXEN_NIU_ALLMULTI_MODE);
565 if (netdev->flags & IFF_ALLMULTI || 565 if (netdev->flags & IFF_ALLMULTI ||
566 netdev->mc_count > adapter->max_mc_count) { 566 netdev_mc_count(netdev) > adapter->max_mc_count) {
567 netxen_nic_disable_mcast_filter(adapter); 567 netxen_nic_disable_mcast_filter(adapter);
568 return; 568 return;
569 } 569 }
@@ -573,7 +573,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
573 for (mc_ptr = netdev->mc_list; mc_ptr; mc_ptr = mc_ptr->next, index++) 573 for (mc_ptr = netdev->mc_list; mc_ptr; mc_ptr = mc_ptr->next, index++)
574 netxen_nic_set_mcast_addr(adapter, index, mc_ptr->dmi_addr); 574 netxen_nic_set_mcast_addr(adapter, index, mc_ptr->dmi_addr);
575 575
576 if (index != netdev->mc_count) 576 if (index != netdev_mc_count(netdev))
577 printk(KERN_WARNING "%s: %s multicast address count mismatch\n", 577 printk(KERN_WARNING "%s: %s multicast address count mismatch\n",
578 netxen_nic_driver_name, netdev->name); 578 netxen_nic_driver_name, netdev->name);
579 579
@@ -704,12 +704,12 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)
704 } 704 }
705 705
706 if ((netdev->flags & IFF_ALLMULTI) || 706 if ((netdev->flags & IFF_ALLMULTI) ||
707 (netdev->mc_count > adapter->max_mc_count)) { 707 (netdev_mc_count(netdev) > adapter->max_mc_count)) {
708 mode = VPORT_MISS_MODE_ACCEPT_MULTI; 708 mode = VPORT_MISS_MODE_ACCEPT_MULTI;
709 goto send_fw_cmd; 709 goto send_fw_cmd;
710 } 710 }
711 711
712 if (netdev->mc_count > 0) { 712 if (!netdev_mc_empty(netdev)) {
713 for (mc_ptr = netdev->mc_list; mc_ptr; 713 for (mc_ptr = netdev->mc_list; mc_ptr;
714 mc_ptr = mc_ptr->next) { 714 mc_ptr = mc_ptr->next) {
715 nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr, &del_list); 715 nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr, &del_list);
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c
index b42f5e522f90..497c6d514a68 100644
--- a/drivers/net/ni52.c
+++ b/drivers/net/ni52.c
@@ -597,7 +597,7 @@ static int init586(struct net_device *dev)
597 struct tdr_cmd_struct __iomem *tdr_cmd; 597 struct tdr_cmd_struct __iomem *tdr_cmd;
598 struct mcsetup_cmd_struct __iomem *mc_cmd; 598 struct mcsetup_cmd_struct __iomem *mc_cmd;
599 struct dev_mc_list *dmi = dev->mc_list; 599 struct dev_mc_list *dmi = dev->mc_list;
600 int num_addrs = dev->mc_count; 600 int num_addrs = netdev_mc_count(dev);
601 601
602 ptr = p->scb + 1; 602 ptr = p->scb + 1;
603 603
diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c
index ae19aafd2c7e..9225c76cac40 100644
--- a/drivers/net/ni65.c
+++ b/drivers/net/ni65.c
@@ -849,7 +849,7 @@ static int ni65_lance_reinit(struct net_device *dev)
849 849
850 if(dev->flags & IFF_PROMISC) 850 if(dev->flags & IFF_PROMISC)
851 ni65_init_lance(p,dev->dev_addr,0x00,M_PROM); 851 ni65_init_lance(p,dev->dev_addr,0x00,M_PROM);
852 else if(dev->mc_count || dev->flags & IFF_ALLMULTI) 852 else if (netdev_mc_count(dev) || dev->flags & IFF_ALLMULTI)
853 ni65_init_lance(p,dev->dev_addr,0xff,0x0); 853 ni65_init_lance(p,dev->dev_addr,0xff,0x0);
854 else 854 else
855 ni65_init_lance(p,dev->dev_addr,0x00,0x00); 855 ni65_init_lance(p,dev->dev_addr,0x00,0x00);
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index af9a8647c7e8..7b52d9762b00 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6369,7 +6369,7 @@ static void niu_set_rx_mode(struct net_device *dev)
6369 np->flags &= ~(NIU_FLAGS_MCAST | NIU_FLAGS_PROMISC); 6369 np->flags &= ~(NIU_FLAGS_MCAST | NIU_FLAGS_PROMISC);
6370 if (dev->flags & IFF_PROMISC) 6370 if (dev->flags & IFF_PROMISC)
6371 np->flags |= NIU_FLAGS_PROMISC; 6371 np->flags |= NIU_FLAGS_PROMISC;
6372 if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 0)) 6372 if ((dev->flags & IFF_ALLMULTI) || (!netdev_mc_empty(dev)))
6373 np->flags |= NIU_FLAGS_MCAST; 6373 np->flags |= NIU_FLAGS_MCAST;
6374 6374
6375 alt_cnt = netdev_uc_count(dev); 6375 alt_cnt = netdev_uc_count(dev);
@@ -6412,7 +6412,7 @@ static void niu_set_rx_mode(struct net_device *dev)
6412 if (dev->flags & IFF_ALLMULTI) { 6412 if (dev->flags & IFF_ALLMULTI) {
6413 for (i = 0; i < 16; i++) 6413 for (i = 0; i < 16; i++)
6414 hash[i] = 0xffff; 6414 hash[i] = 0xffff;
6415 } else if (dev->mc_count > 0) { 6415 } else if (!netdev_mc_empty(dev)) {
6416 for (addr = dev->mc_list; addr; addr = addr->next) { 6416 for (addr = dev->mc_list; addr; addr = addr->next) {
6417 u32 crc = ether_crc_le(ETH_ALEN, addr->da_addr); 6417 u32 crc = ether_crc_le(ETH_ALEN, addr->da_addr);
6418 6418
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index a3b6aa0f375d..8dd509c09bc8 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1719,7 +1719,7 @@ static void ns83820_set_multicast(struct net_device *ndev)
1719 else 1719 else
1720 and_mask &= ~(RFCR_AAU | RFCR_AAM); 1720 and_mask &= ~(RFCR_AAU | RFCR_AAM);
1721 1721
1722 if (ndev->flags & IFF_ALLMULTI || ndev->mc_count) 1722 if (ndev->flags & IFF_ALLMULTI || netdev_mc_count(ndev))
1723 or_mask |= RFCR_AAM; 1723 or_mask |= RFCR_AAM;
1724 else 1724 else
1725 and_mask &= ~RFCR_AAM; 1725 and_mask &= ~RFCR_AAM;
diff --git a/drivers/net/octeon/octeon_mgmt.c b/drivers/net/octeon/octeon_mgmt.c
index 6fd8789ef487..3a0f910924a5 100644
--- a/drivers/net/octeon/octeon_mgmt.c
+++ b/drivers/net/octeon/octeon_mgmt.c
@@ -493,8 +493,8 @@ static void octeon_mgmt_set_rx_filtering(struct net_device *netdev)
493 } 493 }
494 494
495 if (netdev->flags & IFF_MULTICAST) { 495 if (netdev->flags & IFF_MULTICAST) {
496 if (cam_mode == 0 || (netdev->flags & IFF_ALLMULTI) 496 if (cam_mode == 0 || (netdev->flags & IFF_ALLMULTI) ||
497 || netdev->mc_count > available_cam_entries) 497 netdev_mc_count(netdev) > available_cam_entries)
498 multicast_mode = 2; /* 1 - Accept all multicast. */ 498 multicast_mode = 2; /* 1 - Accept all multicast. */
499 else 499 else
500 multicast_mode = 0; /* 0 - Use CAM. */ 500 multicast_mode = 0; /* 0 - Use CAM. */
@@ -511,7 +511,7 @@ static void octeon_mgmt_set_rx_filtering(struct net_device *netdev)
511 } 511 }
512 } 512 }
513 if (multicast_mode == 0) { 513 if (multicast_mode == 0) {
514 i = netdev->mc_count; 514 i = netdev_mc_count(netdev);
515 list = netdev->mc_list; 515 list = netdev->mc_list;
516 while (i--) { 516 while (i--) {
517 octeon_mgmt_cam_state_add(&cam_state, list->da_addr); 517 octeon_mgmt_cam_state_add(&cam_state, list->da_addr);
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 20273832bfce..bbdf0398c93f 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -1820,7 +1820,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
1820 AcceptBroadcast | AcceptMulticast | AcceptMyPhys | 1820 AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
1821 AcceptAllPhys; 1821 AcceptAllPhys;
1822 mc_filter[1] = mc_filter[0] = 0xffffffff; 1822 mc_filter[1] = mc_filter[0] = 0xffffffff;
1823 } else if ((dev->mc_count > multicast_filter_limit) || 1823 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1824 (dev->flags & IFF_ALLMULTI)) { 1824 (dev->flags & IFF_ALLMULTI)) {
1825 /* Too many to filter perfectly -- accept all multicasts. */ 1825 /* Too many to filter perfectly -- accept all multicasts. */
1826 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1826 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
@@ -1829,7 +1829,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
1829 struct dev_mc_list *mclist; 1829 struct dev_mc_list *mclist;
1830 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1830 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
1831 mc_filter[1] = mc_filter[0] = 0; 1831 mc_filter[1] = mc_filter[0] = 0;
1832 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1832 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1833 i++, mclist = mclist->next) { 1833 i++, mclist = mclist->next) {
1834 int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; 1834 int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
1835 1835
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 98938ea9e0bd..3d1d3a7b7ed3 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -1148,7 +1148,7 @@ static void set_rx_mode(struct net_device *dev)
1148 if (dev->flags & IFF_PROMISC) 1148 if (dev->flags & IFF_PROMISC)
1149 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm, 1149 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
1150 ioaddr + EL3_CMD); 1150 ioaddr + EL3_CMD);
1151 else if (dev->mc_count || (dev->flags & IFF_ALLMULTI)) 1151 else if (!netdev_mc_empty(dev) || (dev->flags & IFF_ALLMULTI))
1152 outw(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD); 1152 outw(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD);
1153 else 1153 else
1154 outw(SetRxFilter | RxStation | RxBroadcast, ioaddr + EL3_CMD); 1154 outw(SetRxFilter | RxStation | RxBroadcast, ioaddr + EL3_CMD);
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 322e11df0097..091e0b00043e 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -886,7 +886,7 @@ static void set_rx_mode(struct net_device *dev)
886 886
887 if (dev->flags & IFF_PROMISC) 887 if (dev->flags & IFF_PROMISC)
888 opts |= RxMulticast | RxProm; 888 opts |= RxMulticast | RxProm;
889 else if (dev->mc_count || (dev->flags & IFF_ALLMULTI)) 889 else if (!netdev_mc_empty(dev) || (dev->flags & IFF_ALLMULTI))
890 opts |= RxMulticast; 890 opts |= RxMulticast;
891 outw(opts, ioaddr + EL3_CMD); 891 outw(opts, ioaddr + EL3_CMD);
892} 892}
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 7b17404d0858..3d573ed5f7c5 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -1187,19 +1187,19 @@ static void set_rx_mode(struct net_device *dev)
1187 if (dev->flags & IFF_PROMISC) { 1187 if (dev->flags & IFF_PROMISC) {
1188 memset(mc_filter, 0xff, sizeof(mc_filter)); 1188 memset(mc_filter, 0xff, sizeof(mc_filter));
1189 outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ 1189 outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
1190 } else if (dev->mc_count > MC_FILTERBREAK || 1190 } else if (netdev_mc_count(dev) > MC_FILTERBREAK ||
1191 (dev->flags & IFF_ALLMULTI)) { 1191 (dev->flags & IFF_ALLMULTI)) {
1192 /* Too many to filter perfectly -- accept all multicasts. */ 1192 /* Too many to filter perfectly -- accept all multicasts. */
1193 memset(mc_filter, 0xff, sizeof(mc_filter)); 1193 memset(mc_filter, 0xff, sizeof(mc_filter));
1194 outb(2, ioaddr + RX_MODE); /* Use normal mode. */ 1194 outb(2, ioaddr + RX_MODE); /* Use normal mode. */
1195 } else if (dev->mc_count == 0) { 1195 } else if (netdev_mc_empty(dev)) {
1196 memset(mc_filter, 0x00, sizeof(mc_filter)); 1196 memset(mc_filter, 0x00, sizeof(mc_filter));
1197 outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */ 1197 outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */
1198 } else { 1198 } else {
1199 struct dev_mc_list *mclist; 1199 struct dev_mc_list *mclist;
1200 1200
1201 memset(mc_filter, 0, sizeof(mc_filter)); 1201 memset(mc_filter, 0, sizeof(mc_filter));
1202 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1202 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1203 i++, mclist = mclist->next) { 1203 i++, mclist = mclist->next) {
1204 unsigned int bit = 1204 unsigned int bit =
1205 ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26; 1205 ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26;
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 12e3233868e9..c42a31a97fa3 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -1481,8 +1481,8 @@ static void set_multicast_list(struct net_device *dev)
1481#ifdef PCMCIA_DEBUG 1481#ifdef PCMCIA_DEBUG
1482 { 1482 {
1483 static int old; 1483 static int old;
1484 if (dev->mc_count != old) { 1484 if (netdev_mc_count(dev) != old) {
1485 old = dev->mc_count; 1485 old = netdev_mc_count(dev);
1486 pr_debug("%s: setting Rx mode to %d addresses.\n", 1486 pr_debug("%s: setting Rx mode to %d addresses.\n",
1487 dev->name, old); 1487 dev->name, old);
1488 } 1488 }
@@ -1490,13 +1490,13 @@ static void set_multicast_list(struct net_device *dev)
1490#endif 1490#endif
1491 1491
1492 /* Set multicast_num_addrs. */ 1492 /* Set multicast_num_addrs. */
1493 lp->multicast_num_addrs = dev->mc_count; 1493 lp->multicast_num_addrs = netdev_mc_count(dev);
1494 1494
1495 /* Set multicast_ladrf. */ 1495 /* Set multicast_ladrf. */
1496 if (num_addrs > 0) { 1496 if (num_addrs > 0) {
1497 /* Calculate multicast logical address filter */ 1497 /* Calculate multicast logical address filter */
1498 memset(lp->multicast_ladrf, 0, MACE_LADRF_LEN); 1498 memset(lp->multicast_ladrf, 0, MACE_LADRF_LEN);
1499 for (i = 0; i < dev->mc_count; i++) { 1499 for (i = 0; i < netdev_mc_count(dev); i++) {
1500 memcpy(adr, dmi->dmi_addr, ETHER_ADDR_LEN); 1500 memcpy(adr, dmi->dmi_addr, ETHER_ADDR_LEN);
1501 dmi = dmi->next; 1501 dmi = dmi->next;
1502 BuildLAF(lp->multicast_ladrf, adr); 1502 BuildLAF(lp->multicast_ladrf, adr);
@@ -1537,15 +1537,15 @@ static void set_multicast_list(struct net_device *dev)
1537#ifdef PCMCIA_DEBUG 1537#ifdef PCMCIA_DEBUG
1538 { 1538 {
1539 static int old; 1539 static int old;
1540 if (dev->mc_count != old) { 1540 if (netdev_mc_count(dev) != old) {
1541 old = dev->mc_count; 1541 old = netdev_mc_count(dev);
1542 pr_debug("%s: setting Rx mode to %d addresses.\n", 1542 pr_debug("%s: setting Rx mode to %d addresses.\n",
1543 dev->name, old); 1543 dev->name, old);
1544 } 1544 }
1545 } 1545 }
1546#endif 1546#endif
1547 1547
1548 lp->multicast_num_addrs = dev->mc_count; 1548 lp->multicast_num_addrs = netdev_mc_count(dev);
1549 restore_multicast_list(dev); 1549 restore_multicast_list(dev);
1550 1550
1551} /* set_multicast_list */ 1551} /* set_multicast_list */
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 6dd486d2977b..d2e86b8887c8 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -1638,8 +1638,8 @@ static void set_rx_mode(struct net_device *dev)
1638 } else if (dev->flags & IFF_ALLMULTI) 1638 } else if (dev->flags & IFF_ALLMULTI)
1639 rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti; 1639 rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti;
1640 else { 1640 else {
1641 if (dev->mc_count) { 1641 if (!netdev_mc_empty(dev)) {
1642 fill_multicast_tbl(dev->mc_count, dev->mc_list, 1642 fill_multicast_tbl(netdev_mc_count(dev), dev->mc_list,
1643 (u_char *)multicast_table); 1643 (u_char *)multicast_table);
1644 } 1644 }
1645 rx_cfg_setting = RxStripCRC | RxEnable; 1645 rx_cfg_setting = RxStripCRC | RxEnable;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 466fc72698c0..4ace18a71152 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -1384,7 +1384,7 @@ set_addresses(struct net_device *dev)
1384 if (++n > 9) 1384 if (++n > 9)
1385 break; 1385 break;
1386 i = 0; 1386 i = 0;
1387 if (n > 1 && n <= dev->mc_count && dmi) { 1387 if (n > 1 && n <= netdev_mc_count(dev) && dmi) {
1388 dmi = dmi->next; 1388 dmi = dmi->next;
1389 } 1389 }
1390 } 1390 }
@@ -1394,7 +1394,7 @@ set_addresses(struct net_device *dev)
1394 SelectPage(k); 1394 SelectPage(k);
1395 } 1395 }
1396 1396
1397 if (n && n <= dev->mc_count && dmi) 1397 if (n && n <= netdev_mc_count(dev) && dmi)
1398 addr = dmi->dmi_addr; 1398 addr = dmi->dmi_addr;
1399 else 1399 else
1400 addr = dev->dev_addr; 1400 addr = dev->dev_addr;
@@ -1424,9 +1424,9 @@ set_multicast_list(struct net_device *dev)
1424 1424
1425 if (dev->flags & IFF_PROMISC) { /* snoop */ 1425 if (dev->flags & IFF_PROMISC) { /* snoop */
1426 PutByte(XIRCREG42_SWC1, value | 0x06); /* set MPE and PME */ 1426 PutByte(XIRCREG42_SWC1, value | 0x06); /* set MPE and PME */
1427 } else if (dev->mc_count > 9 || (dev->flags & IFF_ALLMULTI)) { 1427 } else if (netdev_mc_count(dev) > 9 || (dev->flags & IFF_ALLMULTI)) {
1428 PutByte(XIRCREG42_SWC1, value | 0x02); /* set MPE */ 1428 PutByte(XIRCREG42_SWC1, value | 0x02); /* set MPE */
1429 } else if (dev->mc_count) { 1429 } else if (!netdev_mc_empty(dev)) {
1430 /* the chip can filter 9 addresses perfectly */ 1430 /* the chip can filter 9 addresses perfectly */
1431 PutByte(XIRCREG42_SWC1, value | 0x01); 1431 PutByte(XIRCREG42_SWC1, value | 0x01);
1432 SelectPage(0x40); 1432 SelectPage(0x40);
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 0dc7ff896eeb..3522794550dd 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -2698,7 +2698,7 @@ static void pcnet32_load_multicast(struct net_device *dev)
2698 ib->filter[1] = 0; 2698 ib->filter[1] = 0;
2699 2699
2700 /* Add addresses */ 2700 /* Add addresses */
2701 for (i = 0; i < dev->mc_count; i++) { 2701 for (i = 0; i < netdev_mc_count(dev); i++) {
2702 addrs = dmi->dmi_addr; 2702 addrs = dmi->dmi_addr;
2703 dmi = dmi->next; 2703 dmi = dmi->next;
2704 2704
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 0c768593aad0..c19dd4a6cd76 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -568,7 +568,7 @@ void gelic_net_set_multi(struct net_device *netdev)
568 status); 568 status);
569 569
570 if ((netdev->flags & IFF_ALLMULTI) || 570 if ((netdev->flags & IFF_ALLMULTI) ||
571 (netdev->mc_count > GELIC_NET_MC_COUNT_MAX)) { 571 (netdev_mc_count(netdev) > GELIC_NET_MC_COUNT_MAX)) {
572 status = lv1_net_add_multicast_address(bus_id(card), 572 status = lv1_net_add_multicast_address(bus_id(card),
573 dev_id(card), 573 dev_id(card),
574 0, 1); 574 0, 1);
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index dc6cd69d6d93..8ea7f869e293 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -447,12 +447,12 @@ void qlcnic_set_multi(struct net_device *netdev)
447 } 447 }
448 448
449 if ((netdev->flags & IFF_ALLMULTI) || 449 if ((netdev->flags & IFF_ALLMULTI) ||
450 (netdev->mc_count > adapter->max_mc_count)) { 450 (netdev_mc_count(netdev) > adapter->max_mc_count)) {
451 mode = VPORT_MISS_MODE_ACCEPT_MULTI; 451 mode = VPORT_MISS_MODE_ACCEPT_MULTI;
452 goto send_fw_cmd; 452 goto send_fw_cmd;
453 } 453 }
454 454
455 if (netdev->mc_count > 0) { 455 if (!netdev_mc_empty(netdev)) {
456 for (mc_ptr = netdev->mc_list; mc_ptr; 456 for (mc_ptr = netdev->mc_list; mc_ptr;
457 mc_ptr = mc_ptr->next) { 457 mc_ptr = mc_ptr->next) {
458 qlcnic_nic_add_mac(adapter, mc_ptr->dmi_addr, 458 qlcnic_nic_add_mac(adapter, mc_ptr->dmi_addr,
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 3cb60e10d456..dd3e0f1b2965 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -4221,7 +4221,7 @@ static void qlge_set_multicast_list(struct net_device *ndev)
4221 * transition is taking place. 4221 * transition is taking place.
4222 */ 4222 */
4223 if ((ndev->flags & IFF_ALLMULTI) || 4223 if ((ndev->flags & IFF_ALLMULTI) ||
4224 (ndev->mc_count > MAX_MULTICAST_ENTRIES)) { 4224 (netdev_mc_count(ndev) > MAX_MULTICAST_ENTRIES)) {
4225 if (!test_bit(QL_ALLMULTI, &qdev->flags)) { 4225 if (!test_bit(QL_ALLMULTI, &qdev->flags)) {
4226 if (ql_set_routing_reg 4226 if (ql_set_routing_reg
4227 (qdev, RT_IDX_ALLMULTI_SLOT, RT_IDX_MCAST, 1)) { 4227 (qdev, RT_IDX_ALLMULTI_SLOT, RT_IDX_MCAST, 1)) {
@@ -4243,7 +4243,7 @@ static void qlge_set_multicast_list(struct net_device *ndev)
4243 } 4243 }
4244 } 4244 }
4245 4245
4246 if (ndev->mc_count) { 4246 if (!netdev_mc_empty(ndev)) {
4247 status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); 4247 status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
4248 if (status) 4248 if (status)
4249 goto exit; 4249 goto exit;
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index d68ba7a58631..b8103425facb 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -958,21 +958,22 @@ static void r6040_multicast_list(struct net_device *dev)
958 } 958 }
959 /* Too many multicast addresses 959 /* Too many multicast addresses
960 * accept all traffic */ 960 * accept all traffic */
961 else if ((dev->mc_count > MCAST_MAX) || (dev->flags & IFF_ALLMULTI)) 961 else if ((netdev_mc_count(dev) > MCAST_MAX) ||
962 (dev->flags & IFF_ALLMULTI))
962 reg |= 0x0020; 963 reg |= 0x0020;
963 964
964 iowrite16(reg, ioaddr); 965 iowrite16(reg, ioaddr);
965 spin_unlock_irqrestore(&lp->lock, flags); 966 spin_unlock_irqrestore(&lp->lock, flags);
966 967
967 /* Build the hash table */ 968 /* Build the hash table */
968 if (dev->mc_count > MCAST_MAX) { 969 if (netdev_mc_count(dev) > MCAST_MAX) {
969 u16 hash_table[4]; 970 u16 hash_table[4];
970 u32 crc; 971 u32 crc;
971 972
972 for (i = 0; i < 4; i++) 973 for (i = 0; i < 4; i++)
973 hash_table[i] = 0; 974 hash_table[i] = 0;
974 975
975 for (i = 0; i < dev->mc_count; i++) { 976 for (i = 0; i < netdev_mc_count(dev); i++) {
976 char *addrs = dmi->dmi_addr; 977 char *addrs = dmi->dmi_addr;
977 978
978 dmi = dmi->next; 979 dmi = dmi->next;
@@ -994,14 +995,14 @@ static void r6040_multicast_list(struct net_device *dev)
994 iowrite16(hash_table[3], ioaddr + MAR3); 995 iowrite16(hash_table[3], ioaddr + MAR3);
995 } 996 }
996 /* Multicast Address 1~4 case */ 997 /* Multicast Address 1~4 case */
997 for (i = 0, dmi; (i < dev->mc_count) && (i < MCAST_MAX); i++) { 998 for (i = 0, dmi; (i < netdev_mc_count(dev)) && (i < MCAST_MAX); i++) {
998 adrp = (u16 *)dmi->dmi_addr; 999 adrp = (u16 *)dmi->dmi_addr;
999 iowrite16(adrp[0], ioaddr + MID_1L + 8*i); 1000 iowrite16(adrp[0], ioaddr + MID_1L + 8*i);
1000 iowrite16(adrp[1], ioaddr + MID_1M + 8*i); 1001 iowrite16(adrp[1], ioaddr + MID_1M + 8*i);
1001 iowrite16(adrp[2], ioaddr + MID_1H + 8*i); 1002 iowrite16(adrp[2], ioaddr + MID_1H + 8*i);
1002 dmi = dmi->next; 1003 dmi = dmi->next;
1003 } 1004 }
1004 for (i = dev->mc_count; i < MCAST_MAX; i++) { 1005 for (i = netdev_mc_count(dev); i < MCAST_MAX; i++) {
1005 iowrite16(0xffff, ioaddr + MID_0L + 8*i); 1006 iowrite16(0xffff, ioaddr + MID_0L + 8*i);
1006 iowrite16(0xffff, ioaddr + MID_0M + 8*i); 1007 iowrite16(0xffff, ioaddr + MID_0M + 8*i);
1007 iowrite16(0xffff, ioaddr + MID_0H + 8*i); 1008 iowrite16(0xffff, ioaddr + MID_0H + 8*i);
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c1bb24cf0793..85c635f354b5 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4758,7 +4758,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
4758 AcceptBroadcast | AcceptMulticast | AcceptMyPhys | 4758 AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
4759 AcceptAllPhys; 4759 AcceptAllPhys;
4760 mc_filter[1] = mc_filter[0] = 0xffffffff; 4760 mc_filter[1] = mc_filter[0] = 0xffffffff;
4761 } else if ((dev->mc_count > multicast_filter_limit) || 4761 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
4762 (dev->flags & IFF_ALLMULTI)) { 4762 (dev->flags & IFF_ALLMULTI)) {
4763 /* Too many to filter perfectly -- accept all multicasts. */ 4763 /* Too many to filter perfectly -- accept all multicasts. */
4764 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; 4764 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
@@ -4769,7 +4769,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
4769 4769
4770 rx_mode = AcceptBroadcast | AcceptMyPhys; 4770 rx_mode = AcceptBroadcast | AcceptMyPhys;
4771 mc_filter[1] = mc_filter[0] = 0; 4771 mc_filter[1] = mc_filter[0] = 0;
4772 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 4772 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
4773 i++, mclist = mclist->next) { 4773 i++, mclist = mclist->next) {
4774 int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; 4774 int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
4775 mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); 4775 mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index d1664586e8ff..102be16e9b52 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -5055,8 +5055,8 @@ static void s2io_set_multicast(struct net_device *dev)
5055 } 5055 }
5056 5056
5057 /* Update individual M_CAST address list */ 5057 /* Update individual M_CAST address list */
5058 if ((!sp->m_cast_flg) && dev->mc_count) { 5058 if ((!sp->m_cast_flg) && netdev_mc_count(dev)) {
5059 if (dev->mc_count > 5059 if (netdev_mc_count(dev) >
5060 (config->max_mc_addr - config->max_mac_addr)) { 5060 (config->max_mc_addr - config->max_mac_addr)) {
5061 DBG_PRINT(ERR_DBG, 5061 DBG_PRINT(ERR_DBG,
5062 "%s: No more Rx filters can be added - " 5062 "%s: No more Rx filters can be added - "
@@ -5066,7 +5066,7 @@ static void s2io_set_multicast(struct net_device *dev)
5066 } 5066 }
5067 5067
5068 prev_cnt = sp->mc_addr_count; 5068 prev_cnt = sp->mc_addr_count;
5069 sp->mc_addr_count = dev->mc_count; 5069 sp->mc_addr_count = netdev_mc_count(dev);
5070 5070
5071 /* Clear out the previous list of Mc in the H/W. */ 5071 /* Clear out the previous list of Mc in the H/W. */
5072 for (i = 0; i < prev_cnt; i++) { 5072 for (i = 0; i < prev_cnt; i++) {
@@ -5092,7 +5092,7 @@ 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 < dev->mc_count; 5095 for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev);
5096 i++, mclist = mclist->next) { 5096 i++, mclist = mclist->next) {
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);
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index fd8cb506a2bb..00ff8995ad69 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -429,7 +429,7 @@ static void _sc92031_set_mar(struct net_device *dev)
429 u32 mar0 = 0, mar1 = 0; 429 u32 mar0 = 0, mar1 = 0;
430 430
431 if ((dev->flags & IFF_PROMISC) || 431 if ((dev->flags & IFF_PROMISC) ||
432 dev->mc_count > multicast_filter_limit || 432 netdev_mc_count(dev) > multicast_filter_limit ||
433 (dev->flags & IFF_ALLMULTI)) 433 (dev->flags & IFF_ALLMULTI))
434 mar0 = mar1 = 0xffffffff; 434 mar0 = mar1 = 0xffffffff;
435 else if (dev->flags & IFF_MULTICAST) { 435 else if (dev->flags & IFF_MULTICAST) {
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 62d5cd51a9dd..fafaf30ecd9a 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1615,7 +1615,7 @@ static void efx_set_multicast_list(struct net_device *net_dev)
1615 memset(mc_hash, 0xff, sizeof(*mc_hash)); 1615 memset(mc_hash, 0xff, sizeof(*mc_hash));
1616 } else { 1616 } else {
1617 memset(mc_hash, 0x00, sizeof(*mc_hash)); 1617 memset(mc_hash, 0x00, sizeof(*mc_hash));
1618 for (i = 0; i < net_dev->mc_count; i++) { 1618 for (i = 0; i < netdev_mc_count(net_dev); i++) {
1619 crc = ether_crc_le(ETH_ALEN, mc_list->dmi_addr); 1619 crc = ether_crc_le(ETH_ALEN, mc_list->dmi_addr);
1620 bit = crc & (EFX_MCAST_HASH_ENTRIES - 1); 1620 bit = crc & (EFX_MCAST_HASH_ENTRIES - 1);
1621 set_bit_le(bit, mc_hash->byte); 1621 set_bit_le(bit, mc_hash->byte);
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index 6b364a6c6c60..ed999d31f1fa 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -660,7 +660,7 @@ static void sgiseeq_set_multicast(struct net_device *dev)
660 660
661 if(dev->flags & IFF_PROMISC) 661 if(dev->flags & IFF_PROMISC)
662 sp->mode = SEEQ_RCMD_RANY; 662 sp->mode = SEEQ_RCMD_RANY;
663 else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count) 663 else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev))
664 sp->mode = SEEQ_RCMD_RBMCAST; 664 sp->mode = SEEQ_RCMD_RBMCAST;
665 else 665 else
666 sp->mode = SEEQ_RCMD_RBCAST; 666 sp->mode = SEEQ_RCMD_RBCAST;
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index 626de766443a..8c4e38f9ebf7 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -841,7 +841,7 @@ static void sis190_set_rx_mode(struct net_device *dev)
841 AcceptBroadcast | AcceptMulticast | AcceptMyPhys | 841 AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
842 AcceptAllPhys; 842 AcceptAllPhys;
843 mc_filter[1] = mc_filter[0] = 0xffffffff; 843 mc_filter[1] = mc_filter[0] = 0xffffffff;
844 } else if ((dev->mc_count > multicast_filter_limit) || 844 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
845 (dev->flags & IFF_ALLMULTI)) { 845 (dev->flags & IFF_ALLMULTI)) {
846 /* Too many to filter perfectly -- accept all multicasts. */ 846 /* Too many to filter perfectly -- accept all multicasts. */
847 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; 847 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
@@ -852,7 +852,7 @@ static void sis190_set_rx_mode(struct net_device *dev)
852 852
853 rx_mode = AcceptBroadcast | AcceptMyPhys; 853 rx_mode = AcceptBroadcast | AcceptMyPhys;
854 mc_filter[1] = mc_filter[0] = 0; 854 mc_filter[1] = mc_filter[0] = 0;
855 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 855 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
856 i++, mclist = mclist->next) { 856 i++, mclist = mclist->next) {
857 int bit_nr = 857 int bit_nr =
858 ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3f; 858 ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3f;
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 20c5ce474891..32ae87c09f5e 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -2288,7 +2288,7 @@ static void set_rx_mode(struct net_device *net_dev)
2288 rx_mode = RFPromiscuous; 2288 rx_mode = RFPromiscuous;
2289 for (i = 0; i < table_entries; i++) 2289 for (i = 0; i < table_entries; i++)
2290 mc_filter[i] = 0xffff; 2290 mc_filter[i] = 0xffff;
2291 } else if ((net_dev->mc_count > multicast_filter_limit) || 2291 } else if ((netdev_mc_count(net_dev) > multicast_filter_limit) ||
2292 (net_dev->flags & IFF_ALLMULTI)) { 2292 (net_dev->flags & IFF_ALLMULTI)) {
2293 /* too many multicast addresses or accept all multicast packet */ 2293 /* too many multicast addresses or accept all multicast packet */
2294 rx_mode = RFAAB | RFAAM; 2294 rx_mode = RFAAB | RFAAM;
@@ -2301,7 +2301,7 @@ static void set_rx_mode(struct net_device *net_dev)
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 for (i = 0, mclist = net_dev->mc_list;
2304 mclist && i < net_dev->mc_count; 2304 mclist && i < netdev_mc_count(net_dev);
2305 i++, mclist = mclist->next) { 2305 i++, mclist = mclist->next) {
2306 unsigned int bit_nr = 2306 unsigned int bit_nr =
2307 sis900_mcast_bitnr(mclist->dmi_addr, sis_priv->chipset_rev); 2307 sis900_mcast_bitnr(mclist->dmi_addr, sis_priv->chipset_rev);
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 6b955a4f19b2..346adfae986f 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -872,14 +872,14 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
872 if (dev->flags & IFF_ALLMULTI) { 872 if (dev->flags & IFF_ALLMULTI) {
873 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI); 873 mac_drv_rx_mode(smc, RX_ENABLE_ALLMULTI);
874 pr_debug(KERN_INFO "ENABLE ALL MC ADDRESSES\n"); 874 pr_debug(KERN_INFO "ENABLE ALL MC ADDRESSES\n");
875 } else if (dev->mc_count > 0) { 875 } else if (!netdev_mc_empty(dev)) {
876 if (dev->mc_count <= FPMAX_MULTICAST) { 876 if (netdev_mc_count(dev) <= FPMAX_MULTICAST) {
877 /* use exact filtering */ 877 /* use exact filtering */
878 878
879 // point to first multicast addr 879 // point to first multicast addr
880 dmi = dev->mc_list; 880 dmi = dev->mc_list;
881 881
882 for (i = 0; i < dev->mc_count; i++) { 882 for (i = 0; i < netdev_mc_count(dev); i++) {
883 mac_add_multicast(smc, 883 mac_add_multicast(smc,
884 (struct fddi_addr *)dmi->dmi_addr, 884 (struct fddi_addr *)dmi->dmi_addr,
885 1); 885 1);
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 5ff46eb18d0c..36ead52dea71 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2932,7 +2932,7 @@ static void genesis_set_multicast(struct net_device *dev)
2932 struct skge_port *skge = netdev_priv(dev); 2932 struct skge_port *skge = netdev_priv(dev);
2933 struct skge_hw *hw = skge->hw; 2933 struct skge_hw *hw = skge->hw;
2934 int port = skge->port; 2934 int port = skge->port;
2935 int i, count = dev->mc_count; 2935 int i, count = netdev_mc_count(dev);
2936 struct dev_mc_list *list = dev->mc_list; 2936 struct dev_mc_list *list = dev->mc_list;
2937 u32 mode; 2937 u32 mode;
2938 u8 filter[8]; 2938 u8 filter[8];
@@ -2987,7 +2987,7 @@ static void yukon_set_multicast(struct net_device *dev)
2987 reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); 2987 reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
2988 else if (dev->flags & IFF_ALLMULTI) /* all multicast */ 2988 else if (dev->flags & IFF_ALLMULTI) /* all multicast */
2989 memset(filter, 0xff, sizeof(filter)); 2989 memset(filter, 0xff, sizeof(filter));
2990 else if (dev->mc_count == 0 && !rx_pause)/* no multicast */ 2990 else if (netdev_mc_empty(dev) && !rx_pause)/* no multicast */
2991 reg &= ~GM_RXCR_MCF_ENA; 2991 reg &= ~GM_RXCR_MCF_ENA;
2992 else { 2992 else {
2993 int i; 2993 int i;
@@ -2996,7 +2996,7 @@ static void yukon_set_multicast(struct net_device *dev)
2996 if (rx_pause) 2996 if (rx_pause)
2997 yukon_add_filter(filter, pause_mc_addr); 2997 yukon_add_filter(filter, pause_mc_addr);
2998 2998
2999 for (i = 0; list && i < dev->mc_count; i++, list = list->next) 2999 for (i = 0; list && i < netdev_mc_count(dev); i++, list = list->next)
3000 yukon_add_filter(filter, list->dmi_addr); 3000 yukon_add_filter(filter, list->dmi_addr);
3001 } 3001 }
3002 3002
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 478288b8bc21..45299d663498 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3626,7 +3626,7 @@ static void sky2_set_multicast(struct net_device *dev)
3626 reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); 3626 reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
3627 else if (dev->flags & IFF_ALLMULTI) 3627 else if (dev->flags & IFF_ALLMULTI)
3628 memset(filter, 0xff, sizeof(filter)); 3628 memset(filter, 0xff, sizeof(filter));
3629 else if (dev->mc_count == 0 && !rx_pause) 3629 else if (netdev_mc_empty(dev) && !rx_pause)
3630 reg &= ~GM_RXCR_MCF_ENA; 3630 reg &= ~GM_RXCR_MCF_ENA;
3631 else { 3631 else {
3632 int i; 3632 int i;
@@ -3635,7 +3635,7 @@ static void sky2_set_multicast(struct net_device *dev)
3635 if (rx_pause) 3635 if (rx_pause)
3636 sky2_add_filter(filter, pause_mc_addr); 3636 sky2_add_filter(filter, pause_mc_addr);
3637 3637
3638 for (i = 0; list && i < dev->mc_count; i++, list = list->next) 3638 for (i = 0; list && i < netdev_mc_count(dev); i++, list = list->next)
3639 sky2_add_filter(filter, list->dmi_addr); 3639 sky2_add_filter(filter, list->dmi_addr);
3640 } 3640 }
3641 3641
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 3c5a4f52345c..ef9674c6713f 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -1323,7 +1323,7 @@ static void smc911x_set_multicast_list(struct net_device *dev)
1323 * I don't need to zero the multicast table, because the flag is 1323 * I don't need to zero the multicast table, because the flag is
1324 * checked before the table is 1324 * checked before the table is
1325 */ 1325 */
1326 else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) { 1326 else if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) > 16) {
1327 DBG(SMC_DEBUG_MISC, "%s: RCR_ALMUL\n", dev->name); 1327 DBG(SMC_DEBUG_MISC, "%s: RCR_ALMUL\n", dev->name);
1328 mcr |= MAC_CR_MCPAS_; 1328 mcr |= MAC_CR_MCPAS_;
1329 } 1329 }
@@ -1340,7 +1340,7 @@ static void smc911x_set_multicast_list(struct net_device *dev)
1340 * the number of the 32 bit register, while the low 5 bits are the bit 1340 * the number of the 32 bit register, while the low 5 bits are the bit
1341 * within that register. 1341 * within that register.
1342 */ 1342 */
1343 else if (dev->mc_count) { 1343 else if (!netdev_mc_empty(dev)) {
1344 int i; 1344 int i;
1345 struct dev_mc_list *cur_addr; 1345 struct dev_mc_list *cur_addr;
1346 1346
@@ -1351,7 +1351,7 @@ static void smc911x_set_multicast_list(struct net_device *dev)
1351 memset(multicast_table, 0, sizeof(multicast_table)); 1351 memset(multicast_table, 0, sizeof(multicast_table));
1352 1352
1353 cur_addr = dev->mc_list; 1353 cur_addr = dev->mc_list;
1354 for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) { 1354 for (i = 0; i < netdev_mc_count(dev); i++, cur_addr = cur_addr->next) {
1355 u32 position; 1355 u32 position;
1356 1356
1357 /* do we have a pointer here? */ 1357 /* do we have a pointer here? */
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c
index 8371b82323ac..41c3dddeab50 100644
--- a/drivers/net/smc9194.c
+++ b/drivers/net/smc9194.c
@@ -1542,7 +1542,7 @@ static void smc_set_multicast_list(struct net_device *dev)
1542 /* We just get all multicast packets even if we only want them 1542 /* We just get all multicast packets even if we only want them
1543 . from one source. This will be changed at some future 1543 . from one source. This will be changed at some future
1544 . point. */ 1544 . point. */
1545 else if (dev->mc_count ) { 1545 else if (!netdev_mc_empty(dev)) {
1546 /* support hardware multicasting */ 1546 /* support hardware multicasting */
1547 1547
1548 /* be sure I get rid of flags I might have set */ 1548 /* be sure I get rid of flags I might have set */
@@ -1550,7 +1550,7 @@ static void smc_set_multicast_list(struct net_device *dev)
1550 ioaddr + RCR ); 1550 ioaddr + RCR );
1551 /* NOTE: this has to set the bank, so make sure it is the 1551 /* NOTE: this has to set the bank, so make sure it is the
1552 last thing called. The bank is set to zero at the top */ 1552 last thing called. The bank is set to zero at the top */
1553 smc_setmulticast( ioaddr, dev->mc_count, dev->mc_list ); 1553 smc_setmulticast(ioaddr, netdev_mc_count(dev), dev->mc_list);
1554 } 1554 }
1555 else { 1555 else {
1556 outw( inw( ioaddr + RCR ) & ~(RCR_PROMISC | RCR_ALMUL), 1556 outw( inw( ioaddr + RCR ) & ~(RCR_PROMISC | RCR_ALMUL),
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index ea4fae79d6ec..66450127c5a1 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1395,7 +1395,7 @@ static void smc_set_multicast_list(struct net_device *dev)
1395 * I don't need to zero the multicast table, because the flag is 1395 * I don't need to zero the multicast table, because the flag is
1396 * checked before the table is 1396 * checked before the table is
1397 */ 1397 */
1398 else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) { 1398 else if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) > 16) {
1399 DBG(2, "%s: RCR_ALMUL\n", dev->name); 1399 DBG(2, "%s: RCR_ALMUL\n", dev->name);
1400 lp->rcr_cur_mode |= RCR_ALMUL; 1400 lp->rcr_cur_mode |= RCR_ALMUL;
1401 } 1401 }
@@ -1412,7 +1412,7 @@ static void smc_set_multicast_list(struct net_device *dev)
1412 * the number of the 8 bit register, while the low 3 bits are the bit 1412 * the number of the 8 bit register, while the low 3 bits are the bit
1413 * within that register. 1413 * within that register.
1414 */ 1414 */
1415 else if (dev->mc_count) { 1415 else if (!netdev_mc_empty(dev)) {
1416 int i; 1416 int i;
1417 struct dev_mc_list *cur_addr; 1417 struct dev_mc_list *cur_addr;
1418 1418
@@ -1423,7 +1423,7 @@ static void smc_set_multicast_list(struct net_device *dev)
1423 memset(multicast_table, 0, sizeof(multicast_table)); 1423 memset(multicast_table, 0, sizeof(multicast_table));
1424 1424
1425 cur_addr = dev->mc_list; 1425 cur_addr = dev->mc_list;
1426 for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) { 1426 for (i = 0; i < netdev_mc_count(dev); i++, cur_addr = cur_addr->next) {
1427 int position; 1427 int position;
1428 1428
1429 /* do we have a pointer here? */ 1429 /* do we have a pointer here? */
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 494cd91ea39c..3c1f9aa84cf5 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1383,7 +1383,7 @@ static void smsc911x_set_multicast_list(struct net_device *dev)
1383 pdata->clear_bits_mask = (MAC_CR_PRMS_ | MAC_CR_HPFILT_); 1383 pdata->clear_bits_mask = (MAC_CR_PRMS_ | MAC_CR_HPFILT_);
1384 pdata->hashhi = 0; 1384 pdata->hashhi = 0;
1385 pdata->hashlo = 0; 1385 pdata->hashlo = 0;
1386 } else if (dev->mc_count > 0) { 1386 } else if (!netdev_mc_empty(dev)) {
1387 /* Enabling specific multicast addresses */ 1387 /* Enabling specific multicast addresses */
1388 unsigned int hash_high = 0; 1388 unsigned int hash_high = 0;
1389 unsigned int hash_low = 0; 1389 unsigned int hash_low = 0;
@@ -1408,7 +1408,7 @@ static void smsc911x_set_multicast_list(struct net_device *dev)
1408 } 1408 }
1409 mc_list = mc_list->next; 1409 mc_list = mc_list->next;
1410 } 1410 }
1411 if (count != (unsigned int)dev->mc_count) 1411 if (count != (unsigned int)netdev_mc_count(dev))
1412 SMSC_WARNING(DRV, "mc_count != dev->mc_count"); 1412 SMSC_WARNING(DRV, "mc_count != dev->mc_count");
1413 1413
1414 pdata->hashhi = hash_high; 1414 pdata->hashhi = hash_high;
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index 1495a5dd4b46..2bd3c986559a 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -1062,7 +1062,7 @@ static void smsc9420_set_multicast_list(struct net_device *dev)
1062 mac_cr &= (~MAC_CR_PRMS_); 1062 mac_cr &= (~MAC_CR_PRMS_);
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 (dev->mc_count > 0) { 1065 } else if (!netdev_mc_empty(dev)) {
1066 struct dev_mc_list *mc_list = dev->mc_list; 1066 struct dev_mc_list *mc_list = dev->mc_list;
1067 u32 hash_lo = 0, hash_hi = 0; 1067 u32 hash_lo = 0, hash_hi = 0;
1068 1068
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c
index 9599ce77ef85..bd8bc66f2e00 100644
--- a/drivers/net/sonic.c
+++ b/drivers/net/sonic.c
@@ -541,13 +541,15 @@ static void sonic_multicast_list(struct net_device *dev)
541 if (dev->flags & IFF_PROMISC) { /* set promiscuous mode */ 541 if (dev->flags & IFF_PROMISC) { /* set promiscuous mode */
542 rcr |= SONIC_RCR_PRO; 542 rcr |= SONIC_RCR_PRO;
543 } else { 543 } else {
544 if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 15)) { 544 if ((dev->flags & IFF_ALLMULTI) ||
545 (netdev_mc_count(dev) > 15)) {
545 rcr |= SONIC_RCR_AMC; 546 rcr |= SONIC_RCR_AMC;
546 } else { 547 } else {
547 if (sonic_debug > 2) 548 if (sonic_debug > 2)
548 printk("sonic_multicast_list: mc_count %d\n", dev->mc_count); 549 printk("sonic_multicast_list: mc_count %d\n",
550 netdev_mc_count(dev));
549 sonic_set_cam_enable(dev, 1); /* always enable our own address */ 551 sonic_set_cam_enable(dev, 1); /* always enable our own address */
550 for (i = 1; i <= dev->mc_count; i++) { 552 for (i = 1; i <= netdev_mc_count(dev); i++) {
551 addr = dmi->dmi_addr; 553 addr = dmi->dmi_addr;
552 dmi = dmi->next; 554 dmi = dmi->next;
553 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]);
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index d0556a9b456c..58bc7ac086cf 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1796,15 +1796,15 @@ static void set_rx_mode(struct net_device *dev)
1796 1796
1797 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1797 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1798 rx_mode |= AcceptAll; 1798 rx_mode |= AcceptAll;
1799 } else if ((dev->mc_count > multicast_filter_limit) || 1799 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1800 (dev->flags & IFF_ALLMULTI)) { 1800 (dev->flags & IFF_ALLMULTI)) {
1801 /* Too many to match, or accept all multicasts. */ 1801 /* Too many to match, or accept all multicasts. */
1802 rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter; 1802 rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter;
1803 } else if (dev->mc_count <= 14) { 1803 } else if (netdev_mc_count(dev) <= 14) {
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 < dev->mc_count + 2; 1807 for (i = 2, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev) + 2;
1808 i++, mclist = mclist->next) { 1808 i++, mclist = mclist->next) {
1809 eaddrs = (__be16 *)mclist->dmi_addr; 1809 eaddrs = (__be16 *)mclist->dmi_addr;
1810 writew(be16_to_cpu(eaddrs[2]), filter_addr); filter_addr += 4; 1810 writew(be16_to_cpu(eaddrs[2]), filter_addr); filter_addr += 4;
@@ -1825,7 +1825,7 @@ static void set_rx_mode(struct net_device *dev)
1825 __le16 mc_filter[32] __attribute__ ((aligned(sizeof(long)))); /* Multicast hash filter */ 1825 __le16 mc_filter[32] __attribute__ ((aligned(sizeof(long)))); /* Multicast hash filter */
1826 1826
1827 memset(mc_filter, 0, sizeof(mc_filter)); 1827 memset(mc_filter, 0, sizeof(mc_filter));
1828 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1828 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1829 i++, mclist = mclist->next) { 1829 i++, mclist = mclist->next) {
1830 /* The chip uses the upper 9 CRC bits 1830 /* The chip uses the upper 9 CRC bits
1831 as index into the hash table */ 1831 as index into the hash table */
diff --git a/drivers/net/stmmac/dwmac100.c b/drivers/net/stmmac/dwmac100.c
index ac48ed787040..576b256ee388 100644
--- a/drivers/net/stmmac/dwmac100.c
+++ b/drivers/net/stmmac/dwmac100.c
@@ -305,13 +305,13 @@ static void dwmac100_set_filter(struct net_device *dev)
305 value |= MAC_CONTROL_PR; 305 value |= MAC_CONTROL_PR;
306 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_IF | MAC_CONTROL_HO | 306 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_IF | MAC_CONTROL_HO |
307 MAC_CONTROL_HP); 307 MAC_CONTROL_HP);
308 } else if ((dev->mc_count > HASH_TABLE_SIZE) 308 } else if ((netdev_mc_count(dev) > HASH_TABLE_SIZE)
309 || (dev->flags & IFF_ALLMULTI)) { 309 || (dev->flags & IFF_ALLMULTI)) {
310 value |= MAC_CONTROL_PM; 310 value |= MAC_CONTROL_PM;
311 value &= ~(MAC_CONTROL_PR | MAC_CONTROL_IF | MAC_CONTROL_HO); 311 value &= ~(MAC_CONTROL_PR | MAC_CONTROL_IF | MAC_CONTROL_HO);
312 writel(0xffffffff, ioaddr + MAC_HASH_HIGH); 312 writel(0xffffffff, ioaddr + MAC_HASH_HIGH);
313 writel(0xffffffff, ioaddr + MAC_HASH_LOW); 313 writel(0xffffffff, ioaddr + MAC_HASH_LOW);
314 } else if (dev->mc_count == 0) { /* no multicast */ 314 } else if (netdev_mc_empty(dev)) { /* no multicast */
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 {
@@ -327,7 +327,7 @@ static void dwmac100_set_filter(struct net_device *dev)
327 327
328 memset(mc_filter, 0, sizeof(mc_filter)); 328 memset(mc_filter, 0, sizeof(mc_filter));
329 for (i = 0, mclist = dev->mc_list; 329 for (i = 0, mclist = dev->mc_list;
330 mclist && i < dev->mc_count; i++, mclist = mclist->next) { 330 mclist && i < netdev_mc_count(dev); i++, mclist = mclist->next) {
331 /* The upper 6 bits of the calculated CRC are used to 331 /* The upper 6 bits of the calculated CRC are used to
332 * index the contens of the hash table */ 332 * index the contens of the hash table */
333 int bit_nr = 333 int bit_nr =
diff --git a/drivers/net/stmmac/dwmac1000_core.c b/drivers/net/stmmac/dwmac1000_core.c
index d812e9cdb3db..90dbb4f41ef3 100644
--- a/drivers/net/stmmac/dwmac1000_core.c
+++ b/drivers/net/stmmac/dwmac1000_core.c
@@ -83,16 +83,16 @@ static void dwmac1000_set_filter(struct net_device *dev)
83 unsigned int value = 0; 83 unsigned int value = 0;
84 84
85 DBG(KERN_INFO "%s: # mcasts %d, # unicast %d\n", 85 DBG(KERN_INFO "%s: # mcasts %d, # unicast %d\n",
86 __func__, dev->mc_count, netdev_uc_count(dev)); 86 __func__, netdev_mc_count(dev), netdev_uc_count(dev));
87 87
88 if (dev->flags & IFF_PROMISC) 88 if (dev->flags & IFF_PROMISC)
89 value = GMAC_FRAME_FILTER_PR; 89 value = GMAC_FRAME_FILTER_PR;
90 else if ((dev->mc_count > HASH_TABLE_SIZE) 90 else if ((netdev_mc_count(dev) > HASH_TABLE_SIZE)
91 || (dev->flags & IFF_ALLMULTI)) { 91 || (dev->flags & IFF_ALLMULTI)) {
92 value = GMAC_FRAME_FILTER_PM; /* pass all multi */ 92 value = GMAC_FRAME_FILTER_PM; /* pass all multi */
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 (dev->mc_count > 0) { 95 } else if (!netdev_mc_empty(dev)) {
96 int i; 96 int i;
97 u32 mc_filter[2]; 97 u32 mc_filter[2];
98 struct dev_mc_list *mclist; 98 struct dev_mc_list *mclist;
@@ -102,7 +102,7 @@ static void dwmac1000_set_filter(struct net_device *dev)
102 102
103 memset(mc_filter, 0, sizeof(mc_filter)); 103 memset(mc_filter, 0, sizeof(mc_filter));
104 for (i = 0, mclist = dev->mc_list; 104 for (i = 0, mclist = dev->mc_list;
105 mclist && i < dev->mc_count; i++, mclist = mclist->next) { 105 mclist && i < netdev_mc_count(dev); i++, mclist = mclist->next) {
106 /* The upper 6 bits of the calculated CRC are used to 106 /* The upper 6 bits of the calculated CRC are used to
107 index the contens of the hash table */ 107 index the contens of the hash table */
108 int bit_nr = 108 int bit_nr =
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c
index b447a8719427..efedc252e4be 100644
--- a/drivers/net/sun3_82586.c
+++ b/drivers/net/sun3_82586.c
@@ -414,7 +414,7 @@ static int init586(struct net_device *dev)
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=dev->mc_list;
417 int num_addrs=dev->mc_count; 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));
420 420
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
index 0ca4241b4f63..99998862c22e 100644
--- a/drivers/net/sun3lance.c
+++ b/drivers/net/sun3lance.c
@@ -917,7 +917,7 @@ static void set_multicast_list( struct net_device *dev )
917 REGA( CSR15 ) = 0x8000; /* Set promiscuous mode */ 917 REGA( CSR15 ) = 0x8000; /* Set promiscuous mode */
918 } else { 918 } else {
919 short multicast_table[4]; 919 short multicast_table[4];
920 int num_addrs = dev->mc_count; 920 int num_addrs = netdev_mc_count(dev);
921 int i; 921 int i;
922 /* We don't use the multicast table, but rely on upper-layer 922 /* We don't use the multicast table, but rely on upper-layer
923 * filtering. */ 923 * filtering. */
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 25e81ebd9cd8..dfea56fa39e3 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -1013,7 +1013,7 @@ static void bigmac_set_multicast(struct net_device *dev)
1013 while ((sbus_readl(bregs + BMAC_RXCFG) & BIGMAC_RXCFG_ENABLE) != 0) 1013 while ((sbus_readl(bregs + BMAC_RXCFG) & BIGMAC_RXCFG_ENABLE) != 0)
1014 udelay(20); 1014 udelay(20);
1015 1015
1016 if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) { 1016 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
1017 sbus_writel(0xffff, bregs + BMAC_HTABLE0); 1017 sbus_writel(0xffff, bregs + BMAC_HTABLE0);
1018 sbus_writel(0xffff, bregs + BMAC_HTABLE1); 1018 sbus_writel(0xffff, bregs + BMAC_HTABLE1);
1019 sbus_writel(0xffff, bregs + BMAC_HTABLE2); 1019 sbus_writel(0xffff, bregs + BMAC_HTABLE2);
@@ -1028,7 +1028,7 @@ 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 < dev->mc_count; i++) { 1031 for (i = 0; i < netdev_mc_count(dev); i++) {
1032 addrs = dmi->dmi_addr; 1032 addrs = dmi->dmi_addr;
1033 dmi = dmi->next; 1033 dmi = dmi->next;
1034 1034
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 0c972e560cf3..4171259590b2 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1517,18 +1517,18 @@ static void set_rx_mode(struct net_device *dev)
1517 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1517 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1518 memset(mc_filter, 0xff, sizeof(mc_filter)); 1518 memset(mc_filter, 0xff, sizeof(mc_filter));
1519 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys; 1519 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys;
1520 } else if ((dev->mc_count > multicast_filter_limit) || 1520 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1521 (dev->flags & IFF_ALLMULTI)) { 1521 (dev->flags & IFF_ALLMULTI)) {
1522 /* Too many to match, or accept all multicasts. */ 1522 /* Too many to match, or accept all multicasts. */
1523 memset(mc_filter, 0xff, sizeof(mc_filter)); 1523 memset(mc_filter, 0xff, sizeof(mc_filter));
1524 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1524 rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
1525 } else if (dev->mc_count) { 1525 } else if (!netdev_mc_empty(dev)) {
1526 struct dev_mc_list *mclist; 1526 struct dev_mc_list *mclist;
1527 int bit; 1527 int bit;
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 < dev->mc_count; 1531 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1532 i++, mclist = mclist->next) { 1532 i++, mclist = mclist->next) {
1533 crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr); 1533 crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr);
1534 for (index=0, bit=0; bit < 6; bit++, crc <<= 1) 1534 for (index=0, bit=0; bit < 6; bit++, crc <<= 1)
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index b55ceb88d93f..d497ec053953 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1837,7 +1837,7 @@ static u32 gem_setup_multicast(struct gem *gp)
1837 int i; 1837 int i;
1838 1838
1839 if ((gp->dev->flags & IFF_ALLMULTI) || 1839 if ((gp->dev->flags & IFF_ALLMULTI) ||
1840 (gp->dev->mc_count > 256)) { 1840 (netdev_mc_count(gp->dev) > 256)) {
1841 for (i=0; i<16; i++) 1841 for (i=0; i<16; i++)
1842 writel(0xffff, gp->regs + MAC_HASH0 + (i << 2)); 1842 writel(0xffff, gp->regs + MAC_HASH0 + (i << 2));
1843 rxcfg |= MAC_RXCFG_HFE; 1843 rxcfg |= MAC_RXCFG_HFE;
@@ -1852,7 +1852,7 @@ static u32 gem_setup_multicast(struct gem *gp)
1852 for (i = 0; i < 16; i++) 1852 for (i = 0; i < 16; i++)
1853 hash_table[i] = 0; 1853 hash_table[i] = 0;
1854 1854
1855 for (i = 0; i < gp->dev->mc_count; i++) { 1855 for (i = 0; i < netdev_mc_count(gp->dev); i++) {
1856 char *addrs = dmi->dmi_addr; 1856 char *addrs = dmi->dmi_addr;
1857 1857
1858 dmi = dmi->next; 1858 dmi = dmi->next;
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 76ccd31cbf50..905df35ff78a 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -1516,7 +1516,7 @@ static int happy_meal_init(struct happy_meal *hp)
1516 1516
1517 HMD(("htable, ")); 1517 HMD(("htable, "));
1518 if ((hp->dev->flags & IFF_ALLMULTI) || 1518 if ((hp->dev->flags & IFF_ALLMULTI) ||
1519 (hp->dev->mc_count > 64)) { 1519 (netdev_mc_count(hp->dev) > 64)) {
1520 hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); 1520 hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff);
1521 hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); 1521 hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff);
1522 hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); 1522 hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff);
@@ -1531,7 +1531,7 @@ static int happy_meal_init(struct happy_meal *hp)
1531 for (i = 0; i < 4; i++) 1531 for (i = 0; i < 4; i++)
1532 hash_table[i] = 0; 1532 hash_table[i] = 0;
1533 1533
1534 for (i = 0; i < hp->dev->mc_count; i++) { 1534 for (i = 0; i < netdev_mc_count(hp->dev); i++) {
1535 addrs = dmi->dmi_addr; 1535 addrs = dmi->dmi_addr;
1536 dmi = dmi->next; 1536 dmi = dmi->next;
1537 1537
@@ -2373,7 +2373,7 @@ static void happy_meal_set_multicast(struct net_device *dev)
2373 2373
2374 spin_lock_irq(&hp->happy_lock); 2374 spin_lock_irq(&hp->happy_lock);
2375 2375
2376 if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) { 2376 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
2377 hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); 2377 hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff);
2378 hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); 2378 hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff);
2379 hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); 2379 hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff);
@@ -2387,7 +2387,7 @@ static void happy_meal_set_multicast(struct net_device *dev)
2387 for (i = 0; i < 4; i++) 2387 for (i = 0; i < 4; i++)
2388 hash_table[i] = 0; 2388 hash_table[i] = 0;
2389 2389
2390 for (i = 0; i < dev->mc_count; i++) { 2390 for (i = 0; i < netdev_mc_count(dev); i++) {
2391 addrs = dmi->dmi_addr; 2391 addrs = dmi->dmi_addr;
2392 dmi = dmi->next; 2392 dmi = dmi->next;
2393 2393
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 64e7d08c878f..cf9d5bb9e1e9 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1196,7 +1196,7 @@ static void lance_load_multicast(struct net_device *dev)
1196 return; 1196 return;
1197 1197
1198 /* Add addresses */ 1198 /* Add addresses */
1199 for (i = 0; i < dev->mc_count; i++) { 1199 for (i = 0; i < netdev_mc_count(dev); i++) {
1200 addrs = dmi->dmi_addr; 1200 addrs = dmi->dmi_addr;
1201 dmi = dmi->next; 1201 dmi = dmi->next;
1202 1202
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 45c383f285ee..3bc35d86ed66 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -636,7 +636,7 @@ static void qe_set_multicast(struct net_device *dev)
636 /* Lock out others. */ 636 /* Lock out others. */
637 netif_stop_queue(dev); 637 netif_stop_queue(dev);
638 638
639 if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) { 639 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
640 sbus_writeb(MREGS_IACONFIG_ACHNGE | MREGS_IACONFIG_LARESET, 640 sbus_writeb(MREGS_IACONFIG_ACHNGE | MREGS_IACONFIG_LARESET,
641 qep->mregs + MREGS_IACONFIG); 641 qep->mregs + MREGS_IACONFIG);
642 while ((sbus_readb(qep->mregs + MREGS_IACONFIG) & MREGS_IACONFIG_ACHNGE) != 0) 642 while ((sbus_readb(qep->mregs + MREGS_IACONFIG) & MREGS_IACONFIG_ACHNGE) != 0)
@@ -653,7 +653,7 @@ static void qe_set_multicast(struct net_device *dev)
653 for (i = 0; i < 4; i++) 653 for (i = 0; i < 4; i++)
654 hash_table[i] = 0; 654 hash_table[i] = 0;
655 655
656 for (i = 0; i < dev->mc_count; i++) { 656 for (i = 0; i < netdev_mc_count(dev); i++) {
657 addrs = dmi->dmi_addr; 657 addrs = dmi->dmi_addr;
658 dmi = dmi->next; 658 dmi = dmi->next;
659 659
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 033408f589fb..d838d4015c63 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -1941,18 +1941,18 @@ tc35815_set_multicast_list(struct net_device *dev)
1941 /* Enable promiscuous mode */ 1941 /* Enable promiscuous mode */
1942 tc_writel(CAM_CompEn | CAM_BroadAcc | CAM_GroupAcc | CAM_StationAcc, &tr->CAM_Ctl); 1942 tc_writel(CAM_CompEn | CAM_BroadAcc | CAM_GroupAcc | CAM_StationAcc, &tr->CAM_Ctl);
1943 } else if ((dev->flags & IFF_ALLMULTI) || 1943 } else if ((dev->flags & IFF_ALLMULTI) ||
1944 dev->mc_count > CAM_ENTRY_MAX - 3) { 1944 netdev_mc_count(dev) > CAM_ENTRY_MAX - 3) {
1945 /* CAM 0, 1, 20 are reserved. */ 1945 /* CAM 0, 1, 20 are reserved. */
1946 /* Disable promiscuous mode, use normal mode. */ 1946 /* Disable promiscuous mode, use normal mode. */
1947 tc_writel(CAM_CompEn | CAM_BroadAcc | CAM_GroupAcc, &tr->CAM_Ctl); 1947 tc_writel(CAM_CompEn | CAM_BroadAcc | CAM_GroupAcc, &tr->CAM_Ctl);
1948 } else if (dev->mc_count) { 1948 } else if (!netdev_mc_empty(dev)) {
1949 struct dev_mc_list *cur_addr = dev->mc_list; 1949 struct dev_mc_list *cur_addr = dev->mc_list;
1950 int i; 1950 int i;
1951 int ena_bits = CAM_Ena_Bit(CAM_ENTRY_SOURCE); 1951 int ena_bits = CAM_Ena_Bit(CAM_ENTRY_SOURCE);
1952 1952
1953 tc_writel(0, &tr->CAM_Ctl); 1953 tc_writel(0, &tr->CAM_Ctl);
1954 /* Walk the address list, and load the filter */ 1954 /* Walk the address list, and load the filter */
1955 for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) { 1955 for (i = 0; i < netdev_mc_count(dev); i++, cur_addr = cur_addr->next) {
1956 if (!cur_addr) 1956 if (!cur_addr)
1957 break; 1957 break;
1958 /* entry 0,1 is reserved. */ 1958 /* entry 0,1 is reserved. */
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index b907bee31fd5..ab9b0280317e 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -808,7 +808,7 @@ static void bdx_setmulti(struct net_device *ndev)
808 /* set IMF to accept all multicast frmaes */ 808 /* set IMF to accept all multicast frmaes */
809 for (i = 0; i < MAC_MCST_HASH_NUM; i++) 809 for (i = 0; i < MAC_MCST_HASH_NUM; i++)
810 WRITE_REG(priv, regRX_MCST_HASH0 + i * 4, ~0); 810 WRITE_REG(priv, regRX_MCST_HASH0 + i * 4, ~0);
811 } else if (ndev->mc_count) { 811 } else if (!netdev_mc_empty(ndev)) {
812 u8 hash; 812 u8 hash;
813 struct dev_mc_list *mclist; 813 struct dev_mc_list *mclist;
814 u32 reg, val; 814 u32 reg, val;
@@ -840,7 +840,7 @@ static void bdx_setmulti(struct net_device *ndev)
840 } 840 }
841 841
842 } else { 842 } else {
843 DBG("only own mac %d\n", ndev->mc_count); 843 DBG("only own mac %d\n", netdev_mc_count(ndev));
844 rxf_val |= GMAC_RX_FILTER_AB; 844 rxf_val |= GMAC_RX_FILTER_AB;
845 } 845 }
846 WRITE_REG(priv, regGMAC_RXF_A, rxf_val); 846 WRITE_REG(priv, regGMAC_RXF_A, rxf_val);
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 7195bdec17f3..d29282f01c23 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9430,7 +9430,7 @@ static void __tg3_set_rx_mode(struct net_device *dev)
9430 } else if (dev->flags & IFF_ALLMULTI) { 9430 } else if (dev->flags & IFF_ALLMULTI) {
9431 /* Accept all multicast. */ 9431 /* Accept all multicast. */
9432 tg3_set_multi (tp, 1); 9432 tg3_set_multi (tp, 1);
9433 } else if (dev->mc_count < 1) { 9433 } else if (netdev_mc_empty(dev)) {
9434 /* Reject all multicast. */ 9434 /* Reject all multicast. */
9435 tg3_set_multi (tp, 0); 9435 tg3_set_multi (tp, 0);
9436 } else { 9436 } else {
@@ -9442,7 +9442,7 @@ static void __tg3_set_rx_mode(struct net_device *dev)
9442 u32 bit; 9442 u32 bit;
9443 u32 crc; 9443 u32 crc;
9444 9444
9445 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 9445 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
9446 i++, mclist = mclist->next) { 9446 i++, mclist = mclist->next) {
9447 9447
9448 crc = calc_crc (mclist->dmi_addr, ETH_ALEN); 9448 crc = calc_crc (mclist->dmi_addr, ETH_ALEN);
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 3ec31dce99f9..e44d5a074c69 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -1335,7 +1335,7 @@ static void TLan_SetMulticastList( struct net_device *dev )
1335 TLan_DioWrite32( dev->base_addr, TLAN_HASH_1, 0xFFFFFFFF ); 1335 TLan_DioWrite32( dev->base_addr, TLAN_HASH_1, 0xFFFFFFFF );
1336 TLan_DioWrite32( dev->base_addr, TLAN_HASH_2, 0xFFFFFFFF ); 1336 TLan_DioWrite32( dev->base_addr, TLAN_HASH_2, 0xFFFFFFFF );
1337 } else { 1337 } else {
1338 for ( i = 0; i < dev->mc_count; i++ ) { 1338 for ( i = 0; i < netdev_mc_count(dev); i++ ) {
1339 if ( i < 3 ) { 1339 if ( i < 3 ) {
1340 TLan_SetMac( dev, i + 1, 1340 TLan_SetMac( dev, i + 1,
1341 (char *) &dmi->dmi_addr ); 1341 (char *) &dmi->dmi_addr );
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index b0d7db9d8bb4..eff68e1d107b 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -1408,7 +1408,7 @@ static void xl_set_rx_mode(struct net_device *dev)
1408 1408
1409 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 1409 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ;
1410 1410
1411 for (i=0,dmi=dev->mc_list;i < dev->mc_count; i++,dmi = dmi->next) { 1411 for (i=0,dmi=dev->mc_list;i < netdev_mc_count(dev); i++,dmi = dmi->next) {
1412 dev_mc_address[0] |= dmi->dmi_addr[2] ; 1412 dev_mc_address[0] |= dmi->dmi_addr[2] ;
1413 dev_mc_address[1] |= dmi->dmi_addr[3] ; 1413 dev_mc_address[1] |= dmi->dmi_addr[3] ;
1414 dev_mc_address[2] |= dmi->dmi_addr[4] ; 1414 dev_mc_address[2] |= dmi->dmi_addr[4] ;
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 66272f2a0758..1ce8f85a89aa 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -996,7 +996,7 @@ static void tok_set_multicast_list(struct net_device *dev)
996 if (/*BMSHELPdev->start == 0 ||*/ ti->open_status != OPEN) return; 996 if (/*BMSHELPdev->start == 0 ||*/ ti->open_status != OPEN) return;
997 address[0] = address[1] = address[2] = address[3] = 0; 997 address[0] = address[1] = address[2] = address[3] = 0;
998 mclist = dev->mc_list; 998 mclist = dev->mc_list;
999 for (i = 0; i < dev->mc_count; i++) { 999 for (i = 0; i < netdev_mc_count(dev); i++) {
1000 address[0] |= mclist->dmi_addr[2]; 1000 address[0] |= mclist->dmi_addr[2];
1001 address[1] |= mclist->dmi_addr[3]; 1001 address[1] |= mclist->dmi_addr[3];
1002 address[2] |= mclist->dmi_addr[4]; 1002 address[2] |= mclist->dmi_addr[4];
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 3f9d5a25562e..26d84daf660b 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -1303,7 +1303,7 @@ static void streamer_set_rx_mode(struct net_device *dev)
1303 writel(streamer_priv->srb,streamer_mmio+LAPA); 1303 writel(streamer_priv->srb,streamer_mmio+LAPA);
1304 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 1304 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ;
1305 1305
1306 for (i=0,dmi=dev->mc_list;i < dev->mc_count; i++,dmi = dmi->next) 1306 for (i=0,dmi=dev->mc_list;i < netdev_mc_count(dev); i++,dmi = dmi->next)
1307 { 1307 {
1308 dev_mc_address[0] |= dmi->dmi_addr[2] ; 1308 dev_mc_address[0] |= dmi->dmi_addr[2] ;
1309 dev_mc_address[1] |= dmi->dmi_addr[3] ; 1309 dev_mc_address[1] |= dmi->dmi_addr[3] ;
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index f010a4dc5f19..a242d125b34c 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -1178,7 +1178,7 @@ static void olympic_set_rx_mode(struct net_device *dev)
1178 1178
1179 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ; 1179 dev_mc_address[0] = dev_mc_address[1] = dev_mc_address[2] = dev_mc_address[3] = 0 ;
1180 1180
1181 for (i=0,dmi=dev->mc_list;i < dev->mc_count; i++,dmi = dmi->next) { 1181 for (i=0,dmi=dev->mc_list;i < netdev_mc_count(dev); i++,dmi = dmi->next) {
1182 dev_mc_address[0] |= dmi->dmi_addr[2] ; 1182 dev_mc_address[0] |= dmi->dmi_addr[2] ;
1183 dev_mc_address[1] |= dmi->dmi_addr[3] ; 1183 dev_mc_address[1] |= dmi->dmi_addr[3] ;
1184 dev_mc_address[2] |= dmi->dmi_addr[4] ; 1184 dev_mc_address[2] |= dmi->dmi_addr[4] ;
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index e3c42f5ac4a9..6b8868959b85 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -1214,7 +1214,7 @@ static void tms380tr_set_multicast_list(struct net_device *dev)
1214 { 1214 {
1215 int i; 1215 int i;
1216 struct dev_mc_list *mclist = dev->mc_list; 1216 struct dev_mc_list *mclist = dev->mc_list;
1217 for (i=0; i< dev->mc_count; i++) 1217 for (i=0; i< netdev_mc_count(dev); i++)
1218 { 1218 {
1219 ((char *)(&tp->ocpl.FunctAddr))[0] |= 1219 ((char *)(&tp->ocpl.FunctAddr))[0] |=
1220 mclist->dmi_addr[2]; 1220 mclist->dmi_addr[2];
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index a69c4a48bab9..f4b30c4826fb 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -1184,7 +1184,7 @@ static void tsi108_set_rx_mode(struct net_device *dev)
1184 1184
1185 rxcfg &= ~(TSI108_EC_RXCFG_UFE | TSI108_EC_RXCFG_MFE); 1185 rxcfg &= ~(TSI108_EC_RXCFG_UFE | TSI108_EC_RXCFG_MFE);
1186 1186
1187 if (dev->flags & IFF_ALLMULTI || dev->mc_count) { 1187 if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev)) {
1188 int i; 1188 int i;
1189 struct dev_mc_list *mc = dev->mc_list; 1189 struct dev_mc_list *mc = dev->mc_list;
1190 rxcfg |= TSI108_EC_RXCFG_MFE | TSI108_EC_RXCFG_MC_HASH; 1190 rxcfg |= TSI108_EC_RXCFG_MFE | TSI108_EC_RXCFG_MC_HASH;
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 29330209ad8b..a4cff23dcdf9 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -677,7 +677,7 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
677 memset(hash_table, 0, sizeof(hash_table)); 677 memset(hash_table, 0, sizeof(hash_table));
678 set_bit_le(255, hash_table); /* Broadcast entry */ 678 set_bit_le(255, hash_table); /* Broadcast entry */
679 /* This should work on big-endian machines as well. */ 679 /* This should work on big-endian machines as well. */
680 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 680 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
681 i++, mclist = mclist->next) { 681 i++, mclist = mclist->next) {
682 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 682 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff;
683 683
@@ -706,7 +706,7 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
706 706
707 /* We have <= 14 addresses so we can use the wonderful 707 /* We have <= 14 addresses so we can use the wonderful
708 16 address perfect filtering of the Tulip. */ 708 16 address perfect filtering of the Tulip. */
709 for (i = 0, mclist = dev->mc_list; i < dev->mc_count; 709 for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev);
710 i++, mclist = mclist->next) { 710 i++, mclist = mclist->next) {
711 eaddrs = (u16 *)mclist->dmi_addr; 711 eaddrs = (u16 *)mclist->dmi_addr;
712 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 712 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
@@ -741,7 +741,7 @@ static void __de_set_rx_mode (struct net_device *dev)
741 goto out; 741 goto out;
742 } 742 }
743 743
744 if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) { 744 if ((netdev_mc_count(dev) > 1000) || (dev->flags & IFF_ALLMULTI)) {
745 /* Too many to filter well -- accept all multicasts. */ 745 /* Too many to filter well -- accept all multicasts. */
746 macmode |= AcceptAllMulticast; 746 macmode |= AcceptAllMulticast;
747 goto out; 747 goto out;
@@ -749,7 +749,7 @@ static void __de_set_rx_mode (struct net_device *dev)
749 749
750 /* Note that only the low-address shortword of setup_frame is valid! 750 /* Note that only the low-address shortword of setup_frame is valid!
751 The values are doubled for big-endian architectures. */ 751 The values are doubled for big-endian architectures. */
752 if (dev->mc_count > 14) /* Must use a multicast hash table. */ 752 if (netdev_mc_count(dev) > 14) /* Must use a multicast hash table. */
753 build_setup_frame_hash (de->setup_frame, dev); 753 build_setup_frame_hash (de->setup_frame, dev);
754 else 754 else
755 build_setup_frame_perfect (de->setup_frame, dev); 755 build_setup_frame_perfect (de->setup_frame, dev);
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index a8349b7200b5..0b6a9731091c 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1963,10 +1963,10 @@ SetMulticastFilter(struct net_device *dev)
1963 omr &= ~(OMR_PR | OMR_PM); 1963 omr &= ~(OMR_PR | OMR_PM);
1964 pa = build_setup_frame(dev, ALL); /* Build the basic frame */ 1964 pa = build_setup_frame(dev, ALL); /* Build the basic frame */
1965 1965
1966 if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 14)) { 1966 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 14)) {
1967 omr |= OMR_PM; /* Pass all multicasts */ 1967 omr |= OMR_PM; /* Pass all multicasts */
1968 } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */ 1968 } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */
1969 for (i=0;i<dev->mc_count;i++) { /* for each address in the list */ 1969 for (i = 0; i < netdev_mc_count(dev) ;i++) {
1970 addrs=dmi->dmi_addr; 1970 addrs=dmi->dmi_addr;
1971 dmi=dmi->next; 1971 dmi=dmi->next;
1972 if ((*addrs & 0x01) == 1) { /* multicast address? */ 1972 if ((*addrs & 0x01) == 1) { /* multicast address? */
@@ -1984,7 +1984,7 @@ SetMulticastFilter(struct net_device *dev)
1984 } 1984 }
1985 } 1985 }
1986 } else { /* Perfect filtering */ 1986 } else { /* Perfect filtering */
1987 for (j=0; j<dev->mc_count; j++) { 1987 for (j=0; j<netdev_mc_count(dev); j++) {
1988 addrs=dmi->dmi_addr; 1988 addrs=dmi->dmi_addr;
1989 dmi=dmi->next; 1989 dmi=dmi->next;
1990 for (i=0; i<ETH_ALEN; i++) { 1990 for (i=0; i<ETH_ALEN; i++) {
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 5fc61c1012e5..534afbdb9c91 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -658,9 +658,9 @@ static void dmfe_init_dm910x(struct DEVICE *dev)
658 658
659 /* Send setup frame */ 659 /* Send setup frame */
660 if (db->chip_id == PCI_DM9132_ID) 660 if (db->chip_id == PCI_DM9132_ID)
661 dm9132_id_table(dev, dev->mc_count); /* DM9132 */ 661 dm9132_id_table(dev, netdev_mc_count(dev)); /* DM9132 */
662 else 662 else
663 send_filter_frame(dev, dev->mc_count); /* DM9102/DM9102A */ 663 send_filter_frame(dev, netdev_mc_count(dev)); /* DM9102/DM9102A */
664 664
665 /* Init CR7, interrupt active bit */ 665 /* Init CR7, interrupt active bit */
666 db->cr7_data = CR7_DEFAULT; 666 db->cr7_data = CR7_DEFAULT;
@@ -1052,6 +1052,7 @@ static void dmfe_set_filter_mode(struct DEVICE * dev)
1052{ 1052{
1053 struct dmfe_board_info *db = netdev_priv(dev); 1053 struct dmfe_board_info *db = netdev_priv(dev);
1054 unsigned long flags; 1054 unsigned long flags;
1055 int mc_count = netdev_mc_count(dev);
1055 1056
1056 DMFE_DBUG(0, "dmfe_set_filter_mode()", 0); 1057 DMFE_DBUG(0, "dmfe_set_filter_mode()", 0);
1057 spin_lock_irqsave(&db->lock, flags); 1058 spin_lock_irqsave(&db->lock, flags);
@@ -1064,19 +1065,19 @@ static void dmfe_set_filter_mode(struct DEVICE * dev)
1064 return; 1065 return;
1065 } 1066 }
1066 1067
1067 if (dev->flags & IFF_ALLMULTI || dev->mc_count > DMFE_MAX_MULTICAST) { 1068 if (dev->flags & IFF_ALLMULTI || mc_count > DMFE_MAX_MULTICAST) {
1068 DMFE_DBUG(0, "Pass all multicast address", dev->mc_count); 1069 DMFE_DBUG(0, "Pass all multicast address", mc_count);
1069 db->cr6_data &= ~(CR6_PM | CR6_PBF); 1070 db->cr6_data &= ~(CR6_PM | CR6_PBF);
1070 db->cr6_data |= CR6_PAM; 1071 db->cr6_data |= CR6_PAM;
1071 spin_unlock_irqrestore(&db->lock, flags); 1072 spin_unlock_irqrestore(&db->lock, flags);
1072 return; 1073 return;
1073 } 1074 }
1074 1075
1075 DMFE_DBUG(0, "Set multicast address", dev->mc_count); 1076 DMFE_DBUG(0, "Set multicast address", mc_count);
1076 if (db->chip_id == PCI_DM9132_ID) 1077 if (db->chip_id == PCI_DM9132_ID)
1077 dm9132_id_table(dev, dev->mc_count); /* DM9132 */ 1078 dm9132_id_table(dev, mc_count); /* DM9132 */
1078 else 1079 else
1079 send_filter_frame(dev, dev->mc_count); /* DM9102/DM9102A */ 1080 send_filter_frame(dev, mc_count); /* DM9102/DM9102A */
1080 spin_unlock_irqrestore(&db->lock, flags); 1081 spin_unlock_irqrestore(&db->lock, flags);
1081} 1082}
1082 1083
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index e1a5f03a49c5..cce2ada07950 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -997,7 +997,7 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
997 memset(hash_table, 0, sizeof(hash_table)); 997 memset(hash_table, 0, sizeof(hash_table));
998 set_bit_le(255, hash_table); /* Broadcast entry */ 998 set_bit_le(255, hash_table); /* Broadcast entry */
999 /* This should work on big-endian machines as well. */ 999 /* This should work on big-endian machines as well. */
1000 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1000 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1001 i++, mclist = mclist->next) { 1001 i++, mclist = mclist->next) {
1002 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 1002 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff;
1003 1003
@@ -1026,7 +1026,7 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
1026 1026
1027 /* We have <= 14 addresses so we can use the wonderful 1027 /* We have <= 14 addresses so we can use the wonderful
1028 16 address perfect filtering of the Tulip. */ 1028 16 address perfect filtering of the Tulip. */
1029 for (i = 0, mclist = dev->mc_list; i < dev->mc_count; 1029 for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev);
1030 i++, mclist = mclist->next) { 1030 i++, mclist = mclist->next) {
1031 eaddrs = (u16 *)mclist->dmi_addr; 1031 eaddrs = (u16 *)mclist->dmi_addr;
1032 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 1032 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
@@ -1057,7 +1057,8 @@ static void set_rx_mode(struct net_device *dev)
1057 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1057 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1058 tp->csr6 |= AcceptAllMulticast | AcceptAllPhys; 1058 tp->csr6 |= AcceptAllMulticast | AcceptAllPhys;
1059 csr6 |= AcceptAllMulticast | AcceptAllPhys; 1059 csr6 |= AcceptAllMulticast | AcceptAllPhys;
1060 } else if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) { 1060 } else if ((netdev_mc_count(dev) > 1000) ||
1061 (dev->flags & IFF_ALLMULTI)) {
1061 /* Too many to filter well -- accept all multicasts. */ 1062 /* Too many to filter well -- accept all multicasts. */
1062 tp->csr6 |= AcceptAllMulticast; 1063 tp->csr6 |= AcceptAllMulticast;
1063 csr6 |= AcceptAllMulticast; 1064 csr6 |= AcceptAllMulticast;
@@ -1066,14 +1067,16 @@ static void set_rx_mode(struct net_device *dev)
1066 /* Should verify correctness on big-endian/__powerpc__ */ 1067 /* Should verify correctness on big-endian/__powerpc__ */
1067 struct dev_mc_list *mclist; 1068 struct dev_mc_list *mclist;
1068 int i; 1069 int i;
1069 if (dev->mc_count > 64) { /* Arbitrary non-effective limit. */ 1070 if (netdev_mc_count(dev) > 64) {
1071 /* Arbitrary non-effective limit. */
1070 tp->csr6 |= AcceptAllMulticast; 1072 tp->csr6 |= AcceptAllMulticast;
1071 csr6 |= AcceptAllMulticast; 1073 csr6 |= AcceptAllMulticast;
1072 } else { 1074 } else {
1073 u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */ 1075 u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */
1074 int filterbit; 1076 int filterbit;
1075 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1077 for (i = 0, mclist = dev->mc_list;
1076 i++, mclist = mclist->next) { 1078 mclist && i < netdev_mc_count(dev);
1079 i++, mclist = mclist->next) {
1077 if (tp->flags & COMET_MAC_ADDR) 1080 if (tp->flags & COMET_MAC_ADDR)
1078 filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr); 1081 filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr);
1079 else 1082 else
@@ -1107,7 +1110,8 @@ static void set_rx_mode(struct net_device *dev)
1107 1110
1108 /* Note that only the low-address shortword of setup_frame is valid! 1111 /* Note that only the low-address shortword of setup_frame is valid!
1109 The values are doubled for big-endian architectures. */ 1112 The values are doubled for big-endian architectures. */
1110 if (dev->mc_count > 14) { /* Must use a multicast hash table. */ 1113 if (netdev_mc_count(dev) > 14) {
1114 /* Must use a multicast hash table. */
1111 build_setup_frame_hash(tp->setup_frame, dev); 1115 build_setup_frame_hash(tp->setup_frame, dev);
1112 tx_flags = 0x08400000 | 192; 1116 tx_flags = 0x08400000 | 192;
1113 } else { 1117 } else {
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index dc3335d906f6..216ceb322ed4 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -557,7 +557,7 @@ static void uli526x_init(struct net_device *dev)
557 update_cr6(db->cr6_data, ioaddr); 557 update_cr6(db->cr6_data, ioaddr);
558 558
559 /* Send setup frame */ 559 /* Send setup frame */
560 send_filter_frame(dev, dev->mc_count); /* M5261/M5263 */ 560 send_filter_frame(dev, netdev_mc_count(dev)); /* M5261/M5263 */
561 561
562 /* Init CR7, interrupt active bit */ 562 /* Init CR7, interrupt active bit */
563 db->cr7_data = CR7_DEFAULT; 563 db->cr7_data = CR7_DEFAULT;
@@ -906,16 +906,18 @@ static void uli526x_set_filter_mode(struct net_device * dev)
906 return; 906 return;
907 } 907 }
908 908
909 if (dev->flags & IFF_ALLMULTI || dev->mc_count > ULI5261_MAX_MULTICAST) { 909 if (dev->flags & IFF_ALLMULTI ||
910 ULI526X_DBUG(0, "Pass all multicast address", dev->mc_count); 910 netdev_mc_count(dev) > ULI5261_MAX_MULTICAST) {
911 ULI526X_DBUG(0, "Pass all multicast address",
912 netdev_mc_count(dev));
911 db->cr6_data &= ~(CR6_PM | CR6_PBF); 913 db->cr6_data &= ~(CR6_PM | CR6_PBF);
912 db->cr6_data |= CR6_PAM; 914 db->cr6_data |= CR6_PAM;
913 spin_unlock_irqrestore(&db->lock, flags); 915 spin_unlock_irqrestore(&db->lock, flags);
914 return; 916 return;
915 } 917 }
916 918
917 ULI526X_DBUG(0, "Set multicast address", dev->mc_count); 919 ULI526X_DBUG(0, "Set multicast address", netdev_mc_count(dev));
918 send_filter_frame(dev, dev->mc_count); /* M5261/M5263 */ 920 send_filter_frame(dev, netdev_mc_count(dev)); /* M5261/M5263 */
919 spin_unlock_irqrestore(&db->lock, flags); 921 spin_unlock_irqrestore(&db->lock, flags);
920} 922}
921 923
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 9fb89afccf7c..98711a9f35ac 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -1361,7 +1361,7 @@ static u32 __set_rx_mode(struct net_device *dev)
1361 memset(mc_filter, 0xff, sizeof(mc_filter)); 1361 memset(mc_filter, 0xff, sizeof(mc_filter));
1362 rx_mode = RxAcceptBroadcast | AcceptMulticast | RxAcceptAllPhys 1362 rx_mode = RxAcceptBroadcast | AcceptMulticast | RxAcceptAllPhys
1363 | AcceptMyPhys; 1363 | AcceptMyPhys;
1364 } else if ((dev->mc_count > multicast_filter_limit) || 1364 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1365 (dev->flags & IFF_ALLMULTI)) { 1365 (dev->flags & IFF_ALLMULTI)) {
1366 /* Too many to match, or accept all multicasts. */ 1366 /* Too many to match, or accept all multicasts. */
1367 memset(mc_filter, 0xff, sizeof(mc_filter)); 1367 memset(mc_filter, 0xff, sizeof(mc_filter));
@@ -1370,8 +1370,9 @@ static u32 __set_rx_mode(struct net_device *dev)
1370 struct dev_mc_list *mclist; 1370 struct dev_mc_list *mclist;
1371 int i; 1371 int i;
1372 memset(mc_filter, 0, sizeof(mc_filter)); 1372 memset(mc_filter, 0, sizeof(mc_filter));
1373 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1373 for (i = 0, mclist = dev->mc_list;
1374 i++, mclist = mclist->next) { 1374 mclist && i < netdev_mc_count(dev);
1375 i++, mclist = mclist->next) {
1375 int filterbit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F; 1376 int filterbit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F;
1376 filterbit &= 0x3f; 1377 filterbit &= 0x3f;
1377 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); 1378 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31);
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 6e4f754c4baf..edabc49a49bc 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -924,17 +924,18 @@ typhoon_set_rx_mode(struct net_device *dev)
924 filter = TYPHOON_RX_FILTER_DIRECTED | TYPHOON_RX_FILTER_BROADCAST; 924 filter = TYPHOON_RX_FILTER_DIRECTED | TYPHOON_RX_FILTER_BROADCAST;
925 if(dev->flags & IFF_PROMISC) { 925 if(dev->flags & IFF_PROMISC) {
926 filter |= TYPHOON_RX_FILTER_PROMISCOUS; 926 filter |= TYPHOON_RX_FILTER_PROMISCOUS;
927 } else if((dev->mc_count > multicast_filter_limit) || 927 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
928 (dev->flags & IFF_ALLMULTI)) { 928 (dev->flags & IFF_ALLMULTI)) {
929 /* Too many to match, or accept all multicasts. */ 929 /* Too many to match, or accept all multicasts. */
930 filter |= TYPHOON_RX_FILTER_ALL_MCAST; 930 filter |= TYPHOON_RX_FILTER_ALL_MCAST;
931 } else if(dev->mc_count) { 931 } else if (!netdev_mc_empty(dev)) {
932 struct dev_mc_list *mclist; 932 struct dev_mc_list *mclist;
933 int i; 933 int i;
934 934
935 memset(mc_filter, 0, sizeof(mc_filter)); 935 memset(mc_filter, 0, sizeof(mc_filter));
936 for(i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 936 for (i = 0, mclist = dev->mc_list;
937 i++, mclist = mclist->next) { 937 mclist && i < netdev_mc_count(dev);
938 i++, mclist = mclist->next) {
938 int bit = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3f; 939 int bit = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3f;
939 mc_filter[bit >> 5] |= 1 << (bit & 0x1f); 940 mc_filter[bit >> 5] |= 1 << (bit & 0x1f);
940 } 941 }
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 225f65812f2e..a05720289c7e 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2031,7 +2031,8 @@ static void ucc_geth_set_multi(struct net_device *dev)
2031 2031
2032 dmi = dev->mc_list; 2032 dmi = dev->mc_list;
2033 2033
2034 for (i = 0; i < dev->mc_count; i++, dmi = dmi->next) { 2034 for (i = 0; i < netdev_mc_count(dev);
2035 i++, dmi = dmi->next) {
2035 2036
2036 /* Only support group multicast for now. 2037 /* Only support group multicast for now.
2037 */ 2038 */
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index a516185cbc9f..f02551713b13 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -542,9 +542,9 @@ static void asix_set_multicast(struct net_device *net)
542 if (net->flags & IFF_PROMISC) { 542 if (net->flags & IFF_PROMISC) {
543 rx_ctl |= AX_RX_CTL_PRO; 543 rx_ctl |= AX_RX_CTL_PRO;
544 } else if (net->flags & IFF_ALLMULTI || 544 } else if (net->flags & IFF_ALLMULTI ||
545 net->mc_count > AX_MAX_MCAST) { 545 netdev_mc_count(net) > AX_MAX_MCAST) {
546 rx_ctl |= AX_RX_CTL_AMALL; 546 rx_ctl |= AX_RX_CTL_AMALL;
547 } else if (net->mc_count == 0) { 547 } else if (netdev_mc_empty(net)) {
548 /* just broadcast and directed */ 548 /* just broadcast and directed */
549 } else { 549 } else {
550 /* We use the 20 byte dev->data 550 /* We use the 20 byte dev->data
@@ -558,7 +558,7 @@ static void asix_set_multicast(struct net_device *net)
558 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); 558 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
559 559
560 /* Build the multicast hash filter. */ 560 /* Build the multicast hash filter. */
561 for (i = 0; i < net->mc_count; i++) { 561 for (i = 0; i < netdev_mc_count(net); i++) {
562 crc_bits = 562 crc_bits =
563 ether_crc(ETH_ALEN, 563 ether_crc(ETH_ALEN,
564 mc_list->dmi_addr) >> 26; 564 mc_list->dmi_addr) >> 26;
@@ -754,9 +754,9 @@ static void ax88172_set_multicast(struct net_device *net)
754 if (net->flags & IFF_PROMISC) { 754 if (net->flags & IFF_PROMISC) {
755 rx_ctl |= 0x01; 755 rx_ctl |= 0x01;
756 } else if (net->flags & IFF_ALLMULTI || 756 } else if (net->flags & IFF_ALLMULTI ||
757 net->mc_count > AX_MAX_MCAST) { 757 netdev_mc_count(net) > AX_MAX_MCAST) {
758 rx_ctl |= 0x02; 758 rx_ctl |= 0x02;
759 } else if (net->mc_count == 0) { 759 } else if (netdev_mc_empty(net)) {
760 /* just broadcast and directed */ 760 /* just broadcast and directed */
761 } else { 761 } else {
762 /* We use the 20 byte dev->data 762 /* We use the 20 byte dev->data
@@ -770,7 +770,7 @@ static void ax88172_set_multicast(struct net_device *net)
770 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); 770 memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
771 771
772 /* Build the multicast hash filter. */ 772 /* Build the multicast hash filter. */
773 for (i = 0; i < net->mc_count; i++) { 773 for (i = 0; i < netdev_mc_count(net); i++) {
774 crc_bits = 774 crc_bits =
775 ether_crc(ETH_ALEN, 775 ether_crc(ETH_ALEN,
776 mc_list->dmi_addr) >> 26; 776 mc_list->dmi_addr) >> 26;
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 7d3fa06980c1..5a13660ebd17 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -648,7 +648,9 @@ static void catc_set_multicast_list(struct net_device *netdev)
648 if (netdev->flags & IFF_ALLMULTI) { 648 if (netdev->flags & IFF_ALLMULTI) {
649 memset(catc->multicast, 0xff, 64); 649 memset(catc->multicast, 0xff, 64);
650 } else { 650 } else {
651 for (i = 0, mc = netdev->mc_list; mc && i < netdev->mc_count; i++, mc = mc->next) { 651 for (i = 0, mc = netdev->mc_list;
652 mc && i < netdev_mc_count(netdev);
653 i++, mc = mc->next) {
652 u32 crc = ether_crc_le(6, mc->dmi_addr); 654 u32 crc = ether_crc_le(6, mc->dmi_addr);
653 if (!catc->is_f5u011) { 655 if (!catc->is_f5u011) {
654 catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7); 656 catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c
index 55cf7081de10..9ab5c1983a7d 100644
--- a/drivers/net/usb/int51x1.c
+++ b/drivers/net/usb/int51x1.c
@@ -139,7 +139,7 @@ static void int51x1_set_multicast(struct net_device *netdev)
139 /* do not expect to see traffic of other PLCs */ 139 /* do not expect to see traffic of other PLCs */
140 filter |= PACKET_TYPE_PROMISCUOUS; 140 filter |= PACKET_TYPE_PROMISCUOUS;
141 devinfo(dev, "promiscuous mode enabled"); 141 devinfo(dev, "promiscuous mode enabled");
142 } else if (netdev->mc_count || 142 } else if (!netdev_mc_empty(netdev) ||
143 (netdev->flags & IFF_ALLMULTI)) { 143 (netdev->flags & IFF_ALLMULTI)) {
144 filter |= PACKET_TYPE_ALL_MULTICAST; 144 filter |= PACKET_TYPE_ALL_MULTICAST;
145 devdbg(dev, "receive all multicast enabled"); 145 devdbg(dev, "receive all multicast enabled");
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index f1d64ef67efa..52671ea043a7 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -881,7 +881,7 @@ static void kaweth_set_rx_mode(struct net_device *net)
881 if (net->flags & IFF_PROMISC) { 881 if (net->flags & IFF_PROMISC) {
882 packet_filter_bitmap |= KAWETH_PACKET_FILTER_PROMISCUOUS; 882 packet_filter_bitmap |= KAWETH_PACKET_FILTER_PROMISCUOUS;
883 } 883 }
884 else if ((net->mc_count) || (net->flags & IFF_ALLMULTI)) { 884 else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) {
885 packet_filter_bitmap |= KAWETH_PACKET_FILTER_ALL_MULTICAST; 885 packet_filter_bitmap |= KAWETH_PACKET_FILTER_ALL_MULTICAST;
886 } 886 }
887 887
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index 6fc098fe9ff7..34665137f2c3 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -443,9 +443,9 @@ static void mcs7830_data_set_multicast(struct net_device *net)
443 if (net->flags & IFF_PROMISC) { 443 if (net->flags & IFF_PROMISC) {
444 data->config |= HIF_REG_CONFIG_PROMISCUOUS; 444 data->config |= HIF_REG_CONFIG_PROMISCUOUS;
445 } else if (net->flags & IFF_ALLMULTI || 445 } else if (net->flags & IFF_ALLMULTI ||
446 net->mc_count > MCS7830_MAX_MCAST) { 446 netdev_mc_count(net) > MCS7830_MAX_MCAST) {
447 data->config |= HIF_REG_CONFIG_ALLMULTICAST; 447 data->config |= HIF_REG_CONFIG_ALLMULTICAST;
448 } else if (net->mc_count == 0) { 448 } else if (netdev_mc_empty(net)) {
449 /* just broadcast and directed */ 449 /* just broadcast and directed */
450 } else { 450 } else {
451 /* We use the 20 byte dev->data 451 /* We use the 20 byte dev->data
@@ -457,7 +457,7 @@ static void mcs7830_data_set_multicast(struct net_device *net)
457 int i; 457 int i;
458 458
459 /* Build the multicast hash filter. */ 459 /* Build the multicast hash filter. */
460 for (i = 0; i < net->mc_count; i++) { 460 for (i = 0; i < netdev_mc_count(net); i++) {
461 crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; 461 crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26;
462 data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7); 462 data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7);
463 mc_list = mc_list->next; 463 mc_list = mc_list->next;
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index ed4a508ef262..44ae8f6d3135 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -1232,7 +1232,7 @@ static void pegasus_set_multicast(struct net_device *net)
1232 pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; 1232 pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS;
1233 if (netif_msg_link(pegasus)) 1233 if (netif_msg_link(pegasus))
1234 pr_info("%s: Promiscuous mode enabled.\n", net->name); 1234 pr_info("%s: Promiscuous mode enabled.\n", net->name);
1235 } else if (net->mc_count || (net->flags & IFF_ALLMULTI)) { 1235 } else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) {
1236 pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; 1236 pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST;
1237 pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; 1237 pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS;
1238 if (netif_msg_link(pegasus)) 1238 if (netif_msg_link(pegasus))
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 21ac103fbb71..e85c89c6706d 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -711,7 +711,7 @@ static void rtl8150_set_multicast(struct net_device *netdev)
711 if (netdev->flags & IFF_PROMISC) { 711 if (netdev->flags & IFF_PROMISC) {
712 dev->rx_creg |= cpu_to_le16(0x0001); 712 dev->rx_creg |= cpu_to_le16(0x0001);
713 dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name); 713 dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name);
714 } else if (netdev->mc_count || 714 } else if (!netdev_mc_empty(netdev) ||
715 (netdev->flags & IFF_ALLMULTI)) { 715 (netdev->flags & IFF_ALLMULTI)) {
716 dev->rx_creg &= cpu_to_le16(0xfffe); 716 dev->rx_creg &= cpu_to_le16(0xfffe);
717 dev->rx_creg |= cpu_to_le16(0x0002); 717 dev->rx_creg |= cpu_to_le16(0x0002);
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 0c3c738d7419..48555d0e374d 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -384,7 +384,7 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
384 devdbg(dev, "receive all multicast enabled"); 384 devdbg(dev, "receive all multicast enabled");
385 pdata->mac_cr |= MAC_CR_MCPAS_; 385 pdata->mac_cr |= MAC_CR_MCPAS_;
386 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); 386 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
387 } else if (dev->net->mc_count > 0) { 387 } else if (!netdev_mc_empty(dev->net)) {
388 struct dev_mc_list *mc_list = dev->net->mc_list; 388 struct dev_mc_list *mc_list = dev->net->mc_list;
389 int count = 0; 389 int count = 0;
390 390
@@ -406,7 +406,7 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
406 mc_list = mc_list->next; 406 mc_list = mc_list->next;
407 } 407 }
408 408
409 if (count != ((u32)dev->net->mc_count)) 409 if (count != ((u32) netdev_mc_count(dev->net)))
410 devwarn(dev, "mc_count != dev->mc_count"); 410 devwarn(dev, "mc_count != dev->mc_count");
411 411
412 if (netif_msg_drv(dev)) 412 if (netif_msg_drv(dev))
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index a7e0c84426ea..85df7ac636b5 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -1697,7 +1697,7 @@ static void rhine_set_rx_mode(struct net_device *dev)
1697 rx_mode = 0x1C; 1697 rx_mode = 0x1C;
1698 iowrite32(0xffffffff, ioaddr + MulticastFilter0); 1698 iowrite32(0xffffffff, ioaddr + MulticastFilter0);
1699 iowrite32(0xffffffff, ioaddr + MulticastFilter1); 1699 iowrite32(0xffffffff, ioaddr + MulticastFilter1);
1700 } else if ((dev->mc_count > multicast_filter_limit) || 1700 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1701 (dev->flags & IFF_ALLMULTI)) { 1701 (dev->flags & IFF_ALLMULTI)) {
1702 /* Too many to match, or accept all multicasts. */ 1702 /* Too many to match, or accept all multicasts. */
1703 iowrite32(0xffffffff, ioaddr + MulticastFilter0); 1703 iowrite32(0xffffffff, ioaddr + MulticastFilter0);
@@ -1707,7 +1707,8 @@ static void rhine_set_rx_mode(struct net_device *dev)
1707 struct dev_mc_list *mclist; 1707 struct dev_mc_list *mclist;
1708 int i; 1708 int i;
1709 memset(mc_filter, 0, sizeof(mc_filter)); 1709 memset(mc_filter, 0, sizeof(mc_filter));
1710 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1710 for (i = 0, mclist = dev->mc_list;
1711 mclist && i < netdev_mc_count(dev);
1711 i++, mclist = mclist->next) { 1712 i++, mclist = mclist->next) {
1712 int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; 1713 int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
1713 1714
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index f15485efe40e..bdb19c3d6568 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -1132,7 +1132,7 @@ static void velocity_set_multi(struct net_device *dev)
1132 writel(0xffffffff, &regs->MARCAM[0]); 1132 writel(0xffffffff, &regs->MARCAM[0]);
1133 writel(0xffffffff, &regs->MARCAM[4]); 1133 writel(0xffffffff, &regs->MARCAM[4]);
1134 rx_mode = (RCR_AM | RCR_AB | RCR_PROM); 1134 rx_mode = (RCR_AM | RCR_AB | RCR_PROM);
1135 } else if ((dev->mc_count > vptr->multicast_limit) || 1135 } else if ((netdev_mc_count(dev) > vptr->multicast_limit) ||
1136 (dev->flags & IFF_ALLMULTI)) { 1136 (dev->flags & IFF_ALLMULTI)) {
1137 writel(0xffffffff, &regs->MARCAM[0]); 1137 writel(0xffffffff, &regs->MARCAM[0]);
1138 writel(0xffffffff, &regs->MARCAM[4]); 1138 writel(0xffffffff, &regs->MARCAM[4]);
@@ -1141,7 +1141,9 @@ static void velocity_set_multi(struct net_device *dev)
1141 int offset = MCAM_SIZE - vptr->multicast_limit; 1141 int offset = MCAM_SIZE - vptr->multicast_limit;
1142 mac_get_cam_mask(regs, vptr->mCAMmask); 1142 mac_get_cam_mask(regs, vptr->mCAMmask);
1143 1143
1144 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next) { 1144 for (i = 0, mclist = dev->mc_list;
1145 mclist && i < netdev_mc_count(dev);
1146 i++, mclist = mclist->next) {
1145 mac_set_cam(regs, i + offset, mclist->dmi_addr); 1147 mac_set_cam(regs, i + offset, mclist->dmi_addr);
1146 vptr->mCAMmask[(offset + i) / 8] |= 1 << ((offset + i) & 7); 1148 vptr->mCAMmask[(offset + i) / 8] |= 1 << ((offset + i) & 7);
1147 } 1149 }
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9d8984a3741c..4c347a3df657 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -735,6 +735,7 @@ static void virtnet_set_rx_mode(struct net_device *dev)
735 struct dev_addr_list *addr; 735 struct dev_addr_list *addr;
736 struct netdev_hw_addr *ha; 736 struct netdev_hw_addr *ha;
737 int uc_count; 737 int uc_count;
738 int mc_count;
738 void *buf; 739 void *buf;
739 int i; 740 int i;
740 741
@@ -762,9 +763,11 @@ static void virtnet_set_rx_mode(struct net_device *dev)
762 allmulti ? "en" : "dis"); 763 allmulti ? "en" : "dis");
763 764
764 uc_count = netdev_uc_count(dev); 765 uc_count = netdev_uc_count(dev);
766 mc_count = netdev_mc_count(dev);
765 /* MAC filter - use one buffer for both lists */ 767 /* MAC filter - use one buffer for both lists */
766 mac_data = buf = kzalloc(((uc_count + dev->mc_count) * ETH_ALEN) + 768 buf = kzalloc(((uc_count + mc_count) * ETH_ALEN) +
767 (2 * sizeof(mac_data->entries)), GFP_ATOMIC); 769 (2 * sizeof(mac_data->entries)), GFP_ATOMIC);
770 mac_data = buf;
768 if (!buf) { 771 if (!buf) {
769 dev_warn(&dev->dev, "No memory for MAC address buffer\n"); 772 dev_warn(&dev->dev, "No memory for MAC address buffer\n");
770 return; 773 return;
@@ -784,13 +787,13 @@ static void virtnet_set_rx_mode(struct net_device *dev)
784 /* multicast list and count fill the end */ 787 /* multicast list and count fill the end */
785 mac_data = (void *)&mac_data->macs[uc_count][0]; 788 mac_data = (void *)&mac_data->macs[uc_count][0];
786 789
787 mac_data->entries = dev->mc_count; 790 mac_data->entries = mc_count;
788 addr = dev->mc_list; 791 addr = dev->mc_list;
789 for (i = 0; i < dev->mc_count; i++, addr = addr->next) 792 for (i = 0; i < mc_count; i++, addr = addr->next)
790 memcpy(&mac_data->macs[i][0], addr->da_addr, ETH_ALEN); 793 memcpy(&mac_data->macs[i][0], addr->da_addr, ETH_ALEN);
791 794
792 sg_set_buf(&sg[1], mac_data, 795 sg_set_buf(&sg[1], mac_data,
793 sizeof(mac_data->entries) + (dev->mc_count * ETH_ALEN)); 796 sizeof(mac_data->entries) + (mc_count * ETH_ALEN));
794 797
795 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_MAC, 798 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_MAC,
796 VIRTIO_NET_CTRL_MAC_TABLE_SET, 799 VIRTIO_NET_CTRL_MAC_TABLE_SET,
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index b896f9386110..ee1b397417f3 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1668,7 +1668,7 @@ static u8 *
1668vmxnet3_copy_mc(struct net_device *netdev) 1668vmxnet3_copy_mc(struct net_device *netdev)
1669{ 1669{
1670 u8 *buf = NULL; 1670 u8 *buf = NULL;
1671 u32 sz = netdev->mc_count * ETH_ALEN; 1671 u32 sz = netdev_mc_count(netdev) * ETH_ALEN;
1672 1672
1673 /* struct Vmxnet3_RxFilterConf.mfTableLen is u16. */ 1673 /* struct Vmxnet3_RxFilterConf.mfTableLen is u16. */
1674 if (sz <= 0xffff) { 1674 if (sz <= 0xffff) {
@@ -1678,7 +1678,7 @@ vmxnet3_copy_mc(struct net_device *netdev)
1678 int i; 1678 int i;
1679 struct dev_mc_list *mc = netdev->mc_list; 1679 struct dev_mc_list *mc = netdev->mc_list;
1680 1680
1681 for (i = 0; i < netdev->mc_count; i++) { 1681 for (i = 0; i < netdev_mc_count(netdev); i++) {
1682 BUG_ON(!mc); 1682 BUG_ON(!mc);
1683 memcpy(buf + i * ETH_ALEN, mc->dmi_addr, 1683 memcpy(buf + i * ETH_ALEN, mc->dmi_addr,
1684 ETH_ALEN); 1684 ETH_ALEN);
@@ -1708,12 +1708,12 @@ vmxnet3_set_mc(struct net_device *netdev)
1708 if (netdev->flags & IFF_ALLMULTI) 1708 if (netdev->flags & IFF_ALLMULTI)
1709 new_mode |= VMXNET3_RXM_ALL_MULTI; 1709 new_mode |= VMXNET3_RXM_ALL_MULTI;
1710 else 1710 else
1711 if (netdev->mc_count > 0) { 1711 if (!netdev_mc_empty(netdev)) {
1712 new_table = vmxnet3_copy_mc(netdev); 1712 new_table = vmxnet3_copy_mc(netdev);
1713 if (new_table) { 1713 if (new_table) {
1714 new_mode |= VMXNET3_RXM_MCAST; 1714 new_mode |= VMXNET3_RXM_MCAST;
1715 rxConf->mfTableLen = cpu_to_le16( 1715 rxConf->mfTableLen = cpu_to_le16(
1716 netdev->mc_count * ETH_ALEN); 1716 netdev_mc_count(netdev) * ETH_ALEN);
1717 rxConf->mfTablePA = cpu_to_le64(virt_to_phys( 1717 rxConf->mfTablePA = cpu_to_le64(virt_to_phys(
1718 new_table)); 1718 new_table));
1719 } else { 1719 } else {
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index a6606b8948e9..c248b01218a1 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -1178,11 +1178,11 @@ static void vxge_set_multicast(struct net_device *dev)
1178 1178
1179 memset(&mac_info, 0, sizeof(struct macInfo)); 1179 memset(&mac_info, 0, sizeof(struct macInfo));
1180 /* Update individual M_CAST address list */ 1180 /* Update individual M_CAST address list */
1181 if ((!vdev->all_multi_flg) && dev->mc_count) { 1181 if ((!vdev->all_multi_flg) && netdev_mc_count(dev)) {
1182 1182
1183 mcast_cnt = vdev->vpaths[0].mcast_addr_cnt; 1183 mcast_cnt = vdev->vpaths[0].mcast_addr_cnt;
1184 list_head = &vdev->vpaths[0].mac_addr_list; 1184 list_head = &vdev->vpaths[0].mac_addr_list;
1185 if ((dev->mc_count + 1185 if ((netdev_mc_count(dev) +
1186 (vdev->vpaths[0].mac_addr_cnt - mcast_cnt)) > 1186 (vdev->vpaths[0].mac_addr_cnt - mcast_cnt)) >
1187 vdev->vpaths[0].max_mac_addr_cnt) 1187 vdev->vpaths[0].max_mac_addr_cnt)
1188 goto _set_all_mcast; 1188 goto _set_all_mcast;
@@ -1217,7 +1217,7 @@ static void vxge_set_multicast(struct net_device *dev)
1217 } 1217 }
1218 1218
1219 /* Add new ones */ 1219 /* Add new ones */
1220 for (i = 0, mclist = dev->mc_list; i < dev->mc_count; 1220 for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev);
1221 i++, mclist = mclist->next) { 1221 i++, mclist = mclist->next) {
1222 1222
1223 memcpy(mac_info.macaddr, mclist->dmi_addr, ETH_ALEN); 1223 memcpy(mac_info.macaddr, mclist->dmi_addr, ETH_ALEN);
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index ef6b78da370f..c22a34c7639c 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2310,7 +2310,7 @@ static void airo_set_multicast_list(struct net_device *dev) {
2310 airo_set_promisc(ai); 2310 airo_set_promisc(ai);
2311 } 2311 }
2312 2312
2313 if ((dev->flags&IFF_ALLMULTI)||dev->mc_count>0) { 2313 if ((dev->flags&IFF_ALLMULTI) || !netdev_mc_empty(dev)) {
2314 /* Turn on multicast. (Should be already setup...) */ 2314 /* Turn on multicast. (Should be already setup...) */
2315 } 2315 }
2316} 2316}
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 753a1804eee7..a9e9cea2d767 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -1668,12 +1668,12 @@ __orinoco_set_multicast_list(struct net_device *dev)
1668 /* The Hermes doesn't seem to have an allmulti mode, so we go 1668 /* The Hermes doesn't seem to have an allmulti mode, so we go
1669 * into promiscuous mode and let the upper levels deal. */ 1669 * into promiscuous mode and let the upper levels deal. */
1670 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) || 1670 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
1671 (dev->mc_count > MAX_MULTICAST(priv))) { 1671 (netdev_mc_count(dev) > MAX_MULTICAST(priv))) {
1672 promisc = 1; 1672 promisc = 1;
1673 mc_count = 0; 1673 mc_count = 0;
1674 } else { 1674 } else {
1675 promisc = 0; 1675 promisc = 0;
1676 mc_count = dev->mc_count; 1676 mc_count = netdev_mc_count(dev);
1677 } 1677 }
1678 1678
1679 err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count, 1679 err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count,
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 88e1e4e32b22..85905cab4f16 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -1950,7 +1950,7 @@ static void set_multicast_list(struct net_device *dev)
1950 if (dev->flags & IFF_ALLMULTI) 1950 if (dev->flags & IFF_ALLMULTI)
1951 ray_update_multi_list(dev, 1); 1951 ray_update_multi_list(dev, 1);
1952 else { 1952 else {
1953 if (local->num_multi != dev->mc_count) 1953 if (local->num_multi != netdev_mc_count(dev))
1954 ray_update_multi_list(dev, 0); 1954 ray_update_multi_list(dev, 0);
1955 } 1955 }
1956} /* end set_multicast_list */ 1956} /* end set_multicast_list */
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 305c106fdc1c..14692bc51b51 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1492,10 +1492,10 @@ static void set_multicast_list(struct usbnet *usbdev)
1492 filter |= RNDIS_PACKET_TYPE_PROMISCUOUS | 1492 filter |= RNDIS_PACKET_TYPE_PROMISCUOUS |
1493 RNDIS_PACKET_TYPE_ALL_LOCAL; 1493 RNDIS_PACKET_TYPE_ALL_LOCAL;
1494 } else if (usbdev->net->flags & IFF_ALLMULTI || 1494 } else if (usbdev->net->flags & IFF_ALLMULTI ||
1495 usbdev->net->mc_count > priv->multicast_size) { 1495 netdev_mc_count(usbdev->net) > priv->multicast_size) {
1496 filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; 1496 filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST;
1497 } else if (usbdev->net->mc_count > 0) { 1497 } else if (!netdev_mc_empty(usbdev->net)) {
1498 size = min(priv->multicast_size, usbdev->net->mc_count); 1498 size = min(priv->multicast_size, netdev_mc_count(usbdev->net));
1499 buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); 1499 buf = kmalloc(size * ETH_ALEN, GFP_KERNEL);
1500 if (!buf) { 1500 if (!buf) {
1501 devwarn(usbdev, 1501 devwarn(usbdev,
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 33c8be7ec8e6..5d2b52f4717f 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -879,16 +879,15 @@ static void zd1201_set_multicast(struct net_device *dev)
879 unsigned char reqbuf[ETH_ALEN*ZD1201_MAXMULTI]; 879 unsigned char reqbuf[ETH_ALEN*ZD1201_MAXMULTI];
880 int i; 880 int i;
881 881
882 if (dev->mc_count > ZD1201_MAXMULTI) 882 if (netdev_mc_count(dev) > ZD1201_MAXMULTI)
883 return; 883 return;
884 884
885 for (i=0; i<dev->mc_count; i++) { 885 for (i=0; i<netdev_mc_count(dev); i++) {
886 memcpy(reqbuf+i*ETH_ALEN, mc->dmi_addr, ETH_ALEN); 886 memcpy(reqbuf+i*ETH_ALEN, mc->dmi_addr, ETH_ALEN);
887 mc = mc->next; 887 mc = mc->next;
888 } 888 }
889 zd1201_setconfig(zd, ZD1201_RID_CNFGROUPADDRESS, reqbuf, 889 zd1201_setconfig(zd, ZD1201_RID_CNFGROUPADDRESS, reqbuf,
890 dev->mc_count*ETH_ALEN, 0); 890 netdev_mc_count(dev) * ETH_ALEN, 0);
891
892} 891}
893 892
894static int zd1201_config_commit(struct net_device *dev, 893static int zd1201_config_commit(struct net_device *dev,
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index 8b231b30fd12..5c880240a642 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -1301,15 +1301,16 @@ static void set_rx_mode(struct net_device *dev)
1301 iowrite16(cfg_value & ~0x1000, ioaddr + Cnfg); 1301 iowrite16(cfg_value & ~0x1000, ioaddr + Cnfg);
1302 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1302 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1303 iowrite16(0x000F, ioaddr + AddrMode); 1303 iowrite16(0x000F, ioaddr + AddrMode);
1304 } else if ((dev->mc_count > 64) || (dev->flags & IFF_ALLMULTI)) { 1304 } else if ((netdev_mc_count(dev) > 64) ||
1305 (dev->flags & IFF_ALLMULTI)) {
1305 /* Too many to filter well, or accept all multicasts. */ 1306 /* Too many to filter well, or accept all multicasts. */
1306 iowrite16(0x000B, ioaddr + AddrMode); 1307 iowrite16(0x000B, ioaddr + AddrMode);
1307 } else if (dev->mc_count > 0) { /* Must use the multicast hash table. */ 1308 } else if (!netdev_mc_empty(dev)) { /* Must use the multicast hash table. */
1308 struct dev_mc_list *mclist; 1309 struct dev_mc_list *mclist;
1309 u16 hash_table[4]; 1310 u16 hash_table[4];
1310 int i; 1311 int i;
1311 memset(hash_table, 0, sizeof(hash_table)); 1312 memset(hash_table, 0, sizeof(hash_table));
1312 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1313 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1313 i++, mclist = mclist->next) { 1314 i++, mclist = mclist->next) {
1314 unsigned int bit; 1315 unsigned int bit;
1315 1316