Skip to content

Commit 3a0377d

Browse files
apanditholtmann
authored andcommitted
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>
1 parent 34a6865 commit 3a0377d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎net/bluetooth/hci_request.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,11 @@ static void hci_req_start_scan(struct hci_request *req, u8 type, u16 interval,
819819
{
820820
struct hci_dev *hdev = req->hdev;
821821

822+
if (hdev->scanning_paused) {
823+
bt_dev_dbg(hdev, "Scanning is paused for suspend");
824+
return;
825+
}
826+
822827
/* Use ext scanning if set ext scan param and ext scan enable is
823828
* supported
824829
*/
@@ -2657,6 +2662,11 @@ static int le_scan_restart(struct hci_request *req, unsigned long opt)
26572662
if (!hci_dev_test_flag(hdev, HCI_LE_SCAN))
26582663
return 0;
26592664

2665+
if (hdev->scanning_paused) {
2666+
bt_dev_dbg(hdev, "Scanning is paused for suspend");
2667+
return 0;
2668+
}
2669+
26602670
hci_req_add_le_scan_disable(req);
26612671

26622672
if (use_ext_scan(hdev)) {

0 commit comments

Comments
 (0)