|
@@ -231,6 +231,39 @@ void hci_send_to_channel(unsigned short channel, struct sk_buff *skb,
|
|
|
read_unlock(&hci_sk_list.lock);
|
|
|
}
|
|
|
|
|
|
+/* Send frame to sockets with specific channel flag set */
|
|
|
+void hci_send_to_flagged_channel(unsigned short channel, struct sk_buff *skb,
|
|
|
+ int flag)
|
|
|
+{
|
|
|
+ struct sock *sk;
|
|
|
+
|
|
|
+ BT_DBG("channel %u len %d", channel, skb->len);
|
|
|
+
|
|
|
+ read_lock(&hci_sk_list.lock);
|
|
|
+
|
|
|
+ sk_for_each(sk, &hci_sk_list.head) {
|
|
|
+ struct sk_buff *nskb;
|
|
|
+
|
|
|
+ if (!test_bit(flag, &hci_pi(sk)->flags))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ if (sk->sk_state != BT_BOUND)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ if (hci_pi(sk)->channel != channel)
|
|
|
+ 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)
|
|
|
{
|