diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-03-15 17:07:02 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-03-18 14:02:05 -0300 |
commit | 3f985050fa5e2f6715b215452198f005df2d5746 (patch) | |
tree | 1472e8485b1d097ecac1dbd5396954f2c3a9caa2 /net/bluetooth/mgmt.c | |
parent | 04b4edcbc9049e100681c0149b572de439be42ab (diff) | |
download | op-kernel-dev-3f985050fa5e2f6715b215452198f005df2d5746.zip op-kernel-dev-3f985050fa5e2f6715b215452198f005df2d5746.tar.gz |
Bluetooth: Fix local name setting for LE-only controllers
This patch fixes the mgmt_set_local_name command to send the appropriate
HCI commands based on BR/EDR support and LE support. Local name and EIR
data should only be sent for BR/EDR capable controllers whereas an
update to the AD should only happen for LE capable controllers.
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>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 1d50841..28e5975 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -2433,8 +2433,15 @@ static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data, memcpy(hdev->dev_name, cp->name, sizeof(hdev->dev_name)); hci_req_init(&req, hdev); - update_name(&req); - update_eir(&req); + + if (lmp_bredr_capable(hdev)) { + update_name(&req); + update_eir(&req); + } + + if (lmp_le_capable(hdev)) + hci_update_ad(&req); + err = hci_req_run(&req, set_name_complete); if (err < 0) mgmt_pending_remove(cmd); |