]> www.infradead.org Git - users/willy/pagecache.git/commit
Bluetooth: btusb: Configure altsetting for HCI_USER_CHANNEL
authorHsin-chen Chuang <chharry@chromium.org>
Thu, 27 Feb 2025 17:14:10 +0000 (01:14 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 7 Mar 2025 17:43:27 +0000 (12:43 -0500)
commit75ddcd5ad40ecd9fbc9f5a7a2ed0e1e74921db3c
tree2886d1050b7905b09d900cb89e40e62d13e94c2a
parentfc14f9c02639dfbfe3529850eae23aef077939a6
Bluetooth: btusb: Configure altsetting for HCI_USER_CHANNEL

Automatically configure the altsetting for HCI_USER_CHANNEL when a SCO
is connected.

The motivation is to enable the HCI_USER_CHANNEL user to send out SCO
data through USB Bluetooth chips, which is mainly used for bidirectional
audio transfer (voice call). This was not capable because:

- Per Bluetooth Core Spec v5, Vol 4, Part B, 2.1, the corresponding
  alternate setting should be set based on the air mode in order to
  transfer SCO data, but
- The Linux Bluetooth HCI_USER_CHANNEL exposes the Bluetooth Host
  Controller Interface to the user space, which is something above the
  USB layer. The user space is not able to configure the USB alt while
  keeping the channel open.

This patch intercepts the HCI_EV_SYNC_CONN_COMPLETE packets in btusb,
extracts the air mode, and configures the alt setting in btusb.

This patch is tested on ChromeOS devices. The USB Bluetooth models
(CVSD, TRANS alt3 and alt6) could work without a customized kernel.

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/Kconfig
drivers/bluetooth/btusb.c