提交 3f985050 编写于 作者: J Johan Hedberg 提交者: Gustavo Padovan

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: NJohan Hedberg <johan.hedberg@intel.com>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
上级 04b4edcb
...@@ -2433,8 +2433,15 @@ static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data, ...@@ -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)); memcpy(hdev->dev_name, cp->name, sizeof(hdev->dev_name));
hci_req_init(&req, hdev); 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); err = hci_req_run(&req, set_name_complete);
if (err < 0) if (err < 0)
mgmt_pending_remove(cmd); mgmt_pending_remove(cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册