aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/bnep/netdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/bnep/netdev.c')
-rw-r--r--net/bluetooth/bnep/netdev.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c
index 26fb831ef7e0..8c100c9dae28 100644
--- a/net/bluetooth/bnep/netdev.c
+++ b/net/bluetooth/bnep/netdev.c
@@ -26,6 +26,7 @@
26*/ 26*/
27 27
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/slab.h>
29 30
30#include <linux/socket.h> 31#include <linux/socket.h>
31#include <linux/netdevice.h> 32#include <linux/netdevice.h>
@@ -64,7 +65,7 @@ static void bnep_net_set_mc_list(struct net_device *dev)
64 struct sk_buff *skb; 65 struct sk_buff *skb;
65 int size; 66 int size;
66 67
67 BT_DBG("%s mc_count %d", dev->name, dev->mc_count); 68 BT_DBG("%s mc_count %d", dev->name, netdev_mc_count(dev));
68 69
69 size = sizeof(*r) + (BNEP_MAX_MULTICAST_FILTERS + 1) * ETH_ALEN * 2; 70 size = sizeof(*r) + (BNEP_MAX_MULTICAST_FILTERS + 1) * ETH_ALEN * 2;
70 skb = alloc_skb(size, GFP_ATOMIC); 71 skb = alloc_skb(size, GFP_ATOMIC);
@@ -87,7 +88,7 @@ static void bnep_net_set_mc_list(struct net_device *dev)
87 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN); 88 memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN);
88 r->len = htons(ETH_ALEN * 2); 89 r->len = htons(ETH_ALEN * 2);
89 } else { 90 } else {
90 struct dev_mc_list *dmi = dev->mc_list; 91 struct netdev_hw_addr *ha;
91 int i, len = skb->len; 92 int i, len = skb->len;
92 93
93 if (dev->flags & IFF_BROADCAST) { 94 if (dev->flags & IFF_BROADCAST) {
@@ -97,16 +98,20 @@ static void bnep_net_set_mc_list(struct net_device *dev)
97 98
98 /* FIXME: We should group addresses here. */ 99 /* FIXME: We should group addresses here. */
99 100
100 for (i = 0; i < dev->mc_count && i < BNEP_MAX_MULTICAST_FILTERS; i++) { 101 i = 0;
101 memcpy(__skb_put(skb, ETH_ALEN), dmi->dmi_addr, ETH_ALEN); 102 netdev_for_each_mc_addr(ha, dev) {
102 memcpy(__skb_put(skb, ETH_ALEN), dmi->dmi_addr, ETH_ALEN); 103 if (i == BNEP_MAX_MULTICAST_FILTERS)
103 dmi = dmi->next; 104 break;
105 memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
106 memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
107
108 i++;
104 } 109 }
105 r->len = htons(skb->len - len); 110 r->len = htons(skb->len - len);
106 } 111 }
107 112
108 skb_queue_tail(&sk->sk_write_queue, skb); 113 skb_queue_tail(&sk->sk_write_queue, skb);
109 wake_up_interruptible(sk->sk_sleep); 114 wake_up_interruptible(sk_sleep(sk));
110#endif 115#endif
111} 116}
112 117
@@ -190,11 +195,11 @@ static netdev_tx_t bnep_net_xmit(struct sk_buff *skb,
190 /* 195 /*
191 * We cannot send L2CAP packets from here as we are potentially in a bh. 196 * We cannot send L2CAP packets from here as we are potentially in a bh.
192 * So we have to queue them and wake up session thread which is sleeping 197 * So we have to queue them and wake up session thread which is sleeping
193 * on the sk->sk_sleep. 198 * on the sk_sleep(sk).
194 */ 199 */
195 dev->trans_start = jiffies; 200 dev->trans_start = jiffies;
196 skb_queue_tail(&sk->sk_write_queue, skb); 201 skb_queue_tail(&sk->sk_write_queue, skb);
197 wake_up_interruptible(sk->sk_sleep); 202 wake_up_interruptible(sk_sleep(sk));
198 203
199 if (skb_queue_len(&sk->sk_write_queue) >= BNEP_TX_QUEUE_LEN) { 204 if (skb_queue_len(&sk->sk_write_queue) >= BNEP_TX_QUEUE_LEN) {
200 BT_DBG("tx queue is full"); 205 BT_DBG("tx queue is full");