diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-07 16:19:50 +0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-07 17:18:16 +0400 |
commit | a70f4b5f14a029c14c3901f429e4d3d7e5477b4f (patch) | |
tree | da81f377da03693a268fb9d9621fcdf98b1accf8 /net/bluetooth/hci_core.c | |
parent | cdd6275e510bd86c44d3fc85a78306f514bbac9a (diff) | |
download | linux-a70f4b5f14a029c14c3901f429e4d3d7e5477b4f.tar.xz |
Bluetooth: Don't try background scanning if LE is not enabled
For adapters that do not support LE and ones where LE hasn't been
enabled we shouldn't be trying to initiate background scanning. This
patch adds an extra check to the hci_update_background_scan() to ensure
that we bail out if HCI_LE_ENABLED is not set.
Since we do allow user space to feed the kernel with LE connection
parameters even when LE is not enabled we now need to also call
hci_update_background_scan() as soon as LE gets enabled so that scanning
gets started if necessary.
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 6790dc8cff99..f1c5a077e558 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -5403,6 +5403,10 @@ void hci_update_background_scan(struct hci_dev *hdev) test_bit(HCI_UNREGISTER, &hdev->dev_flags)) return; + /* No point in doing scanning if LE support hasn't been enabled */ + if (!test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) + return; + /* If discovery is active don't interfere with it */ if (hdev->discovery.state != DISCOVERY_STOPPED) return; |