diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-10-09 14:42:08 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-10-21 00:49:21 +0200 |
commit | 6d2e50d24098b1f80ad76db9a9cb9668c4bf6b50 (patch) | |
tree | b75c3dd4e168352d39d2c23452efd03e2f8b755d /drivers/bluetooth/btintel.c | |
parent | 9d08f50401ac7eb32e3c9ae8c4c0a61c6b107fd1 (diff) | |
download | lwn-6d2e50d24098b1f80ad76db9a9cb9668c4bf6b50.tar.gz lwn-6d2e50d24098b1f80ad76db9a9cb9668c4bf6b50.zip |
Bluetooth: btintel: Add support for enabling tracing functionality
For Intel controllers with firmware that allows tracing of baseband
functionality this allows enabling it via set_diag driver callback.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth/btintel.c')
-rw-r--r-- | drivers/bluetooth/btintel.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index 7047fe6a6a2b..95652aa12454 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -91,6 +91,38 @@ int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) } EXPORT_SYMBOL_GPL(btintel_set_bdaddr); +int btintel_set_diag(struct hci_dev *hdev, bool enable) +{ + struct sk_buff *skb; + u8 param[3]; + int err; + + if (!test_bit(HCI_RUNNING, &hdev->flags)) + return -ENETDOWN; + + if (enable) { + param[0] = 0x03; + param[1] = 0x03; + param[2] = 0x03; + } else { + param[0] = 0x00; + param[1] = 0x00; + param[2] = 0x00; + } + + skb = __hci_cmd_sync(hdev, 0xfc43, 3, param, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + BT_ERR("%s: Changing Intel diagnostic mode failed (%d)", + hdev->name, err); + return err; + } + kfree_skb(skb); + + return 0; +} +EXPORT_SYMBOL_GPL(btintel_set_diag); + void btintel_hw_error(struct hci_dev *hdev, u8 code) { struct sk_buff *skb; |