99db8bf902
Although commit 75ddcd5ad40e ("Bluetooth: btusb: Configure altsetting
for HCI_USER_CHANNEL") has enabled the HCI_USER_CHANNEL user to send out
SCO data through USB Bluetooth chips, it's observed that with the patch
HFP is flaky on most of the existing USB Bluetooth controllers: Intel
chips sometimes send out no packet for Transparent codec; MTK chips may
generate SCO data with a wrong handle for CVSD codec; RTK could split
the data with a wrong packet size for Transparent codec; ... etc.
To address the issue above one needs to reset the altsetting back to
zero when there is no active SCO connection, which is the same as the
BlueZ behavior, and another benefit is the bus doesn't need to reserve
bandwidth when no SCO connection.
This patch adds the infrastructure that allow the user space program to
talk to Bluetooth drivers directly:
- Define the new packet type HCI_DRV_PKT which is specifically used for
communication between the user space program and the Bluetooth drviers
- hci_send_frame intercepts the packets and invokes drivers' HCI Drv
callbacks (so far only defined for btusb)
- 2 kinds of events to user space: Command Status and Command Complete,
the former simply returns the status while the later may contain
additional response data.
Cc: chromeos-bluetooth-upstreaming@chromium.org
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 4a740b78ddf3ce6894779f4526007ad24fbc049a
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master)
Change-Id: I226c67c4230cf6d0f324c2d8c00327ae875283c7
Signed-off-by: Hsin-chen Chuang <chharry@google.com>
29 lines
885 B
Makefile
29 lines
885 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the Linux Bluetooth subsystem.
|
|
#
|
|
|
|
obj-$(CONFIG_BT) += bluetooth.o
|
|
obj-$(CONFIG_BT_RFCOMM) += rfcomm/
|
|
obj-$(CONFIG_BT_BNEP) += bnep/
|
|
obj-$(CONFIG_BT_CMTP) += cmtp/
|
|
obj-$(CONFIG_BT_HIDP) += hidp/
|
|
obj-$(CONFIG_BT_6LOWPAN) += bluetooth_6lowpan.o
|
|
|
|
bluetooth_6lowpan-y := 6lowpan.o
|
|
|
|
bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
|
|
hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o lib.o \
|
|
ecdh_helper.o mgmt_util.o mgmt_config.o hci_codec.o eir.o hci_sync.o \
|
|
hci_drv.o
|
|
|
|
bluetooth-$(CONFIG_DEV_COREDUMP) += coredump.o
|
|
|
|
bluetooth-$(CONFIG_BT_BREDR) += sco.o
|
|
bluetooth-$(CONFIG_BT_LE) += iso.o
|
|
bluetooth-$(CONFIG_BT_LEDS) += leds.o
|
|
bluetooth-$(CONFIG_BT_MSFTEXT) += msft.o
|
|
bluetooth-$(CONFIG_BT_AOSPEXT) += aosp.o
|
|
bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o
|
|
bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o
|