diff --git a/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52820.conf b/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52820.conf index 93bd2a71c6d..494694bb519 100644 --- a/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52820.conf +++ b/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52820.conf @@ -19,5 +19,5 @@ CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=y CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y # Ensure that there is enough control prcedure contexts to queue and execute all procedures -CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6 +CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6 CONFIG_BT_CTLR_ADVANCED_FEATURES=y diff --git a/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52833.conf index 93bd2a71c6d..494694bb519 100644 --- a/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52833.conf +++ b/samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52833.conf @@ -19,5 +19,5 @@ CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=y CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y # Ensure that there is enough control prcedure contexts to queue and execute all procedures -CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6 +CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6 CONFIG_BT_CTLR_ADVANCED_FEATURES=y diff --git a/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52820.conf b/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52820.conf index bb4952ac87f..b490025c2b9 100644 --- a/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52820.conf +++ b/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52820.conf @@ -20,4 +20,4 @@ CONFIG_BT_CTLR_DF_CONN_CTE_RSP=y # Ensure that there is enough control prcedure contexts to queue and execute all procedures CONFIG_BT_CTLR_ADVANCED_FEATURES=y -CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6 +CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6 diff --git a/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.conf index bb4952ac87f..b490025c2b9 100644 --- a/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.conf +++ b/samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.conf @@ -20,4 +20,4 @@ CONFIG_BT_CTLR_DF_CONN_CTE_RSP=y # Ensure that there is enough control prcedure contexts to queue and execute all procedures CONFIG_BT_CTLR_ADVANCED_FEATURES=y -CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6 +CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6 diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 57a473b164b..f9b1a44d369 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -532,7 +532,7 @@ config BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM procedures/connections with allocation through a fifo queue. Configure between 0 and (4 - BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) * BT_CTLR_LLCP_CONN -config BT_CTLR_LLCP_PROC_CTX_BUF_NUM +config BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM int "Number of local control procedure contexts to be available across all connections" default 2 if BT_CTLR_LLCP_CONN = 1 default BT_CTLR_LLCP_CONN if BT_CTLR_LLCP_CONN > 1 diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp.c b/subsys/bluetooth/controller/ll_sw/ull_llcp.c index 3f4926091a5..e236e0fec21 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp.c @@ -59,7 +59,8 @@ static uint8_t buffer_mem_tx[TX_CTRL_BUF_SIZE * LLCP_TX_CTRL_BUF_COUNT]; static struct llcp_mem_pool mem_tx = { .pool = buffer_mem_tx }; /* TODO: Determine 'correct' number of ctx */ -static uint8_t buffer_mem_local_ctx[PROC_CTX_BUF_SIZE * CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM]; +static uint8_t buffer_mem_local_ctx[PROC_CTX_BUF_SIZE * + CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM]; static struct llcp_mem_pool mem_local_ctx = { .pool = buffer_mem_local_ctx }; /* TODO(thoh-ot): Determine 'correct' number of ctx */ @@ -428,7 +429,8 @@ struct proc_ctx *llcp_create_remote_procedure(enum llcp_proc proc) void ull_cp_init(void) { - mem_init(mem_local_ctx.pool, PROC_CTX_BUF_SIZE, CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM, + mem_init(mem_local_ctx.pool, PROC_CTX_BUF_SIZE, + CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM, &mem_local_ctx.free); mem_init(mem_remote_ctx.pool, PROC_CTX_BUF_SIZE, CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM, @@ -1057,10 +1059,10 @@ void test_int_mem_proc_ctx(void) ull_cp_init(); nr_of_free_ctx = ctx_buffers_free(); - zassert_equal(nr_of_free_ctx, CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM + + zassert_equal(nr_of_free_ctx, CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM + CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM, NULL); - for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) { + for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) { ctx1 = proc_ctx_acquire(&mem_local_ctx); /* The previous acquire should be valid */ @@ -1163,7 +1165,7 @@ void test_int_create_proc(void) zassert_equal(ctx->collision, 0, NULL); zassert_equal(ctx->pause, 0, NULL); - for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) { + for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) { zassert_not_null(ctx, NULL); ctx = create_procedure(PROC_VERSION_EXCHANGE, &mem_local_ctx); } diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c b/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c index ea61e6e1145..73a85ccc38f 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c +++ b/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c @@ -140,14 +140,14 @@ void test_feat_exchange_central_loc_2(void) ull_cp_state_set(&conn, ULL_CP_CONNECTED); err = ull_cp_feature_exchange(&conn); - for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) { + for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) { zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL); err = ull_cp_feature_exchange(&conn); } zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL); zassert_equal(ctx_buffers_free(), - test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM, + test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM, "Free CTX buffers %d", ctx_buffers_free()); } diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c b/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c index bf6cfd64de8..660a3a2ca7e 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c +++ b/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c @@ -156,7 +156,7 @@ void test_hci_feat_exchange_wrong_handle(void) ctx_counter++; } while (ctx != NULL); - zassert_equal(ctx_counter, CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM + 1, + zassert_equal(ctx_counter, CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM + 1, "Error in setup of test\n"); err = ll_feature_req_send(conn_handle); diff --git a/tests/bluetooth/controller/ctrl_version/src/main.c b/tests/bluetooth/controller/ctrl_version/src/main.c index e256b3d1d72..f767e9fc4f2 100644 --- a/tests/bluetooth/controller/ctrl_version/src/main.c +++ b/tests/bluetooth/controller/ctrl_version/src/main.c @@ -121,7 +121,7 @@ void test_version_exchange_central_loc_2(void) err = ull_cp_version_exchange(&conn); - for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) { + for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) { zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL); err = ull_cp_version_exchange(&conn); } @@ -129,7 +129,7 @@ void test_version_exchange_central_loc_2(void) zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL); zassert_equal(ctx_buffers_free(), - test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM, + test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM, "Free CTX buffers %d", ctx_buffers_free()); } diff --git a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h index f3892e3c3d4..c251a56013d 100644 --- a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h +++ b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h @@ -85,8 +85,8 @@ #define CONFIG_BT_CTLR_LLCP_TX_PER_CONN_TX_CTRL_BUF_NUM_MAX (4) #endif -#ifndef CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM -#define CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM CONFIG_BT_CTLR_LLCP_CONN +#ifndef CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM +#define CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM CONFIG_BT_CTLR_LLCP_CONN #endif #ifndef CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM