summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg2014-07-07 13:40:22 +0200
committerMarcel Holtmann2014-07-07 13:53:03 +0200
commit2b7be33e60c631b3080099baf14c43505fa8017d (patch)
treea3ed3539e2da9b337d727c1fe7371d78cebe042d /net/bluetooth/mgmt.c
parentBluetooth: Don't let background scanning interfering with discovery (diff)
downloadkernel-qcow2-linux-2b7be33e60c631b3080099baf14c43505fa8017d.tar.gz
kernel-qcow2-linux-2b7be33e60c631b3080099baf14c43505fa8017d.tar.xz
kernel-qcow2-linux-2b7be33e60c631b3080099baf14c43505fa8017d.zip
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/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 40244fc0e326..ef675acbcfce 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1750,8 +1750,10 @@ static void set_connectable_complete(struct hci_dev *hdev, u8 status)
send_settings_rsp(cmd->sk, MGMT_OP_SET_CONNECTABLE, hdev);
- if (changed)
+ if (changed) {
new_settings(hdev, cmd->sk);
+ hci_update_background_scan(hdev);
+ }
remove_cmd:
mgmt_pending_remove(cmd);