diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-22 22:11:32 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-23 13:07:01 +0200 |
commit | 932f5ff5e32bf520eb9287b050c926faa6e76bcf (patch) | |
tree | ff4f0805b4efc42bcfd7c14f69693a69b2920a40 /net | |
parent | 7770c4aacaf34fb69cb2acfb7469e9b4e34f1674 (diff) |
Bluetooth: mgmt: Allow class of device changes while powered off
This patch makes it possible to set the class when powered off. When
powering on the right class of device value will be automatically
writen to the controller.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/mgmt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 3a2066504ff..a45c2b70dfd 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1456,15 +1456,15 @@ static int set_dev_class(struct sock *sk, u16 index, void *data, u16 len) hci_dev_lock(hdev); + hdev->major_class = cp->major; + hdev->minor_class = cp->minor; + if (!hdev_is_powered(hdev)) { - err = cmd_status(sk, index, MGMT_OP_SET_DEV_CLASS, - MGMT_STATUS_NOT_POWERED); + err = cmd_complete(sk, index, MGMT_OP_SET_DEV_CLASS, 0, + hdev->dev_class, 3); goto unlock; } - hdev->major_class = cp->major; - hdev->minor_class = cp->minor; - if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) { hci_dev_unlock(hdev); cancel_delayed_work_sync(&hdev->service_cache); |