Commit b56c7b25 authored by Marcel Holtmann's avatar Marcel Holtmann

Bluetooth: Skip vendor diagnostic configuration for HCI User Channel

When the HCI User Channel access is requested, then do not try to
undermine it with vendor diagnostic configuration. The exclusive user
is required to configure its own vendor diagnostic in that case and
can not rely on the host stack support.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 76c4969f
...@@ -148,13 +148,13 @@ static ssize_t vendor_diag_write(struct file *file, const char __user *user_buf, ...@@ -148,13 +148,13 @@ static ssize_t vendor_diag_write(struct file *file, const char __user *user_buf,
return -EINVAL; return -EINVAL;
/* When the diagnostic flags are not persistent and the transport /* When the diagnostic flags are not persistent and the transport
* is not active, then there is no need for the vendor callback. * is not active or in user channel operation, then there is no need
* * for the vendor callback. Instead just store the desired value and
* Instead just store the desired value. If needed the setting * the setting will be programmed when the controller gets powered on.
* will be programmed when the controller gets powered on.
*/ */
if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) && if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) &&
!test_bit(HCI_RUNNING, &hdev->flags)) (!test_bit(HCI_RUNNING, &hdev->flags) ||
hci_dev_test_flag(hdev, HCI_USER_CHANNEL)))
goto done; goto done;
hci_req_sync_lock(hdev); hci_req_sync_lock(hdev);
...@@ -1419,6 +1419,7 @@ static int hci_dev_do_open(struct hci_dev *hdev) ...@@ -1419,6 +1419,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
* completed. * completed.
*/ */
if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) && if (test_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks) &&
!hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
hci_dev_test_flag(hdev, HCI_VENDOR_DIAG) && hdev->set_diag) hci_dev_test_flag(hdev, HCI_VENDOR_DIAG) && hdev->set_diag)
ret = hdev->set_diag(hdev, true); ret = hdev->set_diag(hdev, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment