@@ -59,9 +59,10 @@ static void ticker_op_cb(uint32_t status, void *param);
59
59
static void ticker_update_sync_op_cb (uint32_t status , void * param );
60
60
static void ticker_stop_op_cb (uint32_t status , void * param );
61
61
static void sync_lost (void * param );
62
- #if !defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
62
+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING ) && \
63
+ !defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
63
64
static struct pdu_cte_info * pdu_cte_info_get (struct pdu_adv * pdu );
64
- #endif /* CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
65
+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING && ! CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
65
66
66
67
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX )
67
68
static void ticker_update_op_status_give (uint32_t status , void * param );
@@ -173,8 +174,10 @@ uint8_t ll_sync_create(uint8_t options, uint8_t sid, uint8_t adv_addr_type,
173
174
lll_sync -> skip_event = 0U ;
174
175
lll_sync -> window_widening_prepare_us = 0U ;
175
176
lll_sync -> window_widening_event_us = 0U ;
177
+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
176
178
lll_sync -> cte_type = sync_cte_type ;
177
179
lll_sync -> filter_policy = scan -> per_scan .filter_policy ;
180
+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
178
181
179
182
/* Reporting initially enabled/disabled */
180
183
lll_sync -> is_rx_enabled = options & BIT (1 );
@@ -532,7 +535,6 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux,
532
535
533
536
void ull_sync_established_report (memq_link_t * link , struct node_rx_hdr * rx )
534
537
{
535
- enum sync_status sync_status ;
536
538
struct node_rx_pdu * rx_establ ;
537
539
struct ll_sync_set * ull_sync ;
538
540
struct node_rx_ftr * ftr ;
@@ -541,6 +543,9 @@ void ull_sync_established_report(memq_link_t *link, struct node_rx_hdr *rx)
541
543
542
544
ftr = & rx -> rx_ftr ;
543
545
546
+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
547
+ enum sync_status sync_status ;
548
+
544
549
#if defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
545
550
sync_status = ftr -> sync_status ;
546
551
#else
@@ -562,35 +567,46 @@ void ull_sync_established_report(memq_link_t *link, struct node_rx_hdr *rx)
562
567
* or the CTE type is incorrect and filter policy doesn't allow to continue scanning.
563
568
*/
564
569
if (sync_status != SYNC_STAT_READY_OR_CONT_SCAN ) {
570
+ #else
571
+ if (1 ) {
572
+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
573
+
565
574
/* Set the sync handle corresponding to the LLL context passed in the node rx
566
575
* footer field.
567
576
*/
568
- #if defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
569
577
lll = ftr -> param ;
570
- #endif /* CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
571
578
ull_sync = HDR_LLL2ULL (lll );
572
579
573
580
/* Prepare and dispatch sync notification */
574
581
rx_establ = (void * )ull_sync -> node_rx_sync_estab ;
575
582
rx_establ -> hdr .type = NODE_RX_TYPE_SYNC ;
576
583
se = (void * )rx_establ -> pdu ;
584
+
585
+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
577
586
se -> status = (ftr -> sync_status == SYNC_STAT_TERM ) ?
578
587
BT_HCI_ERR_UNSUPP_REMOTE_FEATURE :
579
588
BT_HCI_ERR_SUCCESS ;
580
589
581
- /* Notify done event handler to terminate sync scan */
582
590
#if !defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
591
+ /* Notify done event handler to terminate sync scan if required. */
583
592
ull_sync -> sync_term = sync_status == SYNC_STAT_TERM ;
584
- #endif /* CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
593
+ #endif /* !CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
594
+ #else
595
+ se -> status = BT_HCI_ERR_SUCCESS ;
596
+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
585
597
ll_rx_put (rx_establ -> hdr .link , rx_establ );
586
598
ll_rx_sched ();
587
599
}
588
600
601
+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
589
602
/* Handle periodic advertising PDU and send periodic advertising scan report when
590
603
* the sync was found or was established in the past. The report is not send if
591
604
* scanning is terminated due to wrong CTE type.
592
605
*/
593
606
if (sync_status != SYNC_STAT_TERM ) {
607
+ #else
608
+ if (1 ) {
609
+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
594
610
/* Switch sync event prepare function to one reposnsible for regular PDUs receive */
595
611
mfy_lll_prepare .fp = lll_sync_prepare ;
596
612
@@ -615,14 +631,17 @@ void ull_sync_done(struct node_rx_event_done *done)
615
631
sync = CONTAINER_OF (done -> param , struct ll_sync_set , ull );
616
632
lll = & sync -> lll ;
617
633
634
+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
618
635
#if defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
619
636
if (done -> extra .sync_term ) {
620
637
#else
621
638
if (sync -> sync_term ) {
622
639
#endif /* CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
623
640
/* Stop periodic advertising scan ticker */
624
641
sync_ticker_cleanup (sync , NULL );
625
- } else {
642
+ } else
643
+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
644
+ {
626
645
/* Events elapsed used in timeout checks below */
627
646
skip_event = lll -> skip_event ;
628
647
elapsed_event = skip_event + 1 ;
@@ -930,7 +949,8 @@ static void ticker_update_op_status_give(uint32_t status, void *param)
930
949
}
931
950
#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
932
951
933
- #if !defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
952
+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING ) && \
953
+ !defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
934
954
static struct pdu_cte_info * pdu_cte_info_get (struct pdu_adv * pdu )
935
955
{
936
956
struct pdu_adv_com_ext_adv * com_hdr ;
@@ -953,4 +973,4 @@ static struct pdu_cte_info *pdu_cte_info_get(struct pdu_adv *pdu)
953
973
954
974
return (struct pdu_cte_info * )hdr -> data ;
955
975
}
956
- #endif /* CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
976
+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING && ! CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
0 commit comments