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/sundance.c | |
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/sundance.c')
-rw-r--r-- | drivers/net/sundance.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 0c972e560cf3..4171259590b2 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -1517,18 +1517,18 @@ static void set_rx_mode(struct net_device *dev) | |||
1517 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 1517 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
1518 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1518 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1519 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys; | 1519 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys; |
1520 | } else if ((dev->mc_count > multicast_filter_limit) || | 1520 | } else if ((netdev_mc_count(dev) > multicast_filter_limit) || |
1521 | (dev->flags & IFF_ALLMULTI)) { | 1521 | (dev->flags & IFF_ALLMULTI)) { |
1522 | /* Too many to match, or accept all multicasts. */ | 1522 | /* Too many to match, or accept all multicasts. */ |
1523 | memset(mc_filter, 0xff, sizeof(mc_filter)); | 1523 | memset(mc_filter, 0xff, sizeof(mc_filter)); |
1524 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 1524 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
1525 | } else if (dev->mc_count) { | 1525 | } else if (!netdev_mc_empty(dev)) { |
1526 | struct dev_mc_list *mclist; | 1526 | struct dev_mc_list *mclist; |
1527 | int bit; | 1527 | int bit; |
1528 | int index; | 1528 | int index; |
1529 | int crc; | 1529 | int crc; |
1530 | memset (mc_filter, 0, sizeof (mc_filter)); | 1530 | memset (mc_filter, 0, sizeof (mc_filter)); |
1531 | for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; | 1531 | for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev); |
1532 | i++, mclist = mclist->next) { | 1532 | i++, mclist = mclist->next) { |
1533 | crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr); | 1533 | crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr); |
1534 | for (index=0, bit=0; bit < 6; bit++, crc <<= 1) | 1534 | for (index=0, bit=0; bit < 6; bit++, crc <<= 1) |