diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-07 23:30:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 14:38:58 -0500 |
commit | 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 (patch) | |
tree | 99f57f6374a58022e1e5ed1cbc12699288c7eae1 /drivers/net/wireless | |
parent | 8e5574211d96c0552f84c757718475fdb4021be7 (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/wireless')
-rw-r--r-- | drivers/net/wireless/airo.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/main.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/zd1201.c | 7 |
5 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index ef6b78da370f..c22a34c7639c 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -2310,7 +2310,7 @@ static void airo_set_multicast_list(struct net_device *dev) { | |||
2310 | airo_set_promisc(ai); | 2310 | airo_set_promisc(ai); |
2311 | } | 2311 | } |
2312 | 2312 | ||
2313 | if ((dev->flags&IFF_ALLMULTI)||dev->mc_count>0) { | 2313 | if ((dev->flags&IFF_ALLMULTI) || !netdev_mc_empty(dev)) { |
2314 | /* Turn on multicast. (Should be already setup...) */ | 2314 | /* Turn on multicast. (Should be already setup...) */ |
2315 | } | 2315 | } |
2316 | } | 2316 | } |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index 753a1804eee7..a9e9cea2d767 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -1668,12 +1668,12 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1668 | /* The Hermes doesn't seem to have an allmulti mode, so we go | 1668 | /* The Hermes doesn't seem to have an allmulti mode, so we go |
1669 | * into promiscuous mode and let the upper levels deal. */ | 1669 | * into promiscuous mode and let the upper levels deal. */ |
1670 | if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) || | 1670 | if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) || |
1671 | (dev->mc_count > MAX_MULTICAST(priv))) { | 1671 | (netdev_mc_count(dev) > MAX_MULTICAST(priv))) { |
1672 | promisc = 1; | 1672 | promisc = 1; |
1673 | mc_count = 0; | 1673 | mc_count = 0; |
1674 | } else { | 1674 | } else { |
1675 | promisc = 0; | 1675 | promisc = 0; |
1676 | mc_count = dev->mc_count; | 1676 | mc_count = netdev_mc_count(dev); |
1677 | } | 1677 | } |
1678 | 1678 | ||
1679 | err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count, | 1679 | err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count, |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 88e1e4e32b22..85905cab4f16 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -1950,7 +1950,7 @@ static void set_multicast_list(struct net_device *dev) | |||
1950 | if (dev->flags & IFF_ALLMULTI) | 1950 | if (dev->flags & IFF_ALLMULTI) |
1951 | ray_update_multi_list(dev, 1); | 1951 | ray_update_multi_list(dev, 1); |
1952 | else { | 1952 | else { |
1953 | if (local->num_multi != dev->mc_count) | 1953 | if (local->num_multi != netdev_mc_count(dev)) |
1954 | ray_update_multi_list(dev, 0); | 1954 | ray_update_multi_list(dev, 0); |
1955 | } | 1955 | } |
1956 | } /* end set_multicast_list */ | 1956 | } /* end set_multicast_list */ |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 305c106fdc1c..14692bc51b51 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -1492,10 +1492,10 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1492 | filter |= RNDIS_PACKET_TYPE_PROMISCUOUS | | 1492 | filter |= RNDIS_PACKET_TYPE_PROMISCUOUS | |
1493 | RNDIS_PACKET_TYPE_ALL_LOCAL; | 1493 | RNDIS_PACKET_TYPE_ALL_LOCAL; |
1494 | } else if (usbdev->net->flags & IFF_ALLMULTI || | 1494 | } else if (usbdev->net->flags & IFF_ALLMULTI || |
1495 | usbdev->net->mc_count > priv->multicast_size) { | 1495 | netdev_mc_count(usbdev->net) > priv->multicast_size) { |
1496 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; | 1496 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; |
1497 | } else if (usbdev->net->mc_count > 0) { | 1497 | } else if (!netdev_mc_empty(usbdev->net)) { |
1498 | size = min(priv->multicast_size, usbdev->net->mc_count); | 1498 | size = min(priv->multicast_size, netdev_mc_count(usbdev->net)); |
1499 | buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); | 1499 | buf = kmalloc(size * ETH_ALEN, GFP_KERNEL); |
1500 | if (!buf) { | 1500 | if (!buf) { |
1501 | devwarn(usbdev, | 1501 | devwarn(usbdev, |
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index 33c8be7ec8e6..5d2b52f4717f 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -879,16 +879,15 @@ static void zd1201_set_multicast(struct net_device *dev) | |||
879 | unsigned char reqbuf[ETH_ALEN*ZD1201_MAXMULTI]; | 879 | unsigned char reqbuf[ETH_ALEN*ZD1201_MAXMULTI]; |
880 | int i; | 880 | int i; |
881 | 881 | ||
882 | if (dev->mc_count > ZD1201_MAXMULTI) | 882 | if (netdev_mc_count(dev) > ZD1201_MAXMULTI) |
883 | return; | 883 | return; |
884 | 884 | ||
885 | for (i=0; i<dev->mc_count; i++) { | 885 | for (i=0; i<netdev_mc_count(dev); i++) { |
886 | memcpy(reqbuf+i*ETH_ALEN, mc->dmi_addr, ETH_ALEN); | 886 | memcpy(reqbuf+i*ETH_ALEN, mc->dmi_addr, ETH_ALEN); |
887 | mc = mc->next; | 887 | mc = mc->next; |
888 | } | 888 | } |
889 | zd1201_setconfig(zd, ZD1201_RID_CNFGROUPADDRESS, reqbuf, | 889 | zd1201_setconfig(zd, ZD1201_RID_CNFGROUPADDRESS, reqbuf, |
890 | dev->mc_count*ETH_ALEN, 0); | 890 | netdev_mc_count(dev) * ETH_ALEN, 0); |
891 | |||
892 | } | 891 | } |
893 | 892 | ||
894 | static int zd1201_config_commit(struct net_device *dev, | 893 | static int zd1201_config_commit(struct net_device *dev, |