From ce1580765dc25ccf111933d77330b5830f83a614 Mon Sep 17 00:00:00 2001 From: Andries Kruithof Date: Wed, 21 Sep 2022 13:32:26 +0200 Subject: [PATCH] Bluetooth: controller: set Ctrl Tx buffers to non-zero Set the correct number of Ctrl Tx buffers used for the new implementation, so that the ACK-fifo gets the correct size Signed-off-by: Andries Kruithof --- subsys/bluetooth/controller/ll_sw/ull_conn.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 6050573a296..234a0e4445a 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -47,6 +47,9 @@ #endif /* CONFIG_BT_CTLR_USER_EXT */ #include "ull_internal.h" +#if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY) +#include "ull_llcp_internal.h" +#endif /* CONFIG_BT_LL_SW_LLCP_LEGACY */ #include "ull_sched_internal.h" #include "ull_chan_internal.h" #include "ull_conn_internal.h" @@ -200,7 +203,7 @@ static uint8_t force_md_cnt_calc(struct lll_conn *lll_conn, uint32_t tx_rate); #if defined(CONFIG_BT_LL_SW_LLCP_LEGACY) #define CONN_TX_CTRL_BUFFERS (4 * CONFIG_BT_CTLR_LLCP_CONN) #else /* !CONFIG_BT_LL_SW_LLCP_LEGACY */ -#define CONN_TX_CTRL_BUFFERS 0 +#define CONN_TX_CTRL_BUFFERS LLCP_TX_CTRL_BUF_COUNT #endif /* !CONFIG_BT_LL_SW_LLCP_LEGACY */ #define CONN_TX_CTRL_BUF_SIZE MROUND(offsetof(struct node_tx, pdu) + \ offsetof(struct pdu_data, llctrl) + \ @@ -213,6 +216,10 @@ static uint8_t force_md_cnt_calc(struct lll_conn *lll_conn, uint32_t tx_rate); /* CIS Establishment procedure state values */ #define CIS_REQUEST_AWAIT_HOST 2 +/* + * TODO: when the legacy LLCP is removed we can replace 'CONN_TX_CTRL_BUFFERS' + * with 'LLCP_TX_CTRL_BUF_COUNT' + */ static MFIFO_DEFINE(conn_tx, sizeof(struct lll_tx), CONN_DATA_BUFFERS); static MFIFO_DEFINE(conn_ack, sizeof(struct lll_tx), (CONN_DATA_BUFFERS +