Bluetooth: Don't force DISCOVERY_STOPPED state in inquiry_cache_flush
authorAndre Guedes <andre.guedes@openbossa.org>
Thu, 1 Mar 2012 21:19:57 +0000 (18:19 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 2 Mar 2012 23:43:02 +0000 (01:43 +0200)
We are not supposed to force DISCOVERY_STOPPED in inquiry_cache_flush
because we may break the discovery state machine. For instance, during
interleaved discovery, when we are about to start inquiry, the state
machine forcibly goes to DISCOVERY_STOPPED while it should stay in
DISCOVERY_FINDING state.

This problem results in unexpected behaviors such as sending two
mgmt_discovering events to userspace (when only one event is expected)
and Stop Discovery failures.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_core.c

index d3ddc0ba9cd4fc3839ab0a489c8ceeb652fe1212..661d65fc487ba4a75029e2b72dacfd73d8cf23bb 100644 (file)
@@ -413,7 +413,6 @@ static void inquiry_cache_flush(struct hci_dev *hdev)
 
        INIT_LIST_HEAD(&cache->unknown);
        INIT_LIST_HEAD(&cache->resolve);
-       cache->state = DISCOVERY_STOPPED;
 }
 
 struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)