aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rndis_wlan.c
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/rndis_wlan.c
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/rndis_wlan.c')
-rw-r--r--drivers/net/wireless/rndis_wlan.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 65cbd060cc30..9f6d6bf06b8e 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1502,6 +1502,7 @@ static void set_multicast_list(struct usbnet *usbdev)
1502 1502
1503 filter = RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST; 1503 filter = RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST;
1504 1504
1505 netif_addr_lock_bh(usbdev->net);
1505 if (usbdev->net->flags & IFF_PROMISC) { 1506 if (usbdev->net->flags & IFF_PROMISC) {
1506 filter |= RNDIS_PACKET_TYPE_PROMISCUOUS | 1507 filter |= RNDIS_PACKET_TYPE_PROMISCUOUS |
1507 RNDIS_PACKET_TYPE_ALL_LOCAL; 1508 RNDIS_PACKET_TYPE_ALL_LOCAL;
@@ -1515,16 +1516,15 @@ static void set_multicast_list(struct usbnet *usbdev)
1515 netdev_warn(usbdev->net, 1516 netdev_warn(usbdev->net,
1516 "couldn't alloc %d bytes of memory\n", 1517 "couldn't alloc %d bytes of memory\n",
1517 size * ETH_ALEN); 1518 size * ETH_ALEN);
1519 netif_addr_unlock_bh(usbdev->net);
1518 return; 1520 return;
1519 } 1521 }
1520 1522
1521 mclist = usbdev->net->mc_list; 1523 i = 0;
1522 for (i = 0; i < size && mclist; mclist = mclist->next) { 1524 netdev_for_each_mc_addr(mclist, usbdev->net) {
1523 if (mclist->dmi_addrlen != ETH_ALEN) 1525 if (i == size)
1524 continue; 1526 break;
1525 1527 memcpy(buf + i++ * ETH_ALEN, mclist->dmi_addr, ETH_ALEN);
1526 memcpy(buf + i * ETH_ALEN, mclist->dmi_addr, ETH_ALEN);
1527 i++;
1528 } 1528 }
1529 1529
1530 ret = rndis_set_oid(usbdev, OID_802_3_MULTICAST_LIST, buf, 1530 ret = rndis_set_oid(usbdev, OID_802_3_MULTICAST_LIST, buf,
@@ -1539,6 +1539,7 @@ static void set_multicast_list(struct usbnet *usbdev)
1539 1539
1540 kfree(buf); 1540 kfree(buf);
1541 } 1541 }
1542 netif_addr_unlock_bh(usbdev->net);
1542 1543
1543 ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, 1544 ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter,
1544 sizeof(filter)); 1545 sizeof(filter));