Skip to content

Commit dce0a4b

Browse files
apanditJohan Hedberg
authored andcommitted
Bluetooth: Set missing suspend task bits
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 <[email protected]> Signed-off-by: Howard Chung <[email protected]> Reviewed-by: Alain Michaud <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
1 parent 4d9b952 commit dce0a4b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/bluetooth/hci_request.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,9 @@ void hci_req_add_le_scan_disable(struct hci_request *req, bool rpa_le_conn)
707707
return;
708708
}
709709

710+
if (hdev->suspended)
711+
set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
712+
710713
if (use_ext_scan(hdev)) {
711714
struct hci_cp_le_set_ext_scan_enable cp;
712715

@@ -1159,6 +1162,11 @@ static void hci_req_set_event_filter(struct hci_request *req)
11591162
scan = SCAN_PAGE;
11601163
}
11611164

1165+
if (scan)
1166+
set_bit(SUSPEND_SCAN_ENABLE, hdev->suspend_tasks);
1167+
else
1168+
set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
1169+
11621170
hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
11631171
}
11641172

0 commit comments

Comments
 (0)