Skip to content

Commit f4d05b7

Browse files
committed
Bluetooth: Controller: Fix conn timeout due to delayed conn upd ind
Unlike legacy Zephyr Controller's double headed Tx queue linked list, the new split Zephyr Controller's new LLCP does not place a control PDU at the head of the Tx queue causing control PDUs to be delayed on air. Increase the instant value in the LE Connection Update Ind PDU if there are prior enqueued PDUs in the LLL context of the connection. There can still be connection timeout if enqueued PDUs are not being transmitted/acked during repeated retransmissions. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
1 parent d329189 commit f4d05b7

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull_conn.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,21 @@ void ull_conn_tx_lll_enqueue(struct ll_conn *conn, uint8_t count)
14781478
}
14791479
}
14801480

1481+
uint16_t ull_conn_tx_enqueue_count_get(struct ll_conn *conn)
1482+
{
1483+
uint16_t count = 0;
1484+
memq_link_t *curr;
1485+
1486+
curr = memq_peek(conn->lll.memq_tx.head, conn->lll.memq_tx.tail, NULL);
1487+
while (curr != NULL) {
1488+
count++;
1489+
1490+
curr = memq_peek(curr->next, conn->lll.memq_tx.tail, NULL);
1491+
}
1492+
1493+
return count;
1494+
}
1495+
14811496
void ull_conn_link_tx_release(void *link)
14821497
{
14831498
mem_release(link, &mem_link_tx.free);

subsys/bluetooth/controller/ll_sw/ull_conn_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ int ull_conn_llcp(struct ll_conn *conn, uint32_t ticks_at_expire,
3131
void ull_conn_done(struct node_rx_event_done *done);
3232
void ull_conn_tx_demux(uint8_t count);
3333
void ull_conn_tx_lll_enqueue(struct ll_conn *conn, uint8_t count);
34+
uint16_t ull_conn_tx_enqueue_count_get(struct ll_conn *conn);
3435
void ull_conn_link_tx_release(void *link);
3536
uint8_t ull_conn_ack_last_idx_get(void);
3637
memq_link_t *ull_conn_ack_peek(uint8_t *ack_last, uint16_t *handle,

subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ static void cu_prepare_update_ind(struct ll_conn *conn, struct proc_ctx *ctx)
242242
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
243243

244244
ctx->data.cu.instant = ull_conn_event_counter(conn) + conn->lll.latency +
245+
ull_conn_tx_enqueue_count_get(conn) +
245246
CONN_UPDATE_INSTANT_DELTA;
246247
}
247248

0 commit comments

Comments
 (0)