]> Gentwo Git Trees - linux/.git/commitdiff
Bluetooth: Always allow SCO packets for user channel
authorHsin-chen Chuang <chharry@chromium.org>
Fri, 14 Feb 2025 11:17:09 +0000 (19:17 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 20 Feb 2025 18:13:29 +0000 (13:13 -0500)
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>
drivers/bluetooth/btusb.c

index 1caf7a071a736aad31d316a77112c2955083e5b2..de3fa725d210623312d3f67a7db33bdf7b4e4b62 100644 (file)
@@ -2130,7 +2130,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);
@@ -2604,7 +2605,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);