diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-23 09:19:49 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-26 02:07:30 -0800 |
commit | f9dcbcc9e338d08c0f7de7eba4eaafbbb7f81249 (patch) | |
tree | 8a1d9a37bc057440220a5ad23231e0fe974b93f6 /drivers/net/r6040.c | |
parent | 52c793f24054f5dc30d228e37e0e19cc8313f086 (diff) |
net: convert multiple drivers to use netdev_for_each_mc_addr, part5 V2
removed some needless checks and also corrected bug in lp486e (dmi was passed
instead of dmi->dmi_addr)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r-- | drivers/net/r6040.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index b8103425fac..15d5373dc8f 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c @@ -938,7 +938,7 @@ static void r6040_multicast_list(struct net_device *dev) u16 *adrp; u16 reg; unsigned long flags; - struct dev_mc_list *dmi = dev->mc_list; + struct dev_mc_list *dmi; int i; /* MAC Address */ @@ -973,11 +973,9 @@ static void r6040_multicast_list(struct net_device *dev) for (i = 0; i < 4; i++) hash_table[i] = 0; - for (i = 0; i < netdev_mc_count(dev); i++) { + netdev_for_each_mc_addr(dmi, dev) { char *addrs = dmi->dmi_addr; - dmi = dmi->next; - if (!(*addrs & 1)) continue; @@ -995,17 +993,19 @@ static void r6040_multicast_list(struct net_device *dev) iowrite16(hash_table[3], ioaddr + MAR3); } /* Multicast Address 1~4 case */ - for (i = 0, dmi; (i < netdev_mc_count(dev)) && (i < MCAST_MAX); i++) { - adrp = (u16 *)dmi->dmi_addr; - iowrite16(adrp[0], ioaddr + MID_1L + 8*i); - iowrite16(adrp[1], ioaddr + MID_1M + 8*i); - iowrite16(adrp[2], ioaddr + MID_1H + 8*i); - dmi = dmi->next; - } - for (i = netdev_mc_count(dev); i < MCAST_MAX; i++) { - iowrite16(0xffff, ioaddr + MID_0L + 8*i); - iowrite16(0xffff, ioaddr + MID_0M + 8*i); - iowrite16(0xffff, ioaddr + MID_0H + 8*i); + i = 0; + netdev_for_each_mc_addr(dmi, dev) { + if (i < MCAST_MAX) { + adrp = (u16 *) dmi->dmi_addr; + iowrite16(adrp[0], ioaddr + MID_1L + 8 * i); + iowrite16(adrp[1], ioaddr + MID_1M + 8 * i); + iowrite16(adrp[2], ioaddr + MID_1H + 8 * i); + } else { + iowrite16(0xffff, ioaddr + MID_0L + 8 * i); + iowrite16(0xffff, ioaddr + MID_0M + 8 * i); + iowrite16(0xffff, ioaddr + MID_0H + 8 * i); + } + i++; } } |