Bluetooth: Set DISCOVERY_STOPPED if controller resets
authorAndre Guedes <andre.guedes@openbossa.org>
Thu, 23 Feb 2012 14:50:05 +0000 (16:50 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 23 Feb 2012 14:51:47 +0000 (16:51 +0200)
commit69775ff6d101ccf435bd26ae822c24bbb20e11cf
tree7e138bfb91d6aad28f879164e9b64702acad955c
parent60fc5fb66efa0bcbe028637206ed59df8cd4ac19
Bluetooth: Set DISCOVERY_STOPPED if controller resets

If controller is reset during the discovery procedure, Start Discovery
command stops working. This can be easily reproduced by running
"hciconfig hci0 reset" while discovering devices, for instance.

We should force discovery state to DISCOVERY_STOPPED in case we receive
a reset command complete event. Otherwise we may stuck in one of the
active discovery states (DISCOVERY_INQUIRY, DISCOVERY_LE_SCAN and
DISCOVERY_RESOLVING) and subsequent Start Discovery commands will simply
fail.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_event.c