Commit 932f5ff5 authored by Johan Hedberg's avatar Johan Hedberg

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 7770c4aa
...@@ -1456,15 +1456,15 @@ static int set_dev_class(struct sock *sk, u16 index, void *data, u16 len) ...@@ -1456,15 +1456,15 @@ static int set_dev_class(struct sock *sk, u16 index, void *data, u16 len)
hci_dev_lock(hdev); hci_dev_lock(hdev);
hdev->major_class = cp->major;
hdev->minor_class = cp->minor;
if (!hdev_is_powered(hdev)) { if (!hdev_is_powered(hdev)) {
err = cmd_status(sk, index, MGMT_OP_SET_DEV_CLASS, err = cmd_complete(sk, index, MGMT_OP_SET_DEV_CLASS, 0,
MGMT_STATUS_NOT_POWERED); hdev->dev_class, 3);
goto unlock; goto unlock;
} }
hdev->major_class = cp->major;
hdev->minor_class = cp->minor;
if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) { if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) {
hci_dev_unlock(hdev); hci_dev_unlock(hdev);
cancel_delayed_work_sync(&hdev->service_cache); cancel_delayed_work_sync(&hdev->service_cache);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment