aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/starfire.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/starfire.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/starfire.c')
-rw-r--r--drivers/net/starfire.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index d0556a9b456c..58bc7ac086cf 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1796,15 +1796,15 @@ static void set_rx_mode(struct net_device *dev)
1796 1796
1797 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1797 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1798 rx_mode |= AcceptAll; 1798 rx_mode |= AcceptAll;
1799 } else if ((dev->mc_count > multicast_filter_limit) || 1799 } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
1800 (dev->flags & IFF_ALLMULTI)) { 1800 (dev->flags & IFF_ALLMULTI)) {
1801 /* Too many to match, or accept all multicasts. */ 1801 /* Too many to match, or accept all multicasts. */
1802 rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter; 1802 rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter;
1803 } else if (dev->mc_count <= 14) { 1803 } else if (netdev_mc_count(dev) <= 14) {
1804 /* Use the 16 element perfect filter, skip first two entries. */ 1804 /* Use the 16 element perfect filter, skip first two entries. */
1805 void __iomem *filter_addr = ioaddr + PerfFilterTable + 2 * 16; 1805 void __iomem *filter_addr = ioaddr + PerfFilterTable + 2 * 16;
1806 __be16 *eaddrs; 1806 __be16 *eaddrs;
1807 for (i = 2, mclist = dev->mc_list; mclist && i < dev->mc_count + 2; 1807 for (i = 2, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev) + 2;
1808 i++, mclist = mclist->next) { 1808 i++, mclist = mclist->next) {
1809 eaddrs = (__be16 *)mclist->dmi_addr; 1809 eaddrs = (__be16 *)mclist->dmi_addr;
1810 writew(be16_to_cpu(eaddrs[2]), filter_addr); filter_addr += 4; 1810 writew(be16_to_cpu(eaddrs[2]), filter_addr); filter_addr += 4;
@@ -1825,7 +1825,7 @@ static void set_rx_mode(struct net_device *dev)
1825 __le16 mc_filter[32] __attribute__ ((aligned(sizeof(long)))); /* Multicast hash filter */ 1825 __le16 mc_filter[32] __attribute__ ((aligned(sizeof(long)))); /* Multicast hash filter */
1826 1826
1827 memset(mc_filter, 0, sizeof(mc_filter)); 1827 memset(mc_filter, 0, sizeof(mc_filter));
1828 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1828 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1829 i++, mclist = mclist->next) { 1829 i++, mclist = mclist->next) {
1830 /* The chip uses the upper 9 CRC bits 1830 /* The chip uses the upper 9 CRC bits
1831 as index into the hash table */ 1831 as index into the hash table */