diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-04 21:47:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-05 11:58:38 -0500 |
commit | a56ed41d94f80e4342116318754878a045835f40 (patch) | |
tree | c0f3ee92478daac46753b2e961ee54ee9a635191 /drivers | |
parent | b405e8df26dfe4c56ab3f88f5cc1dfab0d220289 (diff) |
net: 8139cp: convert to use mc helpers
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/8139cp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 9d59654748b1..60bc0b0ad4f3 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -899,7 +899,7 @@ static void __cp_set_rx_mode (struct net_device *dev) | |||
899 | { | 899 | { |
900 | struct cp_private *cp = netdev_priv(dev); | 900 | struct cp_private *cp = netdev_priv(dev); |
901 | u32 mc_filter[2]; /* Multicast hash filter */ | 901 | u32 mc_filter[2]; /* Multicast hash filter */ |
902 | int i, rx_mode; | 902 | int rx_mode; |
903 | u32 tmp; | 903 | u32 tmp; |
904 | 904 | ||
905 | /* Note: do not reorder, GCC is clever about common statements. */ | 905 | /* Note: do not reorder, GCC is clever about common statements. */ |
@@ -909,7 +909,7 @@ static void __cp_set_rx_mode (struct net_device *dev) | |||
909 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | | 909 | AcceptBroadcast | AcceptMulticast | AcceptMyPhys | |
910 | AcceptAllPhys; | 910 | AcceptAllPhys; |
911 | mc_filter[1] = mc_filter[0] = 0xffffffff; | 911 | mc_filter[1] = mc_filter[0] = 0xffffffff; |
912 | } else if ((dev->mc_count > multicast_filter_limit) || | 912 | } else if ((netdev_mc_count(dev) > multicast_filter_limit) || |
913 | (dev->flags & IFF_ALLMULTI)) { | 913 | (dev->flags & IFF_ALLMULTI)) { |
914 | /* Too many to filter perfectly -- accept all multicasts. */ | 914 | /* Too many to filter perfectly -- accept all multicasts. */ |
915 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; | 915 | rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; |
@@ -918,8 +918,7 @@ static void __cp_set_rx_mode (struct net_device *dev) | |||
918 | struct dev_mc_list *mclist; | 918 | struct dev_mc_list *mclist; |
919 | rx_mode = AcceptBroadcast | AcceptMyPhys; | 919 | rx_mode = AcceptBroadcast | AcceptMyPhys; |
920 | mc_filter[1] = mc_filter[0] = 0; | 920 | mc_filter[1] = mc_filter[0] = 0; |
921 | for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; | 921 | netdev_for_each_mc_addr(mclist, dev) { |
922 | i++, mclist = mclist->next) { | ||
923 | int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; | 922 | int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; |
924 | 923 | ||
925 | mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); | 924 | mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); |