Skip to content

Commit c453b10

Browse files
chethantnholtmann
authored andcommitted
Bluetooth: btusb: Configure Intel debug feature based on available support
This patch shall enable the Intel telemetry exception format based on the supported features Signed-off-by: Chethan T N <[email protected]> Signed-off-by: Ps AyappadasX <[email protected]> Signed-off-by: Kiran K <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent d74abe2 commit c453b10

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

drivers/bluetooth/btintel.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,33 @@ int btintel_read_debug_features(struct hci_dev *hdev,
786786
}
787787
EXPORT_SYMBOL_GPL(btintel_read_debug_features);
788788

789+
int btintel_set_debug_features(struct hci_dev *hdev,
790+
const struct intel_debug_features *features)
791+
{
792+
u8 mask[11] = { 0x0a, 0x92, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00,
793+
0x00, 0x00, 0x00 };
794+
struct sk_buff *skb;
795+
796+
if (!features)
797+
return -EINVAL;
798+
799+
if (!(features->page1[0] & 0x3f)) {
800+
bt_dev_info(hdev, "Telemetry exception format not supported");
801+
return 0;
802+
}
803+
804+
skb = __hci_cmd_sync(hdev, 0xfc8b, 11, mask, HCI_INIT_TIMEOUT);
805+
if (IS_ERR(skb)) {
806+
bt_dev_err(hdev, "Setting Intel telemetry ddc write event mask failed (%ld)",
807+
PTR_ERR(skb));
808+
return PTR_ERR(skb);
809+
}
810+
811+
kfree_skb(skb);
812+
return 0;
813+
}
814+
EXPORT_SYMBOL_GPL(btintel_set_debug_features);
815+
789816
MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
790817
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
791818
MODULE_VERSION(VERSION);

drivers/bluetooth/btintel.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ int btintel_read_boot_params(struct hci_dev *hdev,
9292
int btintel_download_firmware(struct hci_dev *dev, const struct firmware *fw,
9393
u32 *boot_param);
9494
void btintel_reset_to_bootloader(struct hci_dev *hdev);
95-
9695
int btintel_read_debug_features(struct hci_dev *hdev,
9796
struct intel_debug_features *features);
98-
97+
int btintel_set_debug_features(struct hci_dev *hdev,
98+
const struct intel_debug_features *features);
9999
#else
100100

101101
static inline int btintel_check_bdaddr(struct hci_dev *hdev)
@@ -201,4 +201,10 @@ static inline int btintel_read_debug_features(struct hci_dev *hdev,
201201
return -EOPNOTSUPP;
202202
}
203203

204+
static inline int btintel_set_debug_features(struct hci_dev *hdev,
205+
const struct intel_debug_features *features)
206+
{
207+
return -EOPNOTSUPP;
208+
}
209+
204210
#endif

drivers/bluetooth/btusb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,6 +2548,9 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
25482548
*/
25492549
btintel_read_debug_features(hdev, &features);
25502550

2551+
/* Set DDC mask for available debug features */
2552+
btintel_set_debug_features(hdev, &features);
2553+
25512554
/* Read the Intel version information after loading the FW */
25522555
err = btintel_read_version(hdev, &ver);
25532556
if (err)

0 commit comments

Comments
 (0)