aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index b8103425facb..15d5373dc8f3 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -938,7 +938,7 @@ static void r6040_multicast_list(struct net_device *dev)
938 u16 *adrp; 938 u16 *adrp;
939 u16 reg; 939 u16 reg;
940 unsigned long flags; 940 unsigned long flags;
941 struct dev_mc_list *dmi = dev->mc_list; 941 struct dev_mc_list *dmi;
942 int i; 942 int i;
943 943
944 /* MAC Address */ 944 /* MAC Address */
@@ -973,11 +973,9 @@ static void r6040_multicast_list(struct net_device *dev)
973 for (i = 0; i < 4; i++) 973 for (i = 0; i < 4; i++)
974 hash_table[i] = 0; 974 hash_table[i] = 0;
975 975
976 for (i = 0; i < netdev_mc_count(dev); i++) { 976 netdev_for_each_mc_addr(dmi, dev) {
977 char *addrs = dmi->dmi_addr; 977 char *addrs = dmi->dmi_addr;
978 978
979 dmi = dmi->next;
980
981 if (!(*addrs & 1)) 979 if (!(*addrs & 1))
982 continue; 980 continue;
983 981
@@ -995,17 +993,19 @@ static void r6040_multicast_list(struct net_device *dev)
995 iowrite16(hash_table[3], ioaddr + MAR3); 993 iowrite16(hash_table[3], ioaddr + MAR3);
996 } 994 }
997 /* Multicast Address 1~4 case */ 995 /* Multicast Address 1~4 case */
998 for (i = 0, dmi; (i < netdev_mc_count(dev)) && (i < MCAST_MAX); i++) { 996 i = 0;
999 adrp = (u16 *)dmi->dmi_addr; 997 netdev_for_each_mc_addr(dmi, dev) {
1000 iowrite16(adrp[0], ioaddr + MID_1L + 8*i); 998 if (i < MCAST_MAX) {
1001 iowrite16(adrp[1], ioaddr + MID_1M + 8*i); 999 adrp = (u16 *) dmi->dmi_addr;
1002 iowrite16(adrp[2], ioaddr + MID_1H + 8*i); 1000 iowrite16(adrp[0], ioaddr + MID_1L + 8 * i);
1003 dmi = dmi->next; 1001 iowrite16(adrp[1], ioaddr + MID_1M + 8 * i);
1004 } 1002 iowrite16(adrp[2], ioaddr + MID_1H + 8 * i);
1005 for (i = netdev_mc_count(dev); i < MCAST_MAX; i++) { 1003 } else {
1006 iowrite16(0xffff, ioaddr + MID_0L + 8*i); 1004 iowrite16(0xffff, ioaddr + MID_0L + 8 * i);
1007 iowrite16(0xffff, ioaddr + MID_0M + 8*i); 1005 iowrite16(0xffff, ioaddr + MID_0M + 8 * i);
1008 iowrite16(0xffff, ioaddr + MID_0H + 8*i); 1006 iowrite16(0xffff, ioaddr + MID_0H + 8 * i);
1007 }
1008 i++;
1009 } 1009 }
1010} 1010}
1011 1011