Bluetooth: controller: Rename local proc ctx config
Rename BT_CTLR_LLCP_PROC_CTX_BUF_NUM to BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM to match naming scheme of BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
This commit is contained in:
parent
33cb9e3433
commit
7f4471c84e
10 changed files with 19 additions and 17 deletions
|
@ -19,5 +19,5 @@ CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=y
|
||||||
CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y
|
CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y
|
||||||
|
|
||||||
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
|
# 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
|
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
|
||||||
|
|
|
@ -19,5 +19,5 @@ CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=y
|
||||||
CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y
|
CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y
|
||||||
|
|
||||||
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
|
# 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
|
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
|
||||||
|
|
|
@ -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
|
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
|
||||||
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
|
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
|
||||||
|
|
|
@ -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
|
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
|
||||||
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
|
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
|
||||||
|
|
|
@ -532,7 +532,7 @@ config BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM
|
||||||
procedures/connections with allocation through a fifo queue.
|
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
|
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"
|
int "Number of local control procedure contexts to be available across all connections"
|
||||||
default 2 if BT_CTLR_LLCP_CONN = 1
|
default 2 if BT_CTLR_LLCP_CONN = 1
|
||||||
default BT_CTLR_LLCP_CONN if BT_CTLR_LLCP_CONN > 1
|
default BT_CTLR_LLCP_CONN if BT_CTLR_LLCP_CONN > 1
|
||||||
|
|
|
@ -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 };
|
static struct llcp_mem_pool mem_tx = { .pool = buffer_mem_tx };
|
||||||
|
|
||||||
/* TODO: Determine 'correct' number of ctx */
|
/* 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 };
|
static struct llcp_mem_pool mem_local_ctx = { .pool = buffer_mem_local_ctx };
|
||||||
|
|
||||||
/* TODO(thoh-ot): Determine 'correct' number of 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)
|
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_local_ctx.free);
|
||||||
mem_init(mem_remote_ctx.pool, PROC_CTX_BUF_SIZE,
|
mem_init(mem_remote_ctx.pool, PROC_CTX_BUF_SIZE,
|
||||||
CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM,
|
CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM,
|
||||||
|
@ -1057,10 +1059,10 @@ void test_int_mem_proc_ctx(void)
|
||||||
ull_cp_init();
|
ull_cp_init();
|
||||||
|
|
||||||
nr_of_free_ctx = ctx_buffers_free();
|
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);
|
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);
|
ctx1 = proc_ctx_acquire(&mem_local_ctx);
|
||||||
|
|
||||||
/* The previous acquire should be valid */
|
/* 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->collision, 0, NULL);
|
||||||
zassert_equal(ctx->pause, 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);
|
zassert_not_null(ctx, NULL);
|
||||||
ctx = create_procedure(PROC_VERSION_EXCHANGE, &mem_local_ctx);
|
ctx = create_procedure(PROC_VERSION_EXCHANGE, &mem_local_ctx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,14 +140,14 @@ void test_feat_exchange_central_loc_2(void)
|
||||||
ull_cp_state_set(&conn, ULL_CP_CONNECTED);
|
ull_cp_state_set(&conn, ULL_CP_CONNECTED);
|
||||||
|
|
||||||
err = ull_cp_feature_exchange(&conn);
|
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);
|
zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL);
|
||||||
err = ull_cp_feature_exchange(&conn);
|
err = ull_cp_feature_exchange(&conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL);
|
zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL);
|
||||||
zassert_equal(ctx_buffers_free(),
|
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());
|
"Free CTX buffers %d", ctx_buffers_free());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ void test_hci_feat_exchange_wrong_handle(void)
|
||||||
ctx_counter++;
|
ctx_counter++;
|
||||||
} while (ctx != NULL);
|
} 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");
|
"Error in setup of test\n");
|
||||||
|
|
||||||
err = ll_feature_req_send(conn_handle);
|
err = ll_feature_req_send(conn_handle);
|
||||||
|
|
|
@ -121,7 +121,7 @@ void test_version_exchange_central_loc_2(void)
|
||||||
|
|
||||||
err = ull_cp_version_exchange(&conn);
|
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);
|
zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL);
|
||||||
err = ull_cp_version_exchange(&conn);
|
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_not_equal(err, BT_HCI_ERR_SUCCESS, NULL);
|
||||||
|
|
||||||
zassert_equal(ctx_buffers_free(),
|
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());
|
"Free CTX buffers %d", ctx_buffers_free());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,8 +85,8 @@
|
||||||
#define CONFIG_BT_CTLR_LLCP_TX_PER_CONN_TX_CTRL_BUF_NUM_MAX (4)
|
#define CONFIG_BT_CTLR_LLCP_TX_PER_CONN_TX_CTRL_BUF_NUM_MAX (4)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM
|
#ifndef CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
|
||||||
#define CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM CONFIG_BT_CTLR_LLCP_CONN
|
#define CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM CONFIG_BT_CTLR_LLCP_CONN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM
|
#ifndef CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue