diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-02-20 13:26:24 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-02-20 18:20:17 +0100 |
commit | 03f310efd4b19ddc2cca15ae67f48295554adbfe (patch) | |
tree | f3465be27b73d6a9a441fa5261e3c0dc3b0d6b2e /net/bluetooth/hci_sock.c | |
parent | 7129069e84056ba28954550beb208b2645863299 (diff) | |
download | op-kernel-dev-03f310efd4b19ddc2cca15ae67f48295554adbfe.zip op-kernel-dev-03f310efd4b19ddc2cca15ae67f48295554adbfe.tar.gz |
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/hci_sock.c')
-rw-r--r-- | net/bluetooth/hci_sock.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index ba5d45f..c73a61c 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, read_unlock(&hci_sk_list.lock); } -static void queue_monitor_skb(struct sk_buff *skb) -{ - struct sock *sk; - - BT_DBG("len %d", skb->len); - - read_lock(&hci_sk_list.lock); - - sk_for_each(sk, &hci_sk_list.head) { - struct sk_buff *nskb; - - if (sk->sk_state != BT_BOUND) - continue; - - if (hci_pi(sk)->channel != HCI_CHANNEL_MONITOR) - continue; - - nskb = skb_clone(skb, GFP_ATOMIC); - if (!nskb) - continue; - - if (sock_queue_rcv_skb(sk, nskb)) - kfree_skb(nskb); - } - - read_unlock(&hci_sk_list.lock); -} - /* Send frame to monitor socket */ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb) { @@ -291,7 +263,7 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb) hdr->index = cpu_to_le16(hdev->id); hdr->len = cpu_to_le16(skb->len); - queue_monitor_skb(skb_copy); + hci_send_to_channel(HCI_CHANNEL_MONITOR, skb_copy, NULL); kfree_skb(skb_copy); } @@ -398,7 +370,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event) skb = create_monitor_event(hdev, event); if (skb) { - queue_monitor_skb(skb); + hci_send_to_channel(HCI_CHANNEL_MONITOR, skb, NULL); kfree_skb(skb); } } |