aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/3c501.c2
-rw-r--r--drivers/net/3c505.c9
-rw-r--r--drivers/net/3c515.c2
-rw-r--r--drivers/net/3c523.c9
-rw-r--r--drivers/net/3c527.c8
-rw-r--r--drivers/net/3c59x.c2
6 files changed, 13 insertions, 19 deletions
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c
index 4d4cad393dce..b6de7b1e2a5c 100644
--- a/drivers/net/3c501.c
+++ b/drivers/net/3c501.c
@@ -812,7 +812,7 @@ static void set_multicast_list(struct net_device *dev)
812 if (dev->flags & IFF_PROMISC) { 812 if (dev->flags & IFF_PROMISC) {
813 outb(RX_PROM, RX_CMD); 813 outb(RX_PROM, RX_CMD);
814 inb(RX_STATUS); 814 inb(RX_STATUS);
815 } else if (dev->mc_list || dev->flags & IFF_ALLMULTI) { 815 } else if (!netdev_mc_empty(dev) || dev->flags & IFF_ALLMULTI) {
816 /* Multicast or all multicast is the same */ 816 /* Multicast or all multicast is the same */
817 outb(RX_MULT, RX_CMD); 817 outb(RX_MULT, RX_CMD);
818 inb(RX_STATUS); /* Clear status. */ 818 inb(RX_STATUS); /* Clear status. */
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index dadb46a8833a..04b5bba19021 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -1216,7 +1216,7 @@ static int elp_close(struct net_device *dev)
1216static void elp_set_mc_list(struct net_device *dev) 1216static void elp_set_mc_list(struct net_device *dev)
1217{ 1217{
1218 elp_device *adapter = netdev_priv(dev); 1218 elp_device *adapter = netdev_priv(dev);
1219 struct dev_mc_list *dmi = dev->mc_list; 1219 struct dev_mc_list *dmi;
1220 int i; 1220 int i;
1221 unsigned long flags; 1221 unsigned long flags;
1222 1222
@@ -1230,10 +1230,9 @@ static void elp_set_mc_list(struct net_device *dev)
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 * netdev_mc_count(dev); 1232 adapter->tx_pcb.length = 6 * netdev_mc_count(dev);
1233 for (i = 0; i < netdev_mc_count(dev); i++) { 1233 i = 0;
1234 memcpy(adapter->tx_pcb.data.multicast[i], dmi->dmi_addr, 6); 1234 netdev_for_each_mc_addr(dmi, dev)
1235 dmi = dmi->next; 1235 memcpy(adapter->tx_pcb.data.multicast[i++], dmi->dmi_addr, 6);
1236 }
1237 adapter->got[CMD_LOAD_MULTICAST_LIST] = 0; 1236 adapter->got[CMD_LOAD_MULTICAST_LIST] = 0;
1238 if (!send_pcb(dev, &adapter->tx_pcb)) 1237 if (!send_pcb(dev, &adapter->tx_pcb))
1239 pr_err("%s: couldn't send set_multicast command\n", dev->name); 1238 pr_err("%s: couldn't send set_multicast command\n", dev->name);
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index 063b049ffe55..1e898b1c8068 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -1536,7 +1536,7 @@ static void set_rx_mode(struct net_device *dev)
1536 pr_debug("%s: Setting promiscuous mode.\n", 1536 pr_debug("%s: Setting promiscuous mode.\n",
1537 dev->name); 1537 dev->name);
1538 new_mode = SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm; 1538 new_mode = SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm;
1539 } else if ((dev->mc_list) || (dev->flags & IFF_ALLMULTI)) { 1539 } else if (!netdev_mc_empty(dev) || dev->flags & IFF_ALLMULTI) {
1540 new_mode = SetRxFilter | RxStation | RxMulticast | RxBroadcast; 1540 new_mode = SetRxFilter | RxStation | RxMulticast | RxBroadcast;
1541 } else 1541 } else
1542 new_mode = SetRxFilter | RxStation | RxBroadcast; 1542 new_mode = SetRxFilter | RxStation | RxBroadcast;
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index 6948d667fc5e..beed4fa10c6e 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -625,7 +625,7 @@ static int init586(struct net_device *dev)
625 volatile struct iasetup_cmd_struct *ias_cmd; 625 volatile struct iasetup_cmd_struct *ias_cmd;
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;
629 int num_addrs = netdev_mc_count(dev); 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));
@@ -787,10 +787,9 @@ static int init586(struct net_device *dev)
787 mc_cmd->cmd_cmd = CMD_MCSETUP | CMD_LAST; 787 mc_cmd->cmd_cmd = CMD_MCSETUP | CMD_LAST;
788 mc_cmd->cmd_link = 0xffff; 788 mc_cmd->cmd_link = 0xffff;
789 mc_cmd->mc_cnt = num_addrs * 6; 789 mc_cmd->mc_cnt = num_addrs * 6;
790 for (i = 0; i < num_addrs; i++) { 790 i = 0;
791 memcpy((char *) mc_cmd->mc_list[i], dmi->dmi_addr, 6); 791 netdev_for_each_mc_addr(dmi, dev)
792 dmi = dmi->next; 792 memcpy((char *) mc_cmd->mc_list[i++], dmi->dmi_addr, 6);
793 }
794 p->scb->cbl_offset = make16(mc_cmd); 793 p->scb->cbl_offset = make16(mc_cmd);
795 p->scb->cmd = CUC_START; 794 p->scb->cmd = CUC_START;
796 elmc_id_attn586(); 795 elmc_id_attn586();
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index ce9826980517..5c07b147ec99 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -1533,9 +1533,7 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
1533 { 1533 {
1534 unsigned char block[62]; 1534 unsigned char block[62];
1535 unsigned char *bp; 1535 unsigned char *bp;
1536 struct dev_mc_list *dmc=dev->mc_list; 1536 struct dev_mc_list *dmc;
1537
1538 int i;
1539 1537
1540 if(retry==0) 1538 if(retry==0)
1541 lp->mc_list_valid = 0; 1539 lp->mc_list_valid = 0;
@@ -1545,11 +1543,9 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
1545 block[0]=netdev_mc_count(dev); 1543 block[0]=netdev_mc_count(dev);
1546 bp=block+2; 1544 bp=block+2;
1547 1545
1548 for(i=0;i<netdev_mc_count(dev);i++) 1546 netdev_for_each_mc_addr(dmc, dev) {
1549 {
1550 memcpy(bp, dmc->dmi_addr, 6); 1547 memcpy(bp, dmc->dmi_addr, 6);
1551 bp+=6; 1548 bp+=6;
1552 dmc=dmc->next;
1553 } 1549 }
1554 if(mc32_command_nowait(dev, 2, block, 1550 if(mc32_command_nowait(dev, 2, block,
1555 2+6*netdev_mc_count(dev))==-1) 1551 2+6*netdev_mc_count(dev))==-1)
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 5df46c230b07..f965431f4924 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -2970,7 +2970,7 @@ static void set_rx_mode(struct net_device *dev)
2970 if (vortex_debug > 3) 2970 if (vortex_debug > 3)
2971 pr_notice("%s: Setting promiscuous mode.\n", dev->name); 2971 pr_notice("%s: Setting promiscuous mode.\n", dev->name);
2972 new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast|RxProm; 2972 new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast|RxProm;
2973 } else if ((dev->mc_list) || (dev->flags & IFF_ALLMULTI)) { 2973 } else if (!netdev_mc_empty(dev) || dev->flags & IFF_ALLMULTI) {
2974 new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast; 2974 new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast;
2975 } else 2975 } else
2976 new_mode = SetRxFilter | RxStation | RxBroadcast; 2976 new_mode = SetRxFilter | RxStation | RxBroadcast;