提交 c6beca0e 编写于 作者: M Marcel Holtmann 提交者: Johan Hedberg

Bluetooth: Allow HCI User Channel usage for controllers without address

Trying to setup HCI User Channel usage for LE only controllers without
a public address or configured static address will fail with an error
saying that no address is available.

In case of HCI User Channel the requirement for a valid address is not
needed. So allow skipping this extra validation step.
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 c6521401
...@@ -1937,10 +1937,15 @@ static int hci_dev_do_open(struct hci_dev *hdev) ...@@ -1937,10 +1937,15 @@ static int hci_dev_do_open(struct hci_dev *hdev)
* be able to determine if there is a public address * be able to determine if there is a public address
* or not. * or not.
* *
* In case of user channel usage, it is not important
* if a public address or static random address is
* available.
*
* This check is only valid for BR/EDR controllers * This check is only valid for BR/EDR controllers
* since AMP controllers do not have an address. * since AMP controllers do not have an address.
*/ */
if (hdev->dev_type == HCI_BREDR && if (!test_bit(HCI_USER_CHANNEL, &hdev->dev_flags) &&
hdev->dev_type == HCI_BREDR &&
!bacmp(&hdev->bdaddr, BDADDR_ANY) && !bacmp(&hdev->bdaddr, BDADDR_ANY) &&
!bacmp(&hdev->static_addr, BDADDR_ANY)) { !bacmp(&hdev->static_addr, BDADDR_ANY)) {
ret = -EADDRNOTAVAIL; ret = -EADDRNOTAVAIL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册