Skip to content

Commit

Permalink
Bluetooth: mgmt: Allow class of device changes while powered off
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hedberg committed Feb 23, 2012
1 parent 7770c4a commit 932f5ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 932f5ff

Please sign in to comment.