diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-15 06:33:57 -0700 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-15 17:22:38 +0300 |
commit | 970ba5242d86ea281a263231639e935f6386e49d (patch) | |
tree | 984fc4fd4a1476f2b5ee0f450dc3adaa158a02b2 /net/bluetooth/mgmt.c | |
parent | 4796e8af60ee7d2922386ef9fd4389d21e2c1665 (diff) | |
download | linux-970ba5242d86ea281a263231639e935f6386e49d.tar.bz2 |
Bluetooth: Update class of device after changing discoverable mode
When the discoverable mode gets changed, ensure that the class of
device value has the correct limited discoverable bit value set.
Since the class of device HCI command will only be send to the
controller when the value changes, it is safe to just always
trigger the update.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 12d1cb02c2a1..6db23934ac9e 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1025,6 +1025,7 @@ static void set_discoverable_complete(struct hci_dev *hdev, u8 status) { struct pending_cmd *cmd; struct mgmt_mode *cp; + struct hci_request req; bool changed; BT_DBG("status 0x%02x", status); @@ -1054,6 +1055,14 @@ static void set_discoverable_complete(struct hci_dev *hdev, u8 status) if (changed) new_settings(hdev, cmd->sk); + /* When the discoverable mode gets changed, make sure + * that class of device has the limited discoverable + * bit correctly set. + */ + hci_req_init(&req, hdev); + update_class(&req); + hci_req_run(&req, NULL); + remove_cmd: mgmt_pending_remove(cmd); |