All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alain Michaud <alainm@chromium.org>
To: linux-bluetooth@vger.kernel.org
Cc: Alain Michaud <alainm@chromium.org>
Subject: [PATCH v3 1/3] bluetooth:Adding driver and quirk defs for multi-role LE
Date: Thu, 23 Apr 2020 14:43:27 +0000	[thread overview]
Message-ID: <20200423144328.82478-2-alainm@chromium.org> (raw)
In-Reply-To: <20200423144328.82478-1-alainm@chromium.org>

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

 drivers/bluetooth/btusb.c   | 2 +-
 include/net/bluetooth/hci.h | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 3bdec42c9612..dd27e28d4601 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -58,7 +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 */
 	{ USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 5f60e135aeb6..25c2e5ee81dc 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -214,6 +214,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 */
-- 
2.26.1.301.g55bc3eb7cb9-goog


  reply	other threads:[~2020-04-23 14:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 14:43 [PATCH v3 0/3] bluetooth:Adding driver and quirk defs for multi-role LE Alain Michaud
2020-04-23 14:43 ` Alain Michaud [this message]
2020-04-28  9:29   ` [PATCH v3 1/3] " Marcel Holtmann
2020-04-23 14:43 ` [PATCH v3 2/3] bluetooth:allow scatternet connections if supported Alain Michaud
2020-04-23 14:43 ` [PATCH v3 3/3] bluetooth:btusb: Adding support for LE scatternet to Jfp and ThP Alain Michaud
2020-04-27 14:52 ` [PATCH v3 0/3] bluetooth:Adding driver and quirk defs for multi-role LE Alain Michaud
  -- strict thread matches above, loose matches on Subject: below --
2020-04-21 15:59 Alain Michaud
2020-04-21 15:59 ` [PATCH v3 1/3] " Alain Michaud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200423144328.82478-2-alainm@chromium.org \
    --to=alainm@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.