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
..
2014-10-15 10:25:04 +10:30
2014-08-22 12:23:11 -07:00
2014-09-30 17:08:06 -04:00
2014-09-10 12:40:10 -07:00
2013-09-23 16:52:45 -04:00
2014-09-28 07:05:16 -07:00
2014-10-09 01:40:05 -04:00
2014-10-17 23:52:54 -04:00
2014-09-07 16:07:25 -07:00
2014-10-07 20:28:44 -04:00