Skip to contentSkip to conversation

Bluetooth: Start background scanning only when controller is ready

PATCH Applied Marcel Holtmann 2 participants 2 messages Jun 30, 2014

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 net/bluetooth/hci_core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/bluetooth/hci_core.c +4 -1
index adea7de95633..2312e77582b0 100644
@@ -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);
Signature · 1 line
1.9.3
#1 lore raw

Hi Marcel,

Quoted 7 lines · Marcel Holtmann

When the controller is not active or in init/setup phase, do not try to start or stop background scanning.

---
 net/bluetooth/hci_core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Applied to bluetooth-next. Thanks.

Johan