Skip to content

Commit 581d6fd

Browse files
committed
Bluetooth: Queue diagnostic messages together with HCI packets
Sending diagnostic messages directly to the monitor socket might cause issues for devices processing their messages in interrupt context. So instead of trying to directly forward them, queue them up with the other HCI packets and lets them be processed by the sockets at the same time. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent bb77543 commit 581d6fd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

net/bluetooth/hci_core.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3555,14 +3555,15 @@ EXPORT_SYMBOL(hci_recv_frame);
35553555
/* Receive diagnostic message from HCI drivers */
35563556
int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb)
35573557
{
3558+
/* Mark as diagnostic packet */
3559+
bt_cb(skb)->pkt_type = HCI_DIAG_PKT;
3560+
35583561
/* Time stamp */
35593562
__net_timestamp(skb);
35603563

3561-
/* Mark as diagnostic packet and send to monitor */
3562-
bt_cb(skb)->pkt_type = HCI_DIAG_PKT;
3563-
hci_send_to_monitor(hdev, skb);
3564+
skb_queue_tail(&hdev->rx_q, skb);
3565+
queue_work(hdev->workqueue, &hdev->rx_work);
35643566

3565-
kfree_skb(skb);
35663567
return 0;
35673568
}
35683569
EXPORT_SYMBOL(hci_recv_diag);

0 commit comments

Comments
 (0)