Skip to content

Commit

Permalink
Bluetooth: controller: legacy: Fix assert on DLE procedure stall
Browse files Browse the repository at this point in the history
Fix local initiated Data Length Update procedure from being
stalled when a remote initiates a procedure with instant.

Fixes zephyrproject-rtos#23069.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
  • Loading branch information
cvinayak committed Sep 23, 2020
1 parent 4a25ba8 commit 8c74a74
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion subsys/bluetooth/controller/ll_sw/ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9047,13 +9047,40 @@ static void event_connection_prepare(u32_t ticks_at_expire,
}
}

/* check if procedure is requested */
/* Check if procedures with instant or encryption setup is requested or
* active.
*/
if (conn->llcp_ack != conn->llcp_req) {
/* Stop previous event, to avoid Radio DMA corrupting the
* rx queue
*/
event_stop(0, 0, 0, (void *)STATE_ABORT);

/* Process parallel procedures that are active */
if (0) {
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
/* Check if DLE in progress */
} else if (conn->llcp_length.ack != conn->llcp_length.req) {
if ((conn->llcp_length.state ==
LLCP_LENGTH_STATE_RESIZE) ||
(conn->llcp_length.state ==
LLCP_LENGTH_STATE_RESIZE_RSP)) {
/* handle DLU state machine */
if (event_len_prep(conn)) {
/* NOTE: rx pool could not be resized,
* lets skip this event and try in the
* next event.
*/
_radio.ticker_id_prepare = 0U;

goto event_connection_prepare_skip;
}
}
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
}

/* Process procedures with instants or encryption setup */
/* FIXME: Make LE Ping cacheable */
switch (conn->llcp_type) {
case LLCP_CONN_UPD:
if (!event_conn_upd_prep(conn, event_counter,
Expand Down

0 comments on commit 8c74a74

Please sign in to comment.