aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/smsc95xx.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-17 23:02:26 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-18 17:47:50 -0500
commita92635dc77b14f0f28d45c0fbf91b5064d9d7617 (patch)
treeefc3a7a9a4b559614e56339aaa26171495bfb0c9 /drivers/net/usb/smsc95xx.c
parent4302b67e041ea81c8fc233bee1296516e1294a27 (diff)
net/usb: convert to use netdev_for_each_mc_addr
also removed needless checks in smsc95xx Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/smsc95xx.c')
-rw-r--r--drivers/net/usb/smsc95xx.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 1ada51eb71f7..df9179a1c93b 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -384,30 +384,20 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
384 pdata->mac_cr |= MAC_CR_MCPAS_; 384 pdata->mac_cr |= MAC_CR_MCPAS_;
385 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); 385 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
386 } else if (!netdev_mc_empty(dev->net)) { 386 } else if (!netdev_mc_empty(dev->net)) {
387 struct dev_mc_list *mc_list = dev->net->mc_list; 387 struct dev_mc_list *mc_list;
388 int count = 0;
389 388
390 pdata->mac_cr |= MAC_CR_HPFILT_; 389 pdata->mac_cr |= MAC_CR_HPFILT_;
391 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_); 390 pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_);
392 391
393 while (mc_list) { 392 netdev_for_each_mc_addr(mc_list, netdev) {
394 count++; 393 u32 bitnum = smsc95xx_hash(mc_list->dmi_addr);
395 if (mc_list->dmi_addrlen == ETH_ALEN) { 394 u32 mask = 0x01 << (bitnum & 0x1F);
396 u32 bitnum = smsc95xx_hash(mc_list->dmi_addr); 395 if (bitnum & 0x20)
397 u32 mask = 0x01 << (bitnum & 0x1F); 396 hash_hi |= mask;
398 if (bitnum & 0x20) 397 else
399 hash_hi |= mask; 398 hash_lo |= mask;
400 else
401 hash_lo |= mask;
402 } else {
403 netdev_warn(dev->net, "dmi_addrlen != 6\n");
404 }
405 mc_list = mc_list->next;
406 } 399 }
407 400
408 if (count != ((u32) netdev_mc_count(dev->net)))
409 netdev_warn(dev->net, "mc_count != dev->mc_count\n");
410
411 netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n", 401 netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n",
412 hash_hi, hash_lo); 402 hash_hi, hash_lo);
413 } else { 403 } else {