aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/smsc911x.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-17 18:22:38 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-18 17:47:48 -0500
commit2a0d18f97cc15d57ad0c93259a3df4cb72c5a28b (patch)
tree8241c14e24223072ddeb68fcfe8b2aea37c2deab /drivers/net/smsc911x.c
parent59ce25d9eb2e17b901a404766f9e134759407d26 (diff)
smsc911x: convert to use netdev_for_each_mc_addr
also removed unnecessary checks Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/smsc911x.c')
-rw-r--r--drivers/net/smsc911x.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 13c0b76dec41..4fd1d8b38788 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1383,29 +1383,20 @@ static void smsc911x_set_multicast_list(struct net_device *dev)
1383 /* Enabling specific multicast addresses */ 1383 /* Enabling specific multicast addresses */
1384 unsigned int hash_high = 0; 1384 unsigned int hash_high = 0;
1385 unsigned int hash_low = 0; 1385 unsigned int hash_low = 0;
1386 unsigned int count = 0; 1386 struct dev_mc_list *mc_list;
1387 struct dev_mc_list *mc_list = dev->mc_list;
1388 1387
1389 pdata->set_bits_mask = MAC_CR_HPFILT_; 1388 pdata->set_bits_mask = MAC_CR_HPFILT_;
1390 pdata->clear_bits_mask = (MAC_CR_PRMS_ | MAC_CR_MCPAS_); 1389 pdata->clear_bits_mask = (MAC_CR_PRMS_ | MAC_CR_MCPAS_);
1391 1390
1392 while (mc_list) { 1391 netdev_for_each_mc_addr(mc_list, dev) {
1393 count++; 1392 unsigned int bitnum = smsc911x_hash(mc_list->dmi_addr);
1394 if ((mc_list->dmi_addrlen) == ETH_ALEN) { 1393 unsigned int mask = 0x01 << (bitnum & 0x1F);
1395 unsigned int bitnum = 1394
1396 smsc911x_hash(mc_list->dmi_addr); 1395 if (bitnum & 0x20)
1397 unsigned int mask = 0x01 << (bitnum & 0x1F); 1396 hash_high |= mask;
1398 if (bitnum & 0x20) 1397 else
1399 hash_high |= mask; 1398 hash_low |= mask;
1400 else
1401 hash_low |= mask;
1402 } else {
1403 SMSC_WARNING(DRV, "dmi_addrlen != 6");
1404 }
1405 mc_list = mc_list->next;
1406 } 1399 }
1407 if (count != (unsigned int)netdev_mc_count(dev))
1408 SMSC_WARNING(DRV, "mc_count != dev->mc_count");
1409 1400
1410 pdata->hashhi = hash_high; 1401 pdata->hashhi = hash_high;
1411 pdata->hashlo = hash_low; 1402 pdata->hashlo = hash_low;