summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-07 14:40:22 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-07 13:53:03 +0200
commit2b7be33e60c631b3080099baf14c43505fa8017d (patch)
treea3ed3539e2da9b337d727c1fe7371d78cebe042d /net/bluetooth/hci_core.c
parentae23ada43d7d644e563a23d4c2cd2aa828be1431 (diff)
downloadop-kernel-dev-2b7be33e60c631b3080099baf14c43505fa8017d.zip
op-kernel-dev-2b7be33e60c631b3080099baf14c43505fa8017d.tar.gz
Bluetooth: Enable passive scanning whenever we're connectable
Enabling passive scanning always when we're connectable aligns us with the BR/EDR page scanning. This is also consistent with the fact that the code dealing with passive scanning results will actively try to connect any direct advertising event when we're connectable. This patch implements the feature by adding the connectable condition to hci_update_background_scan() checks for starting scanning and by calling hci_update_background_scan() whenever the connectable state changes. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 4f8ba49..6790dc8 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -5409,7 +5409,8 @@ void hci_update_background_scan(struct hci_dev *hdev)
hci_req_init(&req, hdev);
- if (list_empty(&hdev->pend_le_conns) &&
+ if (!test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&
+ list_empty(&hdev->pend_le_conns) &&
list_empty(&hdev->pend_le_reports)) {
/* If there is no pending LE connections or devices
* to be scanned for, we should stop the background
OpenPOWER on IntegriCloud