Bluetooth: Adding driver and quirk defs for multi-role LE
authorAlain Michaud <alainm@chromium.org>
Thu, 23 Apr 2020 14:43:27 +0000 (14:43 +0000)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 28 Apr 2020 09:49:01 +0000 (11:49 +0200)
This change adds the relevant driver and quirk to allow drivers to
report the le_states as being trustworthy.

This has historically been disabled as controllers did not reliably
support this. In particular, this will be used to relax this condition
for controllers that have been well tested and reliable.

/* Most controller will fail if we try to create new connections
 * while we have an existing one in slave role.
 */
if (hdev->conn_hash.le_num_slave > 0)
return NULL;

Signed-off-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c
include/net/bluetooth/hci.h

index 871162790a0ed17dfb5b8e3136460dc58098058f..9a0ac333c88651b8cfc1a31d99947d34cc679412 100644 (file)
@@ -58,6 +58,7 @@ static struct usb_driver btusb_driver;
 #define BTUSB_CW6622           0x100000
 #define BTUSB_MEDIATEK         0x200000
 #define BTUSB_WIDEBAND_SPEECH  0x400000
+#define BTUSB_VALID_LE_STATES   0x800000
 
 static const struct usb_device_id btusb_table[] = {
        /* Generic Bluetooth USB device */
index 1da8cec8e2108b447b3ab884504bf3c1332649cb..e5bc1dfe809ac778e3cc1225846963298fcce50b 100644 (file)
@@ -218,6 +218,15 @@ enum {
         * This quirk must be set before hci_register_dev is called.
         */
        HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
+
+       /* When this quirk is set, the controller has validated that
+        * LE states reported through the HCI_LE_READ_SUPPORTED_STATES are
+        * valid.  This mechanism is necessary as many controllers have
+        * been seen has having trouble initiating a connectable
+        * advertisement despite the state combination being reported as
+        * supported.
+        */
+       HCI_QUIRK_VALID_LE_STATES,
 };
 
 /* HCI device flags */