aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/mgmt.h
diff options
context:
space:
mode:
authorDaniel Winkler <danielwinkler@google.com>2021-03-03 11:15:23 -0800
committerMarcel Holtmann <marcel@holtmann.org>2021-03-03 18:14:38 +0100
commitff02db13e9bfa01e0d66c5fa53da29bd1f1b208a (patch)
tree7b7ca51623eb72558ce72fdc128e9ce17493ab55 /include/net/bluetooth/mgmt.h
parentBluetooth: Remove unneeded commands for suspend (diff)
downloadlinux-dev-ff02db13e9bfa01e0d66c5fa53da29bd1f1b208a.tar.xz
linux-dev-ff02db13e9bfa01e0d66c5fa53da29bd1f1b208a.zip
Bluetooth: Allow scannable adv with extended MGMT APIs
An issue was found, where if a bluetooth client requests a broadcast advertisement with scan response data, it will not be properly registered with the controller. This is because at the time that the hci_cp_le_set_scan_param structure is created, the scan response will not yet have been received since it comes in a second MGMT call. With empty scan response, the request defaults to a non-scannable PDU type. On some controllers, the subsequent scan response request will fail due to incorrect PDU type, and others will succeed and not use the scan response. This fix allows the advertising parameters MGMT call to include a flag to let the kernel know whether a scan response will be coming, so that the correct PDU type is used in the first place. A bluetoothd change is also incoming to take advantage of it. To test this, I created a broadcast advertisement with scan response data and registered it on the hatch chromebook. Without this change, the request fails, and with it will succeed. Reviewed-by: Alain Michaud <alainm@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Signed-off-by: Daniel Winkler <danielwinkler@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/bluetooth/mgmt.h')
-rw-r--r--include/net/bluetooth/mgmt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 839a2028009e..a7cffb069565 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -578,6 +578,7 @@ struct mgmt_rp_add_advertising {
#define MGMT_ADV_PARAM_TIMEOUT BIT(13)
#define MGMT_ADV_PARAM_INTERVALS BIT(14)
#define MGMT_ADV_PARAM_TX_POWER BIT(15)
+#define MGMT_ADV_PARAM_SCAN_RSP BIT(16)
#define MGMT_ADV_FLAG_SEC_MASK (MGMT_ADV_FLAG_SEC_1M | MGMT_ADV_FLAG_SEC_2M | \
MGMT_ADV_FLAG_SEC_CODED)