@@ -586,33 +586,36 @@ void lll_scan_aux_isr_aux_setup(void *param)
586
586
587
587
static void isr_rx_ull_schedule (void * param )
588
588
{
589
- struct lll_scan_aux * lll ;
590
- struct lll_scan * scan_lll ;
589
+ struct lll_scan_aux * lll_aux ;
590
+ struct lll_scan * lll ;
591
591
592
- lll = param ;
593
- scan_lll = ull_scan_aux_lll_parent_get (lll , NULL );
592
+ lll_aux = param ;
593
+ lll = ull_scan_aux_lll_parent_get (lll_aux , NULL );
594
594
595
- isr_rx (scan_lll , lll , lll -> phy );
595
+ isr_rx (lll , lll_aux , lll_aux -> phy );
596
596
}
597
597
598
598
static void isr_rx_lll_schedule (void * param )
599
599
{
600
- struct lll_scan_aux * lll ;
601
600
struct node_rx_pdu * node_rx ;
602
- struct lll_scan * scan_lll ;
601
+ struct lll_scan * lll ;
603
602
uint8_t phy_aux ;
604
603
605
604
node_rx = param ;
606
- scan_lll = node_rx -> hdr .rx_ftr .param ;
607
- lll = scan_lll -> lll_aux ;
605
+ lll = node_rx -> hdr .rx_ftr .param ;
606
+ phy_aux = node_rx -> hdr . rx_ftr . aux_phy ; /* PHY remembered in node rx */
608
607
609
- if (lll ) {
610
- phy_aux = lll -> phy ;
608
+ /* scan context has used LLL scheduling for aux reception */
609
+ if (lll -> is_aux_sched ) {
610
+ isr_rx (lll , NULL , phy_aux );
611
611
} else {
612
- phy_aux = node_rx -> hdr .rx_ftr .aux_phy ;
612
+ /* `lll->lll_aux` would be allocated in ULL for LLL scheduled
613
+ * auxiliary PDU reception by scan context and for case
614
+ * where LLL scheduled chain PDU reception by aux context, it
615
+ * is assigned with the current aux context's LLL context.
616
+ */
617
+ isr_rx (lll , lll -> lll_aux , phy_aux );
613
618
}
614
-
615
- isr_rx (scan_lll , NULL , phy_aux );
616
619
}
617
620
618
621
static void isr_rx (struct lll_scan * lll , struct lll_scan_aux * lll_aux ,
@@ -710,8 +713,16 @@ static void isr_rx(struct lll_scan *lll, struct lll_scan_aux *lll_aux,
710
713
ull_rx_sched ();
711
714
}
712
715
713
- /* Resume scan if scanning ADV_AUX_IND chain */
714
- radio_isr_set (lll_scan_isr_resume , lll );
716
+ /* Check if LLL scheduled auxiliary PDU reception by scan
717
+ * context or auxiliary PDU reception by aux context
718
+ */
719
+ if (lll -> is_aux_sched ) {
720
+ /* Go back to resuming primary channel scanning */
721
+ radio_isr_set (lll_scan_isr_resume , lll );
722
+ } else {
723
+ /* auxiliary channel radio event done */
724
+ radio_isr_set (isr_done , NULL );
725
+ }
715
726
}
716
727
radio_disable ();
717
728
}
@@ -1051,18 +1062,33 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux,
1051
1062
/* Passive scanner or scan responses */
1052
1063
#if defined(CONFIG_BT_CENTRAL )
1053
1064
} else if (!lll -> conn &&
1054
- lll_scan_ext_tgta_check (lll , false, false, pdu , rl_idx )) {
1065
+ ((lll_aux && lll_aux -> is_chain_sched ) ||
1066
+ (lll -> lll_aux && lll -> lll_aux -> is_chain_sched ) ||
1067
+ lll_scan_ext_tgta_check (lll , false, false, pdu , rl_idx ))) {
1055
1068
#else /* !CONFIG_BT_CENTRAL */
1056
- } else if (lll_scan_ext_tgta_check (lll , false , false , pdu , rl_idx )) {
1069
+ } else if ((lll_aux && lll_aux -> is_chain_sched ) ||
1070
+ (lll -> lll_aux && lll -> lll_aux -> is_chain_sched ) ||
1071
+ lll_scan_ext_tgta_check (lll , false , false , pdu , rl_idx )) {
1057
1072
#endif /* !CONFIG_BT_CENTRAL */
1058
1073
1059
1074
ftr = & (node_rx -> hdr .rx_ftr );
1060
1075
if (lll_aux ) {
1061
1076
ftr -> param = lll_aux ;
1062
1077
ftr -> scan_rsp = lll_aux -> state ;
1078
+
1079
+ /* Further auxiliary PDU reception will be chain PDUs */
1080
+ lll_aux -> is_chain_sched = 1U ;
1063
1081
} else if (lll -> lll_aux ) {
1064
1082
ftr -> param = lll ;
1065
1083
ftr -> scan_rsp = lll -> lll_aux -> state ;
1084
+
1085
+ /* Auxiliary PDU received by LLL scheduling by scan
1086
+ * context.
1087
+ */
1088
+ lll -> is_aux_sched = 1U ;
1089
+
1090
+ /* Further auxiliary PDU reception will be chain PDUs */
1091
+ lll -> lll_aux -> is_chain_sched = 1U ;
1066
1092
} else {
1067
1093
/* Return -ECHILD, as ULL execution has not yet assigned
1068
1094
* an aux context. This can happen only under LLL
@@ -1113,7 +1139,6 @@ static int isr_rx_pdu(struct lll_scan *lll, struct lll_scan_aux *lll_aux,
1113
1139
* disable so prevent caller from doing it again.
1114
1140
*/
1115
1141
if (ftr -> aux_lll_sched ) {
1116
- lll -> is_aux_sched = 1U ;
1117
1142
return 0 ;
1118
1143
}
1119
1144
0 commit comments