]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Check FINDING state in interleaved discovery
authorAndre Guedes <andre.guedes@openbossa.org>
Tue, 6 Mar 2012 22:37:06 +0000 (19:37 -0300)
committerGustavo Padovan <gustavo@padovan.org>
Wed, 28 Mar 2012 14:39:06 +0000 (11:39 -0300)
In order to do interleaved discovery we should be in DISCOVERY_
FINDING state. Otherwise, discovery should be stopped.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_event.c

index a0140b95cbeb03c22ada790467199ef7f03741de..66ffe459e170cdbc96e9f75dd9ce801260412ffb 100644 (file)
@@ -1099,7 +1099,8 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
 
                schedule_delayed_work(&hdev->adv_work, ADV_CLEAR_TIMEOUT);
 
-               if (hdev->discovery.type == DISCOV_TYPE_INTERLEAVED) {
+               if (hdev->discovery.type == DISCOV_TYPE_INTERLEAVED &&
+                               hdev->discovery.state == DISCOVERY_FINDING) {
                        mgmt_interleaved_discovery(hdev);
                } else {
                        hci_dev_lock(hdev);