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.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Marcel Holtmann 2014-07-01 19:28:23 +02:00
Родитель 9ab65d60c2
Коммит b8221770c9
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -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;