Bluetooth: Handle active scan case
authorHoward Chung <howardchung@google.com>
Thu, 26 Nov 2020 04:22:23 +0000 (12:22 +0800)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 7 Dec 2020 15:00:52 +0000 (17:00 +0200)
This patch adds code to handle the active scan during interleave
scan. The interleave scan will be canceled when users start active scan,
and it will be restarted after active scan stopped.

Signed-off-by: Howard Chung <howardchung@google.com>
Reviewed-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Manish Mandlik <mmandlik@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_request.c

index 8addb94..0c326e3 100644 (file)
@@ -3083,8 +3083,10 @@ static int active_scan(struct hci_request *req, unsigned long opt)
         * running. Thus, we should temporarily stop it in order to set the
         * discovery scanning parameters.
         */
-       if (hci_dev_test_flag(hdev, HCI_LE_SCAN))
+       if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) {
                hci_req_add_le_scan_disable(req, false);
+               cancel_interleave_scan(hdev);
+       }
 
        /* All active scans will be done with either a resolvable private
         * address (when privacy feature has been enabled) or non-resolvable