summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann2014-06-30 16:04:12 +0200
committerMarcel Holtmann2014-07-03 17:42:51 +0200
commitc20c02d5c8d76f39be461c25bf5de3a1dc96885e (patch)
treeade78df94d934535bd1cf95977b928b1de07a49c /net
parentBluetooth: Add default connection parameters before pairing (diff)
downloadkernel-qcow2-linux-c20c02d5c8d76f39be461c25bf5de3a1dc96885e.tar.gz
kernel-qcow2-linux-c20c02d5c8d76f39be461c25bf5de3a1dc96885e.tar.xz
kernel-qcow2-linux-c20c02d5c8d76f39be461c25bf5de3a1dc96885e.zip
Bluetooth: Start background scanning only when controller is ready
When the controller is not active or in init/setup phase, do not try to start or stop background scanning. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index adea7de95633..2312e77582b0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -5317,7 +5317,10 @@ void hci_update_background_scan(struct hci_dev *hdev)
struct hci_conn *conn;
int err;
- if (test_bit(HCI_UNREGISTER, &hdev->dev_flags))
+ if (!test_bit(HCI_UP, &hdev->flags) ||
+ test_bit(HCI_INIT, &hdev->flags) ||
+ test_bit(HCI_SETUP, &hdev->dev_flags) ||
+ test_bit(HCI_UNREGISTER, &hdev->dev_flags))
return;
hci_req_init(&req, hdev);