aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/stmmac
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/stmmac
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/stmmac')
-rw-r--r--drivers/net/stmmac/dwmac100.c6
-rw-r--r--drivers/net/stmmac/dwmac1000_core.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/stmmac/dwmac100.c b/drivers/net/stmmac/dwmac100.c
index ac48ed787040..576b256ee388 100644
--- a/drivers/net/stmmac/dwmac100.c
+++ b/drivers/net/stmmac/dwmac100.c
@@ -305,13 +305,13 @@ static void dwmac100_set_filter(struct net_device *dev)
305 value |= MAC_CONTROL_PR; 305 value |= MAC_CONTROL_PR;
306 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_IF | MAC_CONTROL_HO | 306 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_IF | MAC_CONTROL_HO |
307 MAC_CONTROL_HP); 307 MAC_CONTROL_HP);
308 } else if ((dev->mc_count > HASH_TABLE_SIZE) 308 } else if ((netdev_mc_count(dev) > HASH_TABLE_SIZE)
309 || (dev->flags & IFF_ALLMULTI)) { 309 || (dev->flags & IFF_ALLMULTI)) {
310 value |= MAC_CONTROL_PM; 310 value |= MAC_CONTROL_PM;
311 value &= ~(MAC_CONTROL_PR | MAC_CONTROL_IF | MAC_CONTROL_HO); 311 value &= ~(MAC_CONTROL_PR | MAC_CONTROL_IF | MAC_CONTROL_HO);
312 writel(0xffffffff, ioaddr + MAC_HASH_HIGH); 312 writel(0xffffffff, ioaddr + MAC_HASH_HIGH);
313 writel(0xffffffff, ioaddr + MAC_HASH_LOW); 313 writel(0xffffffff, ioaddr + MAC_HASH_LOW);
314 } else if (dev->mc_count == 0) { /* no multicast */ 314 } else if (netdev_mc_empty(dev)) { /* no multicast */
315 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_PR | MAC_CONTROL_IF | 315 value &= ~(MAC_CONTROL_PM | MAC_CONTROL_PR | MAC_CONTROL_IF |
316 MAC_CONTROL_HO | MAC_CONTROL_HP); 316 MAC_CONTROL_HO | MAC_CONTROL_HP);
317 } else { 317 } else {
@@ -327,7 +327,7 @@ static void dwmac100_set_filter(struct net_device *dev)
327 327
328 memset(mc_filter, 0, sizeof(mc_filter)); 328 memset(mc_filter, 0, sizeof(mc_filter));
329 for (i = 0, mclist = dev->mc_list; 329 for (i = 0, mclist = dev->mc_list;
330 mclist && i < dev->mc_count; i++, mclist = mclist->next) { 330 mclist && i < netdev_mc_count(dev); i++, mclist = mclist->next) {
331 /* The upper 6 bits of the calculated CRC are used to 331 /* The upper 6 bits of the calculated CRC are used to
332 * index the contens of the hash table */ 332 * index the contens of the hash table */
333 int bit_nr = 333 int bit_nr =
diff --git a/drivers/net/stmmac/dwmac1000_core.c b/drivers/net/stmmac/dwmac1000_core.c
index d812e9cdb3db..90dbb4f41ef3 100644
--- a/drivers/net/stmmac/dwmac1000_core.c
+++ b/drivers/net/stmmac/dwmac1000_core.c
@@ -83,16 +83,16 @@ static void dwmac1000_set_filter(struct net_device *dev)
83 unsigned int value = 0; 83 unsigned int value = 0;
84 84
85 DBG(KERN_INFO "%s: # mcasts %d, # unicast %d\n", 85 DBG(KERN_INFO "%s: # mcasts %d, # unicast %d\n",
86 __func__, dev->mc_count, netdev_uc_count(dev)); 86 __func__, netdev_mc_count(dev), netdev_uc_count(dev));
87 87
88 if (dev->flags & IFF_PROMISC) 88 if (dev->flags & IFF_PROMISC)
89 value = GMAC_FRAME_FILTER_PR; 89 value = GMAC_FRAME_FILTER_PR;
90 else if ((dev->mc_count > HASH_TABLE_SIZE) 90 else if ((netdev_mc_count(dev) > HASH_TABLE_SIZE)
91 || (dev->flags & IFF_ALLMULTI)) { 91 || (dev->flags & IFF_ALLMULTI)) {
92 value = GMAC_FRAME_FILTER_PM; /* pass all multi */ 92 value = GMAC_FRAME_FILTER_PM; /* pass all multi */
93 writel(0xffffffff, ioaddr + GMAC_HASH_HIGH); 93 writel(0xffffffff, ioaddr + GMAC_HASH_HIGH);
94 writel(0xffffffff, ioaddr + GMAC_HASH_LOW); 94 writel(0xffffffff, ioaddr + GMAC_HASH_LOW);
95 } else if (dev->mc_count > 0) { 95 } else if (!netdev_mc_empty(dev)) {
96 int i; 96 int i;
97 u32 mc_filter[2]; 97 u32 mc_filter[2];
98 struct dev_mc_list *mclist; 98 struct dev_mc_list *mclist;
@@ -102,7 +102,7 @@ static void dwmac1000_set_filter(struct net_device *dev)
102 102
103 memset(mc_filter, 0, sizeof(mc_filter)); 103 memset(mc_filter, 0, sizeof(mc_filter));
104 for (i = 0, mclist = dev->mc_list; 104 for (i = 0, mclist = dev->mc_list;
105 mclist && i < dev->mc_count; i++, mclist = mclist->next) { 105 mclist && i < netdev_mc_count(dev); i++, mclist = mclist->next) {
106 /* The upper 6 bits of the calculated CRC are used to 106 /* The upper 6 bits of the calculated CRC are used to
107 index the contens of the hash table */ 107 index the contens of the hash table */
108 int bit_nr = 108 int bit_nr =