public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Always allow SCO packets for user channel
@ 2025-02-14 11:17 Hsin-chen Chuang
  2025-02-18  1:32 ` Hsin-chen Chuang
  2025-02-18 15:40 ` patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Hsin-chen Chuang @ 2025-02-14 11:17 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz
  Cc: chromeos-bluetooth-upstreaming, Hsin-chen Chuang, Marcel Holtmann,
	Ying Hsu, linux-kernel

From: Hsin-chen Chuang <chharry@chromium.org>

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>
---

 drivers/bluetooth/btusb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 1caf7a071a73..de3fa725d210 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -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);
-- 
2.48.1.601.g30ceb7b040-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: Always allow SCO packets for user channel
  2025-02-14 11:17 [PATCH] Bluetooth: Always allow SCO packets for user channel Hsin-chen Chuang
@ 2025-02-18  1:32 ` Hsin-chen Chuang
  2025-02-18 15:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: Hsin-chen Chuang @ 2025-02-18  1:32 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz
  Cc: chromeos-bluetooth-upstreaming, Hsin-chen Chuang, Marcel Holtmann,
	Ying Hsu, linux-kernel

Hi Luiz,

On Fri, Feb 14, 2025 at 7:17 PM Hsin-chen Chuang <chharry@google.com> wrote:
>
> From: Hsin-chen Chuang <chharry@chromium.org>
>
> 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>
> ---
>
>  drivers/bluetooth/btusb.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 1caf7a071a73..de3fa725d210 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -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);
> --
> 2.48.1.601.g30ceb7b040-goog
>

Friendly ping for review, thanks.

-- 
Best Regards,
Hsin-chen

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: Always allow SCO packets for user channel
  2025-02-14 11:17 [PATCH] Bluetooth: Always allow SCO packets for user channel Hsin-chen Chuang
  2025-02-18  1:32 ` Hsin-chen Chuang
@ 2025-02-18 15:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-02-18 15:40 UTC (permalink / raw)
  To: Hsin-chen Chuang
  Cc: linux-bluetooth, luiz.dentz, chromeos-bluetooth-upstreaming,
	chharry, marcel, yinghsu, linux-kernel

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 14 Feb 2025 19:17:09 +0800 you wrote:
> From: Hsin-chen Chuang <chharry@chromium.org>
> 
> 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>
> 
> [...]

Here is the summary with links:
  - Bluetooth: Always allow SCO packets for user channel
    https://git.kernel.org/bluetooth/bluetooth-next/c/eafcfcfca97d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-18 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14 11:17 [PATCH] Bluetooth: Always allow SCO packets for user channel Hsin-chen Chuang
2025-02-18  1:32 ` Hsin-chen Chuang
2025-02-18 15:40 ` patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox