@@ -59,9 +59,10 @@ static void ticker_op_cb(uint32_t status, void *param);
5959static void ticker_update_sync_op_cb (uint32_t status , void * param );
6060static void ticker_stop_op_cb (uint32_t status , void * param );
6161static 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 )
6364static 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 */
6566
6667#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX )
6768static 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,
173174 lll_sync -> skip_event = 0U ;
174175 lll_sync -> window_widening_prepare_us = 0U ;
175176 lll_sync -> window_widening_event_us = 0U ;
177+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
176178 lll_sync -> cte_type = sync_cte_type ;
177179 lll_sync -> filter_policy = scan -> per_scan .filter_policy ;
180+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
178181
179182 /* Reporting initially enabled/disabled */
180183 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,
532535
533536void ull_sync_established_report (memq_link_t * link , struct node_rx_hdr * rx )
534537{
535- enum sync_status sync_status ;
536538 struct node_rx_pdu * rx_establ ;
537539 struct ll_sync_set * ull_sync ;
538540 struct node_rx_ftr * ftr ;
@@ -541,6 +543,9 @@ void ull_sync_established_report(memq_link_t *link, struct node_rx_hdr *rx)
541543
542544 ftr = & rx -> rx_ftr ;
543545
546+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
547+ enum sync_status sync_status ;
548+
544549#if defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
545550 sync_status = ftr -> sync_status ;
546551#else
@@ -562,35 +567,46 @@ void ull_sync_established_report(memq_link_t *link, struct node_rx_hdr *rx)
562567 * or the CTE type is incorrect and filter policy doesn't allow to continue scanning.
563568 */
564569 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+
565574 /* Set the sync handle corresponding to the LLL context passed in the node rx
566575 * footer field.
567576 */
568- #if defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
569577 lll = ftr -> param ;
570- #endif /* CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
571578 ull_sync = HDR_LLL2ULL (lll );
572579
573580 /* Prepare and dispatch sync notification */
574581 rx_establ = (void * )ull_sync -> node_rx_sync_estab ;
575582 rx_establ -> hdr .type = NODE_RX_TYPE_SYNC ;
576583 se = (void * )rx_establ -> pdu ;
584+
585+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
577586 se -> status = (ftr -> sync_status == SYNC_STAT_TERM ) ?
578587 BT_HCI_ERR_UNSUPP_REMOTE_FEATURE :
579588 BT_HCI_ERR_SUCCESS ;
580589
581- /* Notify done event handler to terminate sync scan */
582590#if !defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
591+ /* Notify done event handler to terminate sync scan if required. */
583592 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 */
585597 ll_rx_put (rx_establ -> hdr .link , rx_establ );
586598 ll_rx_sched ();
587599 }
588600
601+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
589602 /* Handle periodic advertising PDU and send periodic advertising scan report when
590603 * the sync was found or was established in the past. The report is not send if
591604 * scanning is terminated due to wrong CTE type.
592605 */
593606 if (sync_status != SYNC_STAT_TERM ) {
607+ #else
608+ if (1 ) {
609+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
594610 /* Switch sync event prepare function to one reposnsible for regular PDUs receive */
595611 mfy_lll_prepare .fp = lll_sync_prepare ;
596612
@@ -615,14 +631,17 @@ void ull_sync_done(struct node_rx_event_done *done)
615631 sync = CONTAINER_OF (done -> param , struct ll_sync_set , ull );
616632 lll = & sync -> lll ;
617633
634+ #if defined(CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING )
618635#if defined(CONFIG_BT_CTLR_CTEINLINE_SUPPORT )
619636 if (done -> extra .sync_term ) {
620637#else
621638 if (sync -> sync_term ) {
622639#endif /* CONFIG_BT_CTLR_CTEINLINE_SUPPORT */
623640 /* Stop periodic advertising scan ticker */
624641 sync_ticker_cleanup (sync , NULL );
625- } else {
642+ } else
643+ #endif /* CONFIG_BT_CTLR_SYNC_PERIODIC_CTE_TYPE_FILTERING */
644+ {
626645 /* Events elapsed used in timeout checks below */
627646 skip_event = lll -> skip_event ;
628647 elapsed_event = skip_event + 1 ;
@@ -930,7 +949,8 @@ static void ticker_update_op_status_give(uint32_t status, void *param)
930949}
931950#endif /* CONFIG_BT_CTLR_DF_SCAN_CTE_RX */
932951
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 )
934954static struct pdu_cte_info * pdu_cte_info_get (struct pdu_adv * pdu )
935955{
936956 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)
953973
954974 return (struct pdu_cte_info * )hdr -> data ;
955975}
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