Commit 51b64c47 authored by Miao-chen Chou's avatar Miao-chen Chou Committed by Marcel Holtmann

Bluetooth: Use whitelist for scan policy when suspending

Even with one advertisement monitor in place, the scan policy should use
the whitelist while the system is going to suspend to prevent waking by
random advertisement.

The following test was performed.
- With a paired device, register one advertisement monitor, suspend
the system and verify that the host was not awaken by random
advertisements.
Signed-off-by: default avatarMiao-chen Chou <mcchou@chromium.org>
Reviewed-by: default avatarAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 15d8ce05
......@@ -800,9 +800,10 @@ static u8 update_white_list(struct hci_request *req)
/* Once the controller offloading of advertisement monitor is in place,
* the if condition should include the support of MSFT extension
* support.
* support. If suspend is ongoing, whitelist should be the default to
* prevent waking by random advertisements.
*/
if (!idr_is_empty(&hdev->adv_monitors_idr))
if (!idr_is_empty(&hdev->adv_monitors_idr) && !hdev->suspended)
return 0x00;
/* Select filter policy to use white list */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment