Skip to content

Commit

Permalink
Bluetooth: Enable page scan also if there are white list entries
Browse files Browse the repository at this point in the history
Page scan should be enabled either if the connectable setting is set or
if there are any entries in the BR/EDR white list. This patch implements
such behavior by updating the two places that were making decisions on
whether to enable page scan or not.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Johan Hedberg authored and Marcel Holtmann committed Jul 9, 2014
1 parent 70c4642 commit 6cebb9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4357,7 +4357,8 @@ static void set_bredr_scan(struct hci_request *req)
*/
write_fast_connectable(req, false);

if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))
if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags) ||
!list_empty(&hdev->whitelist))
scan |= SCAN_PAGE;
if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
scan |= SCAN_INQUIRY;
Expand Down Expand Up @@ -4471,7 +4472,8 @@ static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)

hci_req_init(&req, hdev);

if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))
if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags) ||
!list_empty(&hdev->whitelist))
set_bredr_scan(&req);

/* Since only the advertising data flags will change, there
Expand Down

0 comments on commit 6cebb9e

Please sign in to comment.