Skip to content

Commit ddc2f48

Browse files
committed
Bluetooth: Controller: Disable connection event continuation on overlap
Disable connection event continuation on overlap with same connection's next event. This implementation has bugs and needs to be fixed in subsequent commits. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
1 parent 5d5e337 commit ddc2f48

File tree

1 file changed

+22
-2
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/lll

1 file changed

+22
-2
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static uint8_t crc_valid;
6969
static uint8_t is_aborted;
7070
static uint16_t tx_cnt;
7171
static uint16_t trx_cnt;
72+
static uint8_t trx_busy_iteration;
7273

7374
#if defined(CONFIG_BT_CTLR_LE_ENC)
7475
static uint8_t mic_state;
@@ -153,13 +154,21 @@ void lll_conn_prepare_reset(void)
153154
crc_valid = 0U;
154155
crc_expire = 0U;
155156
is_aborted = 0U;
157+
trx_busy_iteration = 0U;
156158

157159
#if defined(CONFIG_BT_CTLR_LE_ENC)
158160
mic_state = LLL_CONN_MIC_NONE;
159161
#endif /* CONFIG_BT_CTLR_LE_ENC */
160162
}
161163

162164
#if defined(CONFIG_BT_CENTRAL)
165+
/* Number of times central event being aborted by same event instance be skipped */
166+
/* FIXME: Increasing this causes event pipeline overflow assertion, add LLL implementation to
167+
* gracefully abort the deferred next event when -EBUSY is returned in this is_abort_cb
168+
* interface.
169+
*/
170+
#define CENTRAL_TRX_BUSY_ITERATION_MAX 0
171+
163172
int lll_conn_central_is_abort_cb(void *next, void *curr,
164173
lll_prepare_cb_t *resume_cb)
165174
{
@@ -171,7 +180,9 @@ int lll_conn_central_is_abort_cb(void *next, void *curr,
171180
return 0;
172181
}
173182

174-
} else if (trx_cnt < 1U) {
183+
} else if ((trx_cnt < 1U) && (trx_busy_iteration < CENTRAL_TRX_BUSY_ITERATION_MAX)) {
184+
trx_busy_iteration++;
185+
175186
/* Do not be aborted by same event if a single central's Rx has not completed.
176187
* Cases where single trx duration can be greater than connection interval.
177188
*/
@@ -183,6 +194,13 @@ int lll_conn_central_is_abort_cb(void *next, void *curr,
183194
#endif /* CONFIG_BT_CENTRAL */
184195

185196
#if defined(CONFIG_BT_PERIPHERAL)
197+
/* Number of times peripheral event being aborted by same event instance be skipped */
198+
/* FIXME: Increasing this causes event pipeline overflow assertion, add LLL implementation to
199+
* gracefully abort the deferred next event when -EBUSY is returned in this is_abort_cb
200+
* interface.
201+
*/
202+
#define PERIPHERAL_TRX_BUSY_ITERATION_MAX 0
203+
186204
int lll_conn_peripheral_is_abort_cb(void *next, void *curr,
187205
lll_prepare_cb_t *resume_cb)
188206
{
@@ -194,7 +212,9 @@ int lll_conn_peripheral_is_abort_cb(void *next, void *curr,
194212
return 0;
195213
}
196214

197-
} else if (tx_cnt < 1U) {
215+
} else if ((tx_cnt < 1U) && (trx_busy_iteration < PERIPHERAL_TRX_BUSY_ITERATION_MAX)) {
216+
trx_busy_iteration++;
217+
198218
/* Do not be aborted by same event if a single peripheral's Tx has not completed.
199219
* Cases where single trx duration can be greater than connection interval.
200220
*/

0 commit comments

Comments
 (0)