Skip to content

Commit 42276f5

Browse files
ppryga-nordiccfriedt
authored andcommitted
Bluetooth: controller: rework per scan lll to allow filt by CTE type
Periodic advertisement synchronization may be filtered by CTE type. If particular CTE type is not allowed then depening on filtering policy: - if filtering policy is off synchronization if terminated - if filtering policy is on synchronization is continued to synchonize with another device from allowed adverisements list. If synchronization is established and peer device changes CTE type to one that is not allowed, synchronization should be maintained. There are two new execution paths. First one is executed when synchronization is created. In this case CTEILINE is enabled to parse PDU for CTEInfo field. In this execution path CTE type is verified. Second execution path does not include parsing PDU for CTEInfo and verification of CTE type. Information about sync allowed is added to node_rx instance that transports received PDU data. In case the sync has to be terminated the node_rx will not hold PDU data. Also done event is extended with information about sync termination if CTE type is not allowed and filtering policy is off. Signed-off-by: Piotr Pryga <[email protected]>
1 parent 36bec35 commit 42276f5

File tree

3 files changed

+408
-97
lines changed

3 files changed

+408
-97
lines changed

subsys/bluetooth/controller/ll_sw/lll.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ struct node_rx_ftr {
284284
uint8_t aux_lll_sched:1;
285285
uint8_t aux_w4next:1;
286286
uint8_t aux_failed:1;
287+
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
288+
uint8_t sync_status:2;
289+
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */
287290

288291
uint8_t phy_flags:1;
289292
uint8_t scan_req:1;
@@ -400,7 +403,13 @@ struct event_done_extra {
400403
union {
401404
struct {
402405
uint16_t trx_cnt;
403-
uint8_t crc_valid;
406+
uint8_t crc_valid:1;
407+
#if defined(CONFIG_BT_CTLR_SYNC_PERIODIC)
408+
/* Used to inform ULL that periodic advertising sync scan should be
409+
* terminated.
410+
*/
411+
uint8_t sync_term:1;
412+
#endif /* CONFIG_BT_CTLR_SYNC_PERIODIC */
404413
#if defined(CONFIG_BT_CTLR_LE_ENC)
405414
uint8_t mic_state;
406415
#endif /* CONFIG_BT_CTLR_LE_ENC */

subsys/bluetooth/controller/ll_sw/lll_sync.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/* Periodic advertisements synchronization status. */
8+
enum sync_status {
9+
SYNC_STAT_FOUND,
10+
SYNC_STAT_READY,
11+
SYNC_STAT_TERM
12+
};
13+
714
struct lll_sync {
815
struct lll_hdr hdr;
916

@@ -12,6 +19,12 @@ struct lll_sync {
1219

1320
uint8_t phy:3;
1421
uint8_t is_rx_enabled:1;
22+
/* Bitmask providing not allowed types of CTE. */
23+
uint8_t cte_type:5;
24+
/* The member is required for filtering by CTE type. If filtering policy is disabled then
25+
* synchronization is terminated for periodic advertisements with wrong CTE type.
26+
*/
27+
uint8_t filter_policy:1;
1528
uint8_t is_aux_sched:1;
1629

1730
uint16_t skip_prepare;
@@ -43,6 +56,7 @@ struct lll_sync {
4356

4457
int lll_sync_init(void);
4558
int lll_sync_reset(void);
59+
void lll_sync_create_prepare(void *param);
4660
void lll_sync_prepare(void *param);
4761

4862
extern uint16_t ull_sync_lll_handle_get(struct lll_sync *lll);

0 commit comments

Comments
 (0)