FROMGIT: 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: b16b327edb4d ("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>

Bug: 387425332
(cherry picked from commit 980d6e2904dfc053df685bd200adeca5aaa13dca
 https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master)
Change-Id: I808eda628aecdcb6c07263e09901b0ee7e24d6a9
Signed-off-by: Hsin-chen Chuang <chharry@google.com>
This commit is contained in:
Hsin-chen Chuang
2025-02-14 19:17:09 +08:00
committed by Todd Kjos
parent ef85a85df4
commit 959520b027
+4 -2
View File
@@ -2089,7 +2089,8 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
return submit_or_queue_tx_urb(hdev, urb);
case HCI_SCODATA_PKT:
if (hci_conn_num(hdev, SCO_LINK) < 1)
if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
hci_conn_num(hdev, SCO_LINK) < 1)
return -ENODEV;
urb = alloc_isoc_urb(hdev, skb);
@@ -2563,7 +2564,8 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb)
return submit_or_queue_tx_urb(hdev, urb);
case HCI_SCODATA_PKT:
if (hci_conn_num(hdev, SCO_LINK) < 1)
if (!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
hci_conn_num(hdev, SCO_LINK) < 1)
return -ENODEV;
urb = alloc_isoc_urb(hdev, skb);