diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-10-27 16:58:43 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-10-29 16:51:58 +0200 |
commit | 5bee2fd6bcaaaa9f8f415afc48ed8c1083d8a303 (patch) | |
tree | 25194582f016c69832425b61e1179a19ffb73244 /net/bluetooth/hci_sync.c | |
parent | Bluetooth: hci_sync: Enable advertising when LL privacy is enabled (diff) | |
download | wireguard-linux-5bee2fd6bcaaaa9f8f415afc48ed8c1083d8a303.tar.xz wireguard-linux-5bee2fd6bcaaaa9f8f415afc48ed8c1083d8a303.zip |
Bluetooth: hci_sync: Rework background scan
This replaces the use of hci_update_background_scan with
hci_update_passive_scan which runs from cmd_work_sync and deal properly
with resolving list when LL privacy is enabled.
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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index c9aba2fd0301..6d53a876de85 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -2029,5 +2029,14 @@ static int update_passive_scan_sync(struct hci_dev *hdev, void *data) int hci_update_passive_scan(struct hci_dev *hdev) { + /* Only queue if it would have any effect */ + if (!test_bit(HCI_UP, &hdev->flags) || + test_bit(HCI_INIT, &hdev->flags) || + hci_dev_test_flag(hdev, HCI_SETUP) || + hci_dev_test_flag(hdev, HCI_CONFIG) || + hci_dev_test_flag(hdev, HCI_AUTO_OFF) || + hci_dev_test_flag(hdev, HCI_UNREGISTER)) + return 0; + return hci_cmd_sync_queue(hdev, update_passive_scan_sync, NULL, NULL); } |