diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-08 04:30:35 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 11:38:58 -0800 |
commit | 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5 (patch) | |
tree | 99f57f6374a58022e1e5ed1cbc12699288c7eae1 /drivers/net/usb | |
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/usb')
-rw-r--r-- | drivers/net/usb/asix.c | 12 | ||||
-rw-r--r-- | drivers/net/usb/catc.c | 4 | ||||
-rw-r--r-- | drivers/net/usb/int51x1.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/kaweth.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/mcs7830.c | 6 | ||||
-rw-r--r-- | drivers/net/usb/pegasus.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/rtl8150.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 4 |
8 files changed, 18 insertions, 16 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index a516185cbc9f..f02551713b13 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c @@ -542,9 +542,9 @@ static void asix_set_multicast(struct net_device *net) if (net->flags & IFF_PROMISC) { rx_ctl |= AX_RX_CTL_PRO; } else if (net->flags & IFF_ALLMULTI || - net->mc_count > AX_MAX_MCAST) { + netdev_mc_count(net) > AX_MAX_MCAST) { rx_ctl |= AX_RX_CTL_AMALL; - } else if (net->mc_count == 0) { + } else if (netdev_mc_empty(net)) { /* just broadcast and directed */ } else { /* We use the 20 byte dev->data @@ -558,7 +558,7 @@ static void asix_set_multicast(struct net_device *net) memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); /* Build the multicast hash filter. */ - for (i = 0; i < net->mc_count; i++) { + for (i = 0; i < netdev_mc_count(net); i++) { crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; @@ -754,9 +754,9 @@ static void ax88172_set_multicast(struct net_device *net) if (net->flags & IFF_PROMISC) { rx_ctl |= 0x01; } else if (net->flags & IFF_ALLMULTI || - net->mc_count > AX_MAX_MCAST) { + netdev_mc_count(net) > AX_MAX_MCAST) { rx_ctl |= 0x02; - } else if (net->mc_count == 0) { + } else if (netdev_mc_empty(net)) { /* just broadcast and directed */ } else { /* We use the 20 byte dev->data @@ -770,7 +770,7 @@ static void ax88172_set_multicast(struct net_device *net) memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE); /* Build the multicast hash filter. */ - for (i = 0; i < net->mc_count; i++) { + for (i = 0; i < netdev_mc_count(net); i++) { crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c index 7d3fa06980c1..5a13660ebd17 100644 --- a/drivers/net/usb/catc.c +++ b/drivers/net/usb/catc.c @@ -648,7 +648,9 @@ static void catc_set_multicast_list(struct net_device *netdev) if (netdev->flags & IFF_ALLMULTI) { memset(catc->multicast, 0xff, 64); } else { - for (i = 0, mc = netdev->mc_list; mc && i < netdev->mc_count; i++, mc = mc->next) { + for (i = 0, mc = netdev->mc_list; + mc && i < netdev_mc_count(netdev); + i++, mc = mc->next) { u32 crc = ether_crc_le(6, mc->dmi_addr); if (!catc->is_f5u011) { catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7); diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c index 55cf7081de10..9ab5c1983a7d 100644 --- a/drivers/net/usb/int51x1.c +++ b/drivers/net/usb/int51x1.c @@ -139,7 +139,7 @@ static void int51x1_set_multicast(struct net_device *netdev) /* do not expect to see traffic of other PLCs */ filter |= PACKET_TYPE_PROMISCUOUS; devinfo(dev, "promiscuous mode enabled"); - } else if (netdev->mc_count || + } else if (!netdev_mc_empty(netdev) || (netdev->flags & IFF_ALLMULTI)) { filter |= PACKET_TYPE_ALL_MULTICAST; devdbg(dev, "receive all multicast enabled"); diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index f1d64ef67efa..52671ea043a7 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c @@ -881,7 +881,7 @@ static void kaweth_set_rx_mode(struct net_device *net) if (net->flags & IFF_PROMISC) { packet_filter_bitmap |= KAWETH_PACKET_FILTER_PROMISCUOUS; } - else if ((net->mc_count) || (net->flags & IFF_ALLMULTI)) { + else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) { packet_filter_bitmap |= KAWETH_PACKET_FILTER_ALL_MULTICAST; } diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index 6fc098fe9ff7..34665137f2c3 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c @@ -443,9 +443,9 @@ static void mcs7830_data_set_multicast(struct net_device *net) if (net->flags & IFF_PROMISC) { data->config |= HIF_REG_CONFIG_PROMISCUOUS; } else if (net->flags & IFF_ALLMULTI || - net->mc_count > MCS7830_MAX_MCAST) { + netdev_mc_count(net) > MCS7830_MAX_MCAST) { data->config |= HIF_REG_CONFIG_ALLMULTICAST; - } else if (net->mc_count == 0) { + } else if (netdev_mc_empty(net)) { /* just broadcast and directed */ } else { /* We use the 20 byte dev->data @@ -457,7 +457,7 @@ static void mcs7830_data_set_multicast(struct net_device *net) int i; /* Build the multicast hash filter. */ - for (i = 0; i < net->mc_count; i++) { + for (i = 0; i < netdev_mc_count(net); i++) { crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7); mc_list = mc_list->next; diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index ed4a508ef262..44ae8f6d3135 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -1232,7 +1232,7 @@ static void pegasus_set_multicast(struct net_device *net) pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; if (netif_msg_link(pegasus)) pr_info("%s: Promiscuous mode enabled.\n", net->name); - } else if (net->mc_count || (net->flags & IFF_ALLMULTI)) { + } else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) { pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; if (netif_msg_link(pegasus)) diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index 21ac103fbb71..e85c89c6706d 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c @@ -711,7 +711,7 @@ static void rtl8150_set_multicast(struct net_device *netdev) if (netdev->flags & IFF_PROMISC) { dev->rx_creg |= cpu_to_le16(0x0001); dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name); - } else if (netdev->mc_count || + } else if (!netdev_mc_empty(netdev) || (netdev->flags & IFF_ALLMULTI)) { dev->rx_creg &= cpu_to_le16(0xfffe); dev->rx_creg |= cpu_to_le16(0x0002); diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 0c3c738d7419..48555d0e374d 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -384,7 +384,7 @@ static void smsc95xx_set_multicast(struct net_device *netdev) devdbg(dev, "receive all multicast enabled"); pdata->mac_cr |= MAC_CR_MCPAS_; pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); - } else if (dev->net->mc_count > 0) { + } else if (!netdev_mc_empty(dev->net)) { struct dev_mc_list *mc_list = dev->net->mc_list; int count = 0; @@ -406,7 +406,7 @@ static void smsc95xx_set_multicast(struct net_device *netdev) mc_list = mc_list->next; } - if (count != ((u32)dev->net->mc_count)) + if (count != ((u32) netdev_mc_count(dev->net))) devwarn(dev, "mc_count != dev->mc_count"); if (netif_msg_drv(dev)) |