diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-19 08:48:47 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-19 13:15:50 -0800 |
commit | 91fea5858418127ad33e0060f726c62be0047eaf (patch) | |
tree | 3630384b91fe22565ac4eadc7dddd0d7720bf958 /drivers/net/pcmcia/smc91c92_cs.c | |
parent | 2f1eb65f366b81aa3c22c31e6e8db26168777ec5 (diff) |
net/pcmcia: convert to use netdev_for_each_mc_addr
removed fill_multicast_tbl function in smc91c92_cs and do the work inline
rewritten set_addresses function in xirc2ps_cs. This was kinda headache.
Simulated the original and new functions and they bahave the same.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcmcia/smc91c92_cs.c')
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index d2e86b8887c..d29c22a80a0 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c @@ -1595,27 +1595,6 @@ static void smc_rx(struct net_device *dev) /*====================================================================== - Calculate values for the hardware multicast filter hash table. - -======================================================================*/ - -static void fill_multicast_tbl(int count, struct dev_mc_list *addrs, - u_char *multicast_table) -{ - struct dev_mc_list *mc_addr; - - for (mc_addr = addrs; mc_addr && count-- > 0; mc_addr = mc_addr->next) { - u_int position = ether_crc(6, mc_addr->dmi_addr); -#ifndef final_version /* Verify multicast address. */ - if ((mc_addr->dmi_addr[0] & 1) == 0) - continue; -#endif - multicast_table[position >> 29] |= 1 << ((position >> 26) & 7); - } -} - -/*====================================================================== - Set the receive mode. This routine is used by both the protocol level to notify us of @@ -1639,8 +1618,16 @@ static void set_rx_mode(struct net_device *dev) rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti; else { if (!netdev_mc_empty(dev)) { - fill_multicast_tbl(netdev_mc_count(dev), dev->mc_list, - (u_char *)multicast_table); + struct dev_mc_list *mc_addr; + + netdev_for_each_mc_addr(mc_addr, dev) { + u_int position = ether_crc(6, mc_addr->dmi_addr); +#ifndef final_version /* Verify multicast address. */ + if ((mc_addr->dmi_addr[0] & 1) == 0) + continue; +#endif + multicast_table[position >> 29] |= 1 << ((position >> 26) & 7); + } } rx_cfg_setting = RxStripCRC | RxEnable; } |