aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-02-27 02:35:45 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-28 04:44:01 -0500
commit655ffee284dfcf9a24ac0343f3e5ee6db85b85c5 (patch)
tree83ac4727338e0565baae5bbe9ac8dfa57c69c545 /drivers/net/wireless/libertas
parent9675478bbafed08848bf8d7e28400d5e46330b23 (diff)
wireless: convert to use netdev_for_each_mc_addr
also added missed locking in rndis_wlan.c Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index cd8ed7fdafad..28a1c9d1627a 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -319,15 +319,18 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
319{ 319{
320 int i = nr_addrs; 320 int i = nr_addrs;
321 struct dev_mc_list *mc_list; 321 struct dev_mc_list *mc_list;
322 int cnt;
322 323
323 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST)) 324 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST))
324 return nr_addrs; 325 return nr_addrs;
325 326
326 netif_addr_lock_bh(dev); 327 netif_addr_lock_bh(dev);
327 for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) { 328 cnt = netdev_mc_count(dev);
329 netdev_for_each_mc_addr(mc_list, dev) {
328 if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) { 330 if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) {
329 lbs_deb_net("mcast address %s:%pM skipped\n", dev->name, 331 lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
330 mc_list->dmi_addr); 332 mc_list->dmi_addr);
333 cnt--;
331 continue; 334 continue;
332 } 335 }
333 336
@@ -337,9 +340,10 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
337 lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name, 340 lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
338 mc_list->dmi_addr); 341 mc_list->dmi_addr);
339 i++; 342 i++;
343 cnt--;
340 } 344 }
341 netif_addr_unlock_bh(dev); 345 netif_addr_unlock_bh(dev);
342 if (mc_list) 346 if (cnt)
343 return -EOVERFLOW; 347 return -EOVERFLOW;
344 348
345 return i; 349 return i;