@@ -48,11 +48,18 @@ static void isr_done(void *param);
48
48
static inline int isr_rx_pdu (struct lll_conn * lll , struct pdu_data * pdu_data_rx ,
49
49
uint8_t * is_rx_enqueue ,
50
50
struct node_tx * * tx_release , uint8_t * is_done );
51
+
52
+ #if defined(CONFIG_BT_CTLR_TX_DEFER )
53
+ static void isr_tx_deferred_set (void * param );
54
+ #endif /* CONFIG_BT_CTLR_TX_DEFER */
55
+
51
56
static void empty_tx_init (void );
57
+
52
58
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX )
53
59
static inline bool create_iq_report (struct lll_conn * lll , uint8_t rssi_ready ,
54
60
uint8_t packet_status );
55
61
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RX */
62
+
56
63
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_TX )
57
64
static struct pdu_data * get_last_tx_pdu (struct lll_conn * lll );
58
65
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_TX */
@@ -365,7 +372,8 @@ void lll_conn_isr_rx(void *param)
365
372
}
366
373
367
374
/* Decide on event continuation and hence Radio Shorts to use */
368
- is_done = is_done || ((crc_ok ) && (pdu_data_rx -> md == 0 ) &&
375
+ is_done = is_done || ((crc_ok ) &&
376
+ (pdu_data_rx -> md == 0 ) &&
369
377
(pdu_data_tx -> md == 0 ) &&
370
378
(pdu_data_tx -> len == 0 ));
371
379
@@ -445,6 +453,22 @@ void lll_conn_isr_rx(void *param)
445
453
LL_ASSERT (!radio_is_address ());
446
454
}
447
455
456
+ #if defined(CONFIG_BT_CTLR_TX_DEFER )
457
+ if (!is_empty_pdu_tx_retry && (pdu_data_tx -> len == 0U )) {
458
+ uint32_t tx_defer_us ;
459
+ uint32_t defer_us ;
460
+
461
+ /* Restore state if transmission setup for empty PDU */
462
+ lll -> empty = 0U ;
463
+
464
+ /* Setup deferred tx packet set */
465
+ tx_defer_us = radio_tmr_tifs_base_get () + EVENT_IFS_US -
466
+ HAL_RADIO_TMR_DEFERRED_TX_DELAY_US ;
467
+ defer_us = radio_tmr_isr_set (tx_defer_us , isr_tx_deferred_set ,
468
+ param );
469
+ }
470
+ #endif /* CONFIG_BT_CTLR_TX_DEFER */
471
+
448
472
lll_conn_isr_rx_exit :
449
473
/* Save the AA captured for the first Rx in connection event */
450
474
if (!radio_tmr_aa_restore ()) {
@@ -666,9 +690,11 @@ void lll_conn_isr_tx(void *param)
666
690
}
667
691
668
692
#if defined(CONFIG_BT_CTLR_PROFILE_ISR ) || \
693
+ defined(CONFIG_BT_CTLR_TX_DEFER ) || \
669
694
defined(HAL_RADIO_GPIO_HAVE_PA_PIN )
670
695
radio_tmr_end_capture ();
671
696
#endif /* CONFIG_BT_CTLR_PROFILE_ISR ||
697
+ * CONFIG_BT_CTLR_TX_DEFER ||
672
698
* HAL_RADIO_GPIO_HAVE_PA_PIN
673
699
*/
674
700
@@ -1125,6 +1151,25 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx,
1125
1151
return 0 ;
1126
1152
}
1127
1153
1154
+ #if defined(CONFIG_BT_CTLR_TX_DEFER )
1155
+ static void isr_tx_deferred_set (void * param )
1156
+ {
1157
+ struct pdu_data * pdu_data_tx ;
1158
+ struct lll_conn * lll ;
1159
+
1160
+ /* Prepare Tx PDU, maybe we have non-empty PDU when we check here */
1161
+ lll = param ;
1162
+ lll_conn_pdu_tx_prep (lll , & pdu_data_tx );
1163
+
1164
+ /* Fill sn and nesn */
1165
+ pdu_data_tx -> sn = lll -> sn ;
1166
+ pdu_data_tx -> nesn = lll -> nesn ;
1167
+
1168
+ /* setup the radio tx packet buffer */
1169
+ lll_conn_tx_pkt_set (lll , pdu_data_tx );
1170
+ }
1171
+ #endif /* CONFIG_BT_CTLR_TX_DEFER */
1172
+
1128
1173
static void empty_tx_init (void )
1129
1174
{
1130
1175
struct pdu_data * p ;
0 commit comments