Bluetooth: Fix mgmt handling of power on failures
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 29 May 2013 06:51:29 +0000 (09:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2013 18:58:44 +0000 (11:58 -0700)
commit2147439889d33148785d20cdff01491f5617965f
tree1f2504a3535c3e534b040cc66f002bb43e41c7e3
parentb507d034be0418dd2dee4fe3d40f389b1818b37a
Bluetooth: Fix mgmt handling of power on failures

commit 96570ffcca0b872dc8626e97569d2697f374d868 upstream.

If hci_dev_open fails we need to ensure that the corresponding
mgmt_set_powered command gets an appropriate response. This patch fixes
the missing response by adding a new mgmt_set_powered_failed function
that's used to indicate a power on failure to mgmt. Since a situation
with the device being rfkilled may require special handling in user
space the patch uses a new dedicated mgmt status code for this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/bluetooth/hci_core.h
include/net/bluetooth/mgmt.h
net/bluetooth/hci_core.c
net/bluetooth/mgmt.c