Skip to content

Commit

Permalink
Bluetooth: Set missing suspend task bits
Browse files Browse the repository at this point in the history
When suspending, mark SUSPEND_SCAN_ENABLE and SUSPEND_SCAN_DISABLE tasks
correctly when either classic or le scanning is modified.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Howard Chung <howardchung@google.com>
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Abhishek Pandit-Subedi authored and Johan Hedberg committed Dec 7, 2020
1 parent 4d9b952 commit dce0a4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/bluetooth/hci_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@ void hci_req_add_le_scan_disable(struct hci_request *req, bool rpa_le_conn)
return;
}

if (hdev->suspended)
set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);

if (use_ext_scan(hdev)) {
struct hci_cp_le_set_ext_scan_enable cp;

Expand Down Expand Up @@ -1159,6 +1162,11 @@ static void hci_req_set_event_filter(struct hci_request *req)
scan = SCAN_PAGE;
}

if (scan)
set_bit(SUSPEND_SCAN_ENABLE, hdev->suspend_tasks);
else
set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);

hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
}

Expand Down

0 comments on commit dce0a4b

Please sign in to comment.