Commit ae23ada4 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann

Bluetooth: Don't let background scanning interfering with discovery

If we have an active discovery going on we shouldn't do any changes to
LE scanning when hci_update_background_scan() is called (a call which
can happen for many different reasons). This patch fixes the issue by
returning from the function if the discovery state is anything else
except DISCOVERY_STOPPED.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent bb3e0a33
...@@ -5403,6 +5403,10 @@ void hci_update_background_scan(struct hci_dev *hdev) ...@@ -5403,6 +5403,10 @@ void hci_update_background_scan(struct hci_dev *hdev)
test_bit(HCI_UNREGISTER, &hdev->dev_flags)) test_bit(HCI_UNREGISTER, &hdev->dev_flags))
return; return;
/* If discovery is active don't interfere with it */
if (hdev->discovery.state != DISCOVERY_STOPPED)
return;
hci_req_init(&req, hdev); hci_req_init(&req, hdev);
if (list_empty(&hdev->pend_le_conns) && if (list_empty(&hdev->pend_le_conns) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment