aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/atp.c
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/atp.c
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/atp.c')
-rw-r--r--drivers/net/atp.c7
1 files changed, 4 insertions, 3 deletions
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;