diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-19 03:48:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-19 16:15:50 -0500 |
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 d2e86b8887c8..d29c22a80a06 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) | |||
1595 | 1595 | ||
1596 | /*====================================================================== | 1596 | /*====================================================================== |
1597 | 1597 | ||
1598 | Calculate values for the hardware multicast filter hash table. | ||
1599 | |||
1600 | ======================================================================*/ | ||
1601 | |||
1602 | static void fill_multicast_tbl(int count, struct dev_mc_list *addrs, | ||
1603 | u_char *multicast_table) | ||
1604 | { | ||
1605 | struct dev_mc_list *mc_addr; | ||
1606 | |||
1607 | for (mc_addr = addrs; mc_addr && count-- > 0; mc_addr = mc_addr->next) { | ||
1608 | u_int position = ether_crc(6, mc_addr->dmi_addr); | ||
1609 | #ifndef final_version /* Verify multicast address. */ | ||
1610 | if ((mc_addr->dmi_addr[0] & 1) == 0) | ||
1611 | continue; | ||
1612 | #endif | ||
1613 | multicast_table[position >> 29] |= 1 << ((position >> 26) & 7); | ||
1614 | } | ||
1615 | } | ||
1616 | |||
1617 | /*====================================================================== | ||
1618 | |||
1619 | Set the receive mode. | 1598 | Set the receive mode. |
1620 | 1599 | ||
1621 | This routine is used by both the protocol level to notify us of | 1600 | 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) | |||
1639 | rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti; | 1618 | rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti; |
1640 | else { | 1619 | else { |
1641 | if (!netdev_mc_empty(dev)) { | 1620 | if (!netdev_mc_empty(dev)) { |
1642 | fill_multicast_tbl(netdev_mc_count(dev), dev->mc_list, | 1621 | struct dev_mc_list *mc_addr; |
1643 | (u_char *)multicast_table); | 1622 | |
1623 | netdev_for_each_mc_addr(mc_addr, dev) { | ||
1624 | u_int position = ether_crc(6, mc_addr->dmi_addr); | ||
1625 | #ifndef final_version /* Verify multicast address. */ | ||
1626 | if ((mc_addr->dmi_addr[0] & 1) == 0) | ||
1627 | continue; | ||
1628 | #endif | ||
1629 | multicast_table[position >> 29] |= 1 << ((position >> 26) & 7); | ||
1630 | } | ||
1644 | } | 1631 | } |
1645 | rx_cfg_setting = RxStripCRC | RxEnable; | 1632 | rx_cfg_setting = RxStripCRC | RxEnable; |
1646 | } | 1633 | } |