diff options
author | Abhishek Pandit-Subedi <abhishekpandit@chromium.org> | 2020-06-24 20:34:19 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2020-06-24 21:39:27 +0200 |
commit | 3a0377d993d7c62cbff623bce13eac077490f560 (patch) | |
tree | fdcdd98d1aac5c96fc4a814a1ac5ddd879094d4a | |
parent | Bluetooth: btusb: BTUSB_WAKEUP_DISABLE prevents wake (diff) | |
download | linux-3a0377d993d7c62cbff623bce13eac077490f560.tar.xz linux-3a0377d993d7c62cbff623bce13eac077490f560.zip |
Bluetooth: Don't restart scanning if paused
When restarting LE scanning, check if it's currently paused before
enabling passive scanning.
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/bluetooth/hci_request.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 86ae4b953a01..116207009dde 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -819,6 +819,11 @@ static void hci_req_start_scan(struct hci_request *req, u8 type, u16 interval, { struct hci_dev *hdev = req->hdev; + if (hdev->scanning_paused) { + bt_dev_dbg(hdev, "Scanning is paused for suspend"); + return; + } + /* Use ext scanning if set ext scan param and ext scan enable is * supported */ @@ -2657,6 +2662,11 @@ static int le_scan_restart(struct hci_request *req, unsigned long opt) if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) return 0; + if (hdev->scanning_paused) { + bt_dev_dbg(hdev, "Scanning is paused for suspend"); + return 0; + } + hci_req_add_le_scan_disable(req); if (use_ext_scan(hdev)) { |