aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/lib8390.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-23 04:19:49 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-26 05:07:30 -0500
commitf9dcbcc9e338d08c0f7de7eba4eaafbbb7f81249 (patch)
tree8a1d9a37bc057440220a5ad23231e0fe974b93f6 /drivers/net/lib8390.c
parent52c793f24054f5dc30d228e37e0e19cc8313f086 (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/lib8390.c')
-rw-r--r--drivers/net/lib8390.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c
index 57f25848fe80..56f66f485400 100644
--- a/drivers/net/lib8390.c
+++ b/drivers/net/lib8390.c
@@ -907,15 +907,8 @@ static inline void make_mc_bits(u8 *bits, struct net_device *dev)
907{ 907{
908 struct dev_mc_list *dmi; 908 struct dev_mc_list *dmi;
909 909
910 for (dmi=dev->mc_list; dmi; dmi=dmi->next) 910 netdev_for_each_mc_addr(dmi, dev) {
911 { 911 u32 crc = ether_crc(ETH_ALEN, dmi->dmi_addr);
912 u32 crc;
913 if (dmi->dmi_addrlen != ETH_ALEN)
914 {
915 printk(KERN_INFO "%s: invalid multicast address length given.\n", dev->name);
916 continue;
917 }
918 crc = ether_crc(ETH_ALEN, dmi->dmi_addr);
919 /* 912 /*
920 * The 8390 uses the 6 most significant bits of the 913 * The 8390 uses the 6 most significant bits of the
921 * CRC to index the multicast table. 914 * CRC to index the multicast table.
@@ -941,7 +934,7 @@ static void do_set_multicast_list(struct net_device *dev)
941 if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI))) 934 if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI)))
942 { 935 {
943 memset(ei_local->mcfilter, 0, 8); 936 memset(ei_local->mcfilter, 0, 8);
944 if (dev->mc_list) 937 if (!netdev_mc_empty(dev))
945 make_mc_bits(ei_local->mcfilter, dev); 938 make_mc_bits(ei_local->mcfilter, dev);
946 } 939 }
947 else 940 else
@@ -975,7 +968,7 @@ static void do_set_multicast_list(struct net_device *dev)
975 968
976 if(dev->flags&IFF_PROMISC) 969 if(dev->flags&IFF_PROMISC)
977 ei_outb_p(E8390_RXCONFIG | 0x18, e8390_base + EN0_RXCR); 970 ei_outb_p(E8390_RXCONFIG | 0x18, e8390_base + EN0_RXCR);
978 else if(dev->flags&IFF_ALLMULTI || dev->mc_list) 971 else if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev))
979 ei_outb_p(E8390_RXCONFIG | 0x08, e8390_base + EN0_RXCR); 972 ei_outb_p(E8390_RXCONFIG | 0x08, e8390_base + EN0_RXCR);
980 else 973 else
981 ei_outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR); 974 ei_outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR);