Bluetooth: hci_sync: Use address filtering when HCI_PA_SYNC is set
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH v3 1/2 Bluetooth: hci_sync: Use address filtering when HCI_PA_SYNC is set
From: Luiz Augusto von Dentz <[email protected]>
If HCI_PA_SYNC flag is set it means there is a Periodic Advertising Synchronization pending, so this attempts to locate the address passed to HCI_OP_LE_PA_CREATE_SYNC and program it in the accept list so only reports with that address are processed.
--- net/bluetooth/hci_sync.c | 45 +++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 10 deletions(-)
net/bluetooth/hci_sync.c +35 -10
@@ -2566,6 +2566,16 @@ static struct conn_params *conn_params_copy(struct list_head *list, size_t *n)return p; } +/* Clear LE Accept List */ +static int hci_le_clear_accept_list_sync (struct hci_dev *hdev) +{ +if (!(hdev->commands[26 ] &0x80 )) +return 0 ; + +return __hci_cmd_sync_status (hdev,HCI_OP_LE_CLEAR_ACCEPT_LIST ,0 ,NULL , +HCI_CMD_TIMEOUT ); +} +/* Device must not be scanning when updating the accept list. * * Update is done using the following sequence:
@@ -2614,6 +2624,31 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev) goto done; } +/* Force address filtering if PA Sync is in progress */ +if (hci_dev_test_flag (hdev,HCI_PA_SYNC )) { +struct hci_cp_le_pa_create_sync *sent; + + sent =hci_sent_cmd_data (hdev,HCI_OP_LE_PA_CREATE_SYNC ); +if (sent) { +struct conn_params pa; + +memset (&pa,0 ,sizeof (pa)); + +bacpy (&pa.addr, &sent->addr); + pa.addr_type = sent->addr_type; + +/* Clear first since there could be addresses left +* behind. +*/ +hci_le_clear_accept_list_sync (hdev); + + num_entries =1 ; + err =hci_le_add_accept_list_sync (hdev, &pa, + &num_entries); + goto done; + } + } +/* Go through the current accept list programmed into the * controller one by one and check if that address is connected or is * still in the list of pending connections or list of devices to
@@ -4220,16 +4255,6 @@ static int hci_le_read_accept_list_size_sync(struct hci_dev *hdev) 0, NULL, HCI_CMD_TIMEOUT); } -/* Clear LE Accept List */ -static int hci_le_clear_accept_list_sync (struct hci_dev *hdev) -{ -if (!(hdev->commands[26 ] &0x80 )) -return 0 ; - -return __hci_cmd_sync_status (hdev,HCI_OP_LE_CLEAR_ACCEPT_LIST ,0 ,NULL , -HCI_CMD_TIMEOUT ); -} -/* Read LE Resolving List Size */ static int hci_le_read_resolv_list_size_sync (struct hci_dev *hdev) {
Signature · 1 line
2.43.0
Luiz Augusto von Dentz
maintainerPATCH v3 2/2 Bluetooth: hci_sync: Use QoS to determine which PHY to scan
From: Luiz Augusto von Dentz <[email protected]>
This used the hci_conn QoS to determine which PHY to scan when creating a PA Sync.
--- net/bluetooth/hci_request.c | 2 +- net/bluetooth/hci_sync.c | 65 ++++++++++++++++++++++++++++++------- 2 files changed, 55 insertions(+), 12 deletions(-)
net/bluetooth/hci_request.c +1 -1
@@ -34,9 +34,9 @@void hci_req_init (struct hci_request *req,struct hci_dev *hdev) { +memset (req,0 ,sizeof (*req));skb_queue_head_init (&req->cmd_q); req->hdev = hdev; - req->err =0 ; }void hci_req_purge (struct hci_request *req)
net/bluetooth/hci_sync.c +54 -11
95 lines not on this page · raw message
Signature · 1 line
2.43.0
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=830031
---Test result---
Test Summary:
CheckPatch PASS 1.49 seconds GitLint PASS 0.60 seconds SubjectPrefix PASS 0.23 seconds BuildKernel PASS 27.86 seconds CheckAllWarning PASS 30.56 seconds CheckSparse PASS 35.93 seconds CheckSmatch PASS 99.20 seconds BuildKernel32 PASS 27.59 seconds TestRunnerSetup PASS 505.56 seconds TestRunner_l2cap-tester FAIL 24.47 seconds TestRunner_iso-tester PASS 34.75 seconds TestRunner_bnep-tester PASS 4.82 seconds TestRunner_mgmt-tester FAIL 118.77 seconds TestRunner_rfcomm-tester PASS 7.51 seconds TestRunner_sco-tester PASS 15.04 seconds TestRunner_ioctl-tester PASS 7.96 seconds TestRunner_mesh-tester PASS 6.01 seconds TestRunner_smp-tester PASS 6.95 seconds TestRunner_userchan-tester PASS 5.06 seconds IncrementalBuild PASS 32.27 seconds
Details
##############################
Test: TestRunner_l2cap-tester - FAIL
Desc: Run l2cap-tester with test-runner Output:
Total: 51, Passed: 50 (98.0%), Failed: 1, Not Run: 0
Failed Test Cases
L2CAP LE Client - Close socket 2 Timed out 2.076 seconds
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner Output:
Total: 492, Passed: 489 (99.4%), Failed: 1, Not Run: 2
Failed Test Cases
LL Privacy - Set Device Flag 1 (Device Privacy) Failed 0.142 seconds
---
Regards,
Linux Bluetooth