linux/net/bluetooth
Johan Hedberg 9845904fd4 Bluetooth: Fix mgmt response status when removing adapter
When an adapter is removed (hci_unregister_dev) any pending mgmt
commands for that adapter should get the appropriate INVALID_INDEX
response. Since hci_unregister_dev() calls hci_dev_do_close() first
that'd so far have caused "not powered" responses to be sent.

Skipping the HCI_UNREGISTER case in mgmt_powered() is also not a
solution since before reaching the mgmt_index_removed() stage any
hci_conn callbacks (e.g. used by pairing) will get called, thereby
causing "disconnected" status responses to be sent.

The fix that covers all scenarios is to handle both INVALID_INDEX and
NOT_POWERED responses through the mgmt_powered() function. The
INVALID_INDEX response sending from mgmt_index_removed() is left
untouched since there are a couple of places not related to powering off
or removing an adapter that call it (e.g. configuring a new bdaddr).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-12-12 13:20:12 +01:00
..
bnep Bluetooth: Introduce BT_BREDR and BT_LE config options 2014-11-02 10:01:53 +02:00
cmtp Bluetooth: Introduce BT_BREDR and BT_LE config options 2014-11-02 10:01:53 +02:00
hidp Bluetooth: hidp: replace kzalloc/copy_from_user by memdup_user 2014-11-15 01:30:16 +01:00
rfcomm Bluetooth: Fix sparse warnings in RFCOMM 2014-11-04 08:01:46 +01:00
6lowpan.c Bluetooth: Fix correct nesting for 6lowpan server channel 2014-11-13 09:11:37 +01:00
a2mp.c
a2mp.h
af_bluetooth.c Bluetooth: Increase minor version of core module 2014-12-03 21:58:25 +02:00
amp.c Bluetooth: Fix sparse warning in amp.c 2014-11-11 00:07:29 +01:00
amp.h
ecc.c Bluetooth: Add ECC library for LE Secure Connections 2014-12-03 16:51:16 +01:00
ecc.h Bluetooth: Add ECC library for LE Secure Connections 2014-12-03 16:51:16 +01:00
hci_conn.c Bluetooth: Fix generation of non-resolvable private addresses 2014-12-08 09:21:14 +02:00
hci_core.c Bluetooth: Fix notifying mgmt power off before flushing connection list 2014-12-11 20:57:39 +01:00
hci_event.c Bluetooth: Fix missing hci_dev_lock/unlock in hci_event 2014-12-11 15:09:04 +01:00
hci_sock.c Bluetooth: spelling fixes 2014-10-28 17:23:58 +01:00
hci_sysfs.c
Kconfig Bluetooth: Add basic support for AES-CMAC 2014-12-03 16:51:16 +01:00
l2cap_core.c Bluetooth: Check for force_lesc_support when enabling SMP over BR/EDR 2014-12-06 09:51:41 +02:00
l2cap_sock.c Bluetooth: Add debug logs to help track locking issues 2014-11-15 01:53:27 +01:00
lib.c
Makefile Bluetooth: Add ECC library for LE Secure Connections 2014-12-03 16:51:16 +01:00
mgmt.c Bluetooth: Fix mgmt response status when removing adapter 2014-12-12 13:20:12 +01:00
sco.c
smp.c Bluetooth: fix err_cast.cocci warnings 2014-12-09 08:06:51 +01:00
smp.h Bluetooth: Fix missing const declarations in SMP functions 2014-12-03 16:51:21 +01:00