Skip to content

Commit bd30e8d

Browse files
Hsin-chen ChuangVudentz
authored andcommitted
Bluetooth: Always allow SCO packets for user channel
The SCO packets from Bluetooth raw socket are now rejected because hci_conn_num is left 0. This patch allows such the usecase to enable the userspace SCO support. Fixes: b16b327 ("Bluetooth: btusb: add sysfs attribute to control USB alt setting") Signed-off-by: Hsin-chen Chuang <chharry@chromium.org> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent dd3188d commit bd30e8d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/bluetooth/btusb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,8 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
21022102
return submit_or_queue_tx_urb(hdev, urb);
21032103

21042104
case HCI_SCODATA_PKT:
2105-
if (hci_conn_num(hdev, SCO_LINK) < 1)
2105+
if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
2106+
hci_conn_num(hdev, SCO_LINK) < 1)
21062107
return -ENODEV;
21072108

21082109
urb = alloc_isoc_urb(hdev, skb);
@@ -2576,7 +2577,8 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb)
25762577
return submit_or_queue_tx_urb(hdev, urb);
25772578

25782579
case HCI_SCODATA_PKT:
2579-
if (hci_conn_num(hdev, SCO_LINK) < 1)
2580+
if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
2581+
hci_conn_num(hdev, SCO_LINK) < 1)
25802582
return -ENODEV;
25812583

25822584
urb = alloc_isoc_urb(hdev, skb);

0 commit comments

Comments
 (0)