diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-12-22 23:22:00 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-12-23 01:01:35 +0300 |
commit | 76d0685bbac8ae017e5d12eba25fb3c4f0ec77ac (patch) | |
tree | 9ff9ce8ee1bb050ac6072f2b23995dfc61faf544 /net/bluetooth/hci_sync.c | |
parent | 4fc9857ab8c6cfe2152df3288c8cf3300b929f1a (diff) | |
download | linux-76d0685bbac8ae017e5d12eba25fb3c4f0ec77ac.tar.xz |
Bluetooth: MGMT: Fix LE simultaneous roles UUID if not supported
If controller/driver don't support LE simultaneous roles its UUID shall
be omitted when responding to MGMT_OP_READ_EXP_FEATURES_INFO.
This also rework the support introducing HCI_LE_SIMULTANEOUS_ROLES flag
so it can be detected when userspace wants to use or not.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_sync.c')
-rw-r--r-- | net/bluetooth/hci_sync.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 61d8a076a3f3..0feb68f12545 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -5197,12 +5197,12 @@ int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn) /* If requested to connect as peripheral use directed advertising */ if (conn->role == HCI_ROLE_SLAVE) { - /* If we're active scanning and the controller doesn't support - * simultaneous roles simply reject the attempt. + /* If we're active scanning and simultaneous roles is not + * enabled simply reject the attempt. */ if (hci_dev_test_flag(hdev, HCI_LE_SCAN) && hdev->le_scan_type == LE_SCAN_ACTIVE && - !hci_dev_le_state_simultaneous(hdev)) { + !hci_dev_test_flag(hdev, HCI_LE_SIMULTANEOUS_ROLES)) { hci_conn_del(conn); return -EBUSY; } @@ -5214,8 +5214,8 @@ int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn) goto done; } - /* Disable advertising if simultaneous roles is not supported. */ - if (!hci_dev_le_state_simultaneous(hdev)) + /* Disable advertising if simultaneous roles is not in use. */ + if (!hci_dev_test_flag(hdev, HCI_LE_SIMULTANEOUS_ROLES)) hci_pause_advertising_sync(hdev); params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); |