Bluetooth: Fix double scan updates
authorJakub Pawlowski <jpawlowski@google.com>
Fri, 16 Oct 2015 07:07:49 +0000 (10:07 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 16 Oct 2015 07:24:41 +0000 (09:24 +0200)
commit168b8a25c0ac30f427bfe6ad547779c4c363d042
treeb9a0234a48615d388821a9760d3c29914e16fddd
parent53ca376eec4eb635e2249c8e89093f499e180731
Bluetooth: Fix double scan updates

When disable/enable scan command is issued twice, some controllers
will return an error for the second request, i.e. requests with this
command will fail on some controllers, and succeed on others.

This patch makes sure that unnecessary scan disable/enable commands
are not issued.

When adding device to the auto connect whitelist when there is pending
connect attempt, there is no need to update scan.

hci_connect_le_scan_cleanup is conditionally executing
hci_conn_params_del, that is calling hci_update_background_scan. Make
the other case also update scan, and remove reduntand call from
hci_connect_le_scan_remove.

When stopping interleaved discovery the state should be set to stopped
only when both LE scanning and discovery has stopped.

Signed-off-by: Jakub Pawlowski <jpawlowski@google.com>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_conn.c
net/bluetooth/hci_event.c
net/bluetooth/mgmt.c