Skip to content

Commit 7f4471c

Browse files
thoh-otcarlescufi
authored andcommitted
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 <[email protected]>
1 parent 33cb9e3 commit 7f4471c

File tree

10 files changed

+19
-17
lines changed

10 files changed

+19
-17
lines changed

samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52820.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=y
1919
CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y
2020

2121
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
22-
CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6
22+
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
2323
CONFIG_BT_CTLR_ADVANCED_FEATURES=y

samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52833.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=y
1919
CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y
2020

2121
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
22-
CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6
22+
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
2323
CONFIG_BT_CTLR_ADVANCED_FEATURES=y

samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52820.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ CONFIG_BT_CTLR_DF_CONN_CTE_RSP=y
2020

2121
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
2222
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
23-
CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6
23+
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6

samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52833.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ CONFIG_BT_CTLR_DF_CONN_CTE_RSP=y
2020

2121
# Ensure that there is enough control prcedure contexts to queue and execute all procedures
2222
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
23-
CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM=6
23+
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6

subsys/bluetooth/controller/Kconfig.ll_sw_split

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ config BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM
532532
procedures/connections with allocation through a fifo queue.
533533
Configure between 0 and (4 - BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) * BT_CTLR_LLCP_CONN
534534

535-
config BT_CTLR_LLCP_PROC_CTX_BUF_NUM
535+
config BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
536536
int "Number of local control procedure contexts to be available across all connections"
537537
default 2 if BT_CTLR_LLCP_CONN = 1
538538
default BT_CTLR_LLCP_CONN if BT_CTLR_LLCP_CONN > 1

subsys/bluetooth/controller/ll_sw/ull_llcp.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ static uint8_t buffer_mem_tx[TX_CTRL_BUF_SIZE * LLCP_TX_CTRL_BUF_COUNT];
5959
static struct llcp_mem_pool mem_tx = { .pool = buffer_mem_tx };
6060

6161
/* TODO: Determine 'correct' number of ctx */
62-
static uint8_t buffer_mem_local_ctx[PROC_CTX_BUF_SIZE * CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM];
62+
static uint8_t buffer_mem_local_ctx[PROC_CTX_BUF_SIZE *
63+
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM];
6364
static struct llcp_mem_pool mem_local_ctx = { .pool = buffer_mem_local_ctx };
6465

6566
/* TODO(thoh-ot): Determine 'correct' number of ctx */
@@ -428,7 +429,8 @@ struct proc_ctx *llcp_create_remote_procedure(enum llcp_proc proc)
428429

429430
void ull_cp_init(void)
430431
{
431-
mem_init(mem_local_ctx.pool, PROC_CTX_BUF_SIZE, CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM,
432+
mem_init(mem_local_ctx.pool, PROC_CTX_BUF_SIZE,
433+
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM,
432434
&mem_local_ctx.free);
433435
mem_init(mem_remote_ctx.pool, PROC_CTX_BUF_SIZE,
434436
CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM,
@@ -1057,10 +1059,10 @@ void test_int_mem_proc_ctx(void)
10571059
ull_cp_init();
10581060

10591061
nr_of_free_ctx = ctx_buffers_free();
1060-
zassert_equal(nr_of_free_ctx, CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM +
1062+
zassert_equal(nr_of_free_ctx, CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM +
10611063
CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM, NULL);
10621064

1063-
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) {
1065+
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) {
10641066
ctx1 = proc_ctx_acquire(&mem_local_ctx);
10651067

10661068
/* The previous acquire should be valid */
@@ -1163,7 +1165,7 @@ void test_int_create_proc(void)
11631165
zassert_equal(ctx->collision, 0, NULL);
11641166
zassert_equal(ctx->pause, 0, NULL);
11651167

1166-
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) {
1168+
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) {
11671169
zassert_not_null(ctx, NULL);
11681170
ctx = create_procedure(PROC_VERSION_EXCHANGE, &mem_local_ctx);
11691171
}

tests/bluetooth/controller/ctrl_feature_exchange/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ void test_feat_exchange_central_loc_2(void)
140140
ull_cp_state_set(&conn, ULL_CP_CONNECTED);
141141

142142
err = ull_cp_feature_exchange(&conn);
143-
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) {
143+
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) {
144144
zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL);
145145
err = ull_cp_feature_exchange(&conn);
146146
}
147147

148148
zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL);
149149
zassert_equal(ctx_buffers_free(),
150-
test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM,
150+
test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM,
151151
"Free CTX buffers %d", ctx_buffers_free());
152152
}
153153

tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void test_hci_feat_exchange_wrong_handle(void)
156156
ctx_counter++;
157157
} while (ctx != NULL);
158158

159-
zassert_equal(ctx_counter, CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM + 1,
159+
zassert_equal(ctx_counter, CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM + 1,
160160
"Error in setup of test\n");
161161

162162
err = ll_feature_req_send(conn_handle);

tests/bluetooth/controller/ctrl_version/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ void test_version_exchange_central_loc_2(void)
121121

122122
err = ull_cp_version_exchange(&conn);
123123

124-
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM; i++) {
124+
for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) {
125125
zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL);
126126
err = ull_cp_version_exchange(&conn);
127127
}
128128

129129
zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL);
130130

131131
zassert_equal(ctx_buffers_free(),
132-
test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM,
132+
test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM,
133133
"Free CTX buffers %d", ctx_buffers_free());
134134
}
135135

tests/bluetooth/controller/mock_ctrl/include/kconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
#define CONFIG_BT_CTLR_LLCP_TX_PER_CONN_TX_CTRL_BUF_NUM_MAX (4)
8686
#endif
8787

88-
#ifndef CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM
89-
#define CONFIG_BT_CTLR_LLCP_PROC_CTX_BUF_NUM CONFIG_BT_CTLR_LLCP_CONN
88+
#ifndef CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
89+
#define CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM CONFIG_BT_CTLR_LLCP_CONN
9090
#endif
9191

9292
#ifndef CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM

0 commit comments

Comments
 (0)