提交 562fcc24 编写于 作者: A Andrzej Kaczmarek 提交者: Gustavo Padovan

Bluetooth: mgmt: Fix enabling LE while powered off

When new BT USB adapter is plugged in it's configured while still being powered
off (HCI_AUTO_OFF flag is set), thus Set LE will only set dev_flags but won't
write changes to controller. As a result it's not possible to start device
discovery session on LE controller as it uses interleaved discovery which
requires LE Supported Host flag in extended features.

This patch ensures HCI Write LE Host Supported is sent when Set Powered is
called to power on controller and clear HCI_AUTO_OFF flag.
Signed-off-by: NAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Cc: stable@vger.kernel.org
Acked-by: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
上级 3d1cbdd6
...@@ -2881,6 +2881,16 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered) ...@@ -2881,6 +2881,16 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, 1, &ssp); hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, 1, &ssp);
} }
if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {
struct hci_cp_write_le_host_supported cp;
cp.le = 1;
cp.simul = !!(hdev->features[6] & LMP_SIMUL_LE_BR);
hci_send_cmd(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED,
sizeof(cp), &cp);
}
update_class(hdev); update_class(hdev);
update_name(hdev, hdev->dev_name); update_name(hdev, hdev->dev_name);
update_eir(hdev); update_eir(hdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册