2021-04-12 07:31:28

by Joseph Hwang

[permalink] [raw]
Subject: [PATCH v1 1/2] Bluetooth: btusb: support link statistics telemetry events

From: Chethan T N <[email protected]>

This patch supports the link statistics telemetry events for
Intel controllers

To avoid the overhead, this debug feature is disabled by default.

Reviewed-by: Miao-chen Chou <[email protected]>
Signed-off-by: Chethan T N <[email protected]>
Signed-off-by: Kiran K <[email protected]>
Signed-off-by: Joseph Hwang <[email protected]>
---

drivers/bluetooth/btintel.c | 20 +++++++++++++++++++-
drivers/bluetooth/btusb.c | 9 ---------
2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index e44b6993cf91..de1dbdc01e5a 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -1248,8 +1248,10 @@ EXPORT_SYMBOL_GPL(btintel_read_debug_features);
int btintel_set_debug_features(struct hci_dev *hdev,
const struct intel_debug_features *features)
{
- u8 mask[11] = { 0x0a, 0x92, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00,
+ u8 mask[11] = { 0x0a, 0x92, 0x02, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00 };
+ u8 period[5] = { 0x04, 0x91, 0x02, 0x01, 0x00 };
+ u8 trace_enable = 0x02;
struct sk_buff *skb;

if (!features)
@@ -1266,8 +1268,24 @@ int btintel_set_debug_features(struct hci_dev *hdev,
PTR_ERR(skb));
return PTR_ERR(skb);
}
+ kfree_skb(skb);
+
+ skb = __hci_cmd_sync(hdev, 0xfc8b, 5, period, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ bt_dev_err(hdev, "Setting periodicity for link statistics traces failed (%ld)",
+ PTR_ERR(skb));
+ return PTR_ERR(skb);
+ }
+ kfree_skb(skb);

+ skb = __hci_cmd_sync(hdev, 0xfca1, 1, &trace_enable, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ bt_dev_err(hdev, "Enable tracing of link statistics events failed (%ld)",
+ PTR_ERR(skb));
+ return PTR_ERR(skb);
+ }
kfree_skb(skb);
+
return 0;
}
EXPORT_SYMBOL_GPL(btintel_set_debug_features);
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 192cb8c191bc..096b743977a7 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2811,7 +2811,6 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
u32 boot_param;
char ddcname[64];
int err;
- struct intel_debug_features features;

BT_DBG("%s", hdev->name);

@@ -2865,14 +2864,6 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
btintel_load_ddc_config(hdev, ddcname);
}

- /* Read the Intel supported features and if new exception formats
- * supported, need to load the additional DDC config to enable.
- */
- btintel_read_debug_features(hdev, &features);
-
- /* Set DDC mask for available debug features */
- btintel_set_debug_features(hdev, &features);
-
/* Read the Intel version information after loading the FW */
err = btintel_read_version(hdev, &ver);
if (err)
--
2.31.1.295.g9ea45b61b8-goog


2021-04-12 08:21:42

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1,1/2] Bluetooth: btusb: support link statistics telemetry events

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=465339

---Test result---

##############################
Test: CheckPatch - PASS


##############################
Test: CheckGitLint - FAIL
Bluetooth: Support the vendor specific debug events
14: B1 Line exceeds max length (90>80): "Reviewed-by: Chethan Tumkur Narayan <[email protected]>"


##############################
Test: CheckBuildK - FAIL
kernel/static_call.c: In function ‘__static_call_update’:
kernel/static_call.c:153:18: warning: unused variable ‘mod’ [-Wunused-variable]
153 | struct module *mod = site_mod->mod;
| ^~~
drivers/bluetooth/btusb.c: In function ‘btusb_setup_intel_newgen’:
drivers/bluetooth/btusb.c:2963:2: error: implicit declaration of function ‘btintel_read_debug_features’ [-Werror=implicit-function-declaration]
2963 | btintel_read_debug_features(hdev, &features);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/bluetooth/btusb.c:2966:2: error: implicit declaration of function ‘btintel_set_debug_features’ [-Werror=implicit-function-declaration]
2966 | btintel_set_debug_features(hdev, &features);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: drivers/bluetooth/btusb.o] Error 1
make[1]: *** [scripts/Makefile.build:514: drivers/bluetooth] Error 2
make: *** [Makefile:1851: drivers] Error 2


##############################
Test: CheckTestRunner: Setup - PASS


##############################
Test: CheckTestRunner: l2cap-tester - PASS
Total: 40, Passed: 34 (85.0%), Failed: 0, Not Run: 6

##############################
Test: CheckTestRunner: bnep-tester - PASS
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: mgmt-tester - FAIL
Total: 416, Passed: 396 (95.2%), Failed: 6, Not Run: 14

Failed Test Cases
Set connectable off (LE) - Success 2 Failed 0.012 seconds
Set connectable off (LE) - Success 3 Failed 0.012 seconds
Set connectable off (LE) - Success 4 Failed 0.020 seconds
Add Advertising - Success 13 (ADV_SCAN_IND) Failed 0.020 seconds
Add Advertising - Success 14 (ADV_NONCONN_IND) Failed 0.012 seconds
Add Advertising - Success 17 (Connectable -> off) Failed 0.024 seconds

##############################
Test: CheckTestRunner: rfcomm-tester - PASS
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: sco-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: smp-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: userchan-tester - PASS
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth


Attachments:
l2cap-tester.log (42.33 kB)
bnep-tester.log (3.45 kB)
mgmt-tester.log (534.74 kB)
rfcomm-tester.log (11.38 kB)
sco-tester.log (9.66 kB)
smp-tester.log (11.53 kB)
userchan-tester.log (5.31 kB)
Download all attachments