aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-02-20 06:26:24 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-02-20 12:20:17 -0500
commit03f310efd4b19ddc2cca15ae67f48295554adbfe (patch)
treef3465be27b73d6a9a441fa5261e3c0dc3b0d6b2e /net/bluetooth
parent7129069e84056ba28954550beb208b2645863299 (diff)
Bluetooth: Remove unnecessary queue_monitor_skb() function
Now that there's the general purpose hci_send_to_channel() API it will do the exact same thing as queue_monitor_skb() when passed the monitor HCI channel. This patch removes queue_monitor_skb() and replaces any users of it with calls to hci_send_to_channel(). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_sock.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index ba5d45f8aac1..c73a61ce4893 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -217,34 +217,6 @@ void hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
217 read_unlock(&hci_sk_list.lock); 217 read_unlock(&hci_sk_list.lock);
218} 218}
219 219
220static void queue_monitor_skb(struct sk_buff *skb)
221{
222 struct sock *sk;
223
224 BT_DBG("len %d", skb->len);
225
226 read_lock(&hci_sk_list.lock);
227
228 sk_for_each(sk, &hci_sk_list.head) {
229 struct sk_buff *nskb;
230
231 if (sk->sk_state != BT_BOUND)
232 continue;
233
234 if (hci_pi(sk)->channel != HCI_CHANNEL_MONITOR)
235 continue;
236
237 nskb = skb_clone(skb, GFP_ATOMIC);
238 if (!nskb)
239 continue;
240
241 if (sock_queue_rcv_skb(sk, nskb))
242 kfree_skb(nskb);
243 }
244
245 read_unlock(&hci_sk_list.lock);
246}
247
248/* Send frame to monitor socket */ 220/* Send frame to monitor socket */
249void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb) 221void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb)
250{ 222{
@@ -291,7 +263,7 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb)
291 hdr->index = cpu_to_le16(hdev->id); 263 hdr->index = cpu_to_le16(hdev->id);
292 hdr->len = cpu_to_le16(skb->len); 264 hdr->len = cpu_to_le16(skb->len);
293 265
294 queue_monitor_skb(skb_copy); 266 hci_send_to_channel(HCI_CHANNEL_MONITOR, skb_copy, NULL);
295 kfree_skb(skb_copy); 267 kfree_skb(skb_copy);
296} 268}
297 269
@@ -398,7 +370,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event)
398 370
399 skb = create_monitor_event(hdev, event); 371 skb = create_monitor_event(hdev, event);
400 if (skb) { 372 if (skb) {
401 queue_monitor_skb(skb); 373 hci_send_to_channel(HCI_CHANNEL_MONITOR, skb, NULL);
402 kfree_skb(skb); 374 kfree_skb(skb);
403 } 375 }
404 } 376 }