Re: [PATCH 3/3] Bluetooth: btusb: Add BTUSB_BROKEN_ENHANCED_SETUP_SCO flag

Marcel Holtmann
2022-03-04T09:51:40Z

Hi Luiz,

> This adds BTUSB_BROKEN_ENHANCED_SETUP_SCO flag which can be used to set
> HCI_QUIRK_BROKEN_ENHANCED_SETUP_SCO disabling the use of
> HCI_OP_ENHANCED_SETUP_SYNC_CONN command.
>
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> drivers/bluetooth/btusb.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 34d008380fdb..d09a6a712632 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -63,6 +63,7 @@ static struct usb_driver btusb_driver;
> #define BTUSB_INTEL_BROKEN_SHUTDOWN_LED BIT(24)
> #define BTUSB_INTEL_BROKEN_INITIAL_NCMD BIT(25)
> #define BTUSB_INTEL_NO_WBS_SUPPORT BIT(26)
> +#define BTUSB_BROKEN_ENHANCED_SETUP_SCO BIT(27)
>
> static const struct usb_device_id btusb_table[] = {
> /* Generic Bluetooth USB device */
> @@ -3848,6 +3849,9 @@ static int btusb_probe(struct usb_interface *intf,
> set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
> }
>
> + if (id->driver_info & BTUSB_BROKEN_ENHANCED_SETUP_SCO)
> + set_bit(HCI_QUIRK_BROKEN_ENHANCED_SETUP_SCO, &hdev->quirks);
> +
> if (id->driver_info & BTUSB_CSR) {
> struct usb_device *udev = data->udev;
> u16 bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice);

I am only adding this if I see the need to do this via USB VID/PID. Most drivers should make the decision on the vendor setup callback. Or FIX their broken firmware.

Regards

Marcel