summaryrefslogtreecommitdiff
path: root/drivers/net/tulip/de4x5.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-18 03:34:54 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-18 14:47:50 -0800
commit4302b67e041ea81c8fc233bee1296516e1294a27 (patch)
treec6160bcf70f321c7436f34033d39180c9043bfd9 /drivers/net/tulip/de4x5.c
parent5508590c193661bc1484ad7b952af5fceacea40d (diff)
tulip: convert to use netdev_for_each_mc_addr
also bug in de2104x.c was corrected: for (i = 0; i < 32; i++) loop should be outside mc_list iteration. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip/de4x5.c')
-rw-r--r--drivers/net/tulip/de4x5.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 0b6a9731091c..c4ecb9a95409 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1951,9 +1951,9 @@ static void
SetMulticastFilter(struct net_device *dev)
{
struct de4x5_private *lp = netdev_priv(dev);
- struct dev_mc_list *dmi=dev->mc_list;
+ struct dev_mc_list *dmi;
u_long iobase = dev->base_addr;
- int i, j, bit, byte;
+ int i, bit, byte;
u16 hashcode;
u32 omr, crc;
char *pa;
@@ -1966,9 +1966,8 @@ SetMulticastFilter(struct net_device *dev)
if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 14)) {
omr |= OMR_PM; /* Pass all multicasts */
} else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */
- for (i = 0; i < netdev_mc_count(dev) ;i++) {
- addrs=dmi->dmi_addr;
- dmi=dmi->next;
+ netdev_for_each_mc_addr(dmi, dev) {
+ addrs = dmi->dmi_addr;
if ((*addrs & 0x01) == 1) { /* multicast address? */
crc = ether_crc_le(ETH_ALEN, addrs);
hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */
@@ -1984,9 +1983,8 @@ SetMulticastFilter(struct net_device *dev)
}
}
} else { /* Perfect filtering */
- for (j=0; j<netdev_mc_count(dev); j++) {
- addrs=dmi->dmi_addr;
- dmi=dmi->next;
+ netdev_for_each_mc_addr(dmi, dev) {
+ addrs = dmi->dmi_addr;
for (i=0; i<ETH_ALEN; i++) {
*(pa + (i&1)) = *addrs++;
if (i & 0x01) pa += 4;