Skip to contentSkip to conversation

Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set

PATCH In review Marcel Holtmann 2 participants 2 messages Jul 1, 2014

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/2 Bluetooth: Do not trigger background scanning when HCI_AUTO_OFF is set

When a new controller is initialized, but not powered from userspace at the moment, the HCI_AUTO_OFF flag is still set. During this period, userspace might program device for auto-connection, but never power on the controller. In this case do not try to start background scanning and leave it for later to be started.

---
 net/bluetooth/hci_core.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_core.c +1 -0
index 0aa392406629..25ed6d3de410 100644
@@ -5306,6 +5306,7 @@ void hci_update_background_scan(struct hci_dev *hdev)
 	if (!test_bit(HCI_UP, &hdev->flags) ||
 	    test_bit(HCI_INIT, &hdev->flags) ||
 	    test_bit(HCI_SETUP, &hdev->dev_flags) ||
+	    test_bit(HCI_AUTO_OFF, &hdev->dev_flags) ||
 	    test_bit(HCI_UNREGISTER, &hdev->dev_flags))
 		return;
 
Signature · 1 line
1.9.3
#1 lore raw

Hi Marcel,

Quoted 10 lines · Marcel Holtmann

When a new controller is initialized, but not powered from userspace at the moment, the HCI_AUTO_OFF flag is still set. During this period, userspace might program device for auto-connection, but never power on the controller. In this case do not try to start background scanning and leave it for later to be started.

---
 net/bluetooth/hci_core.c | 1 +
 1 file changed, 1 insertion(+)

Both patches have been applied to bluetooth-next. Thanks.

Johan