diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp.c b/subsys/bluetooth/controller/ll_sw/ull_llcp.c index 49a6ede8480c..36c351565e25 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp.c @@ -1829,34 +1829,34 @@ void ull_cp_rx(struct ll_conn *conn, struct node_rx_pdu *rx) #ifdef ZTEST_UNITTEST -uint16_t local_ctx_buffers_free(void) +uint16_t llcp_local_ctx_buffers_free(void) { return mem_free_count_get(mem_local_ctx.free); } -uint16_t remote_ctx_buffers_free(void) +uint16_t llcp_remote_ctx_buffers_free(void) { return mem_free_count_get(mem_remote_ctx.free); } -uint16_t ctx_buffers_free(void) +uint16_t llcp_ctx_buffers_free(void) { - return local_ctx_buffers_free() + remote_ctx_buffers_free(); + return llcp_local_ctx_buffers_free() + llcp_remote_ctx_buffers_free(); } #if defined(LLCP_TX_CTRL_BUF_QUEUE_ENABLE) -uint8_t common_tx_buffer_alloc_count(void) +uint8_t llcp_common_tx_buffer_alloc_count(void) { return common_tx_buffer_alloc; } #endif /* LLCP_TX_CTRL_BUF_QUEUE_ENABLE */ -struct proc_ctx *pub_proc_ctx_acquire(void) +struct proc_ctx *llcp_proc_ctx_acquire(void) { return proc_ctx_acquire(&mem_local_ctx); } -struct proc_ctx *pub_create_procedure(enum llcp_proc proc) +struct proc_ctx *llcp_create_procedure(enum llcp_proc proc) { return create_procedure(proc, &mem_local_ctx); } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h b/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h index 4945d8c1c8af..f7f7d581b233 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h @@ -736,19 +736,19 @@ void llcp_pdu_encode_cis_ind(struct proc_ctx *ctx, struct pdu_data *pdu); void llcp_pdu_decode_cis_rsp(struct proc_ctx *ctx, struct pdu_data *pdu); #ifdef ZTEST_UNITTEST -bool lr_is_disconnected(struct ll_conn *conn); -bool lr_is_idle(struct ll_conn *conn); -struct proc_ctx *pub_lr_dequeue(struct ll_conn *conn); - -bool rr_is_disconnected(struct ll_conn *conn); -bool rr_is_idle(struct ll_conn *conn); -struct proc_ctx *pub_rr_dequeue(struct ll_conn *conn); -void pub_rr_enqueue(struct ll_conn *conn, struct proc_ctx *ctx); - -uint16_t local_ctx_buffers_free(void); -uint16_t remote_ctx_buffers_free(void); -uint16_t ctx_buffers_free(void); -uint8_t common_tx_buffer_alloc_count(void); -struct proc_ctx *pub_proc_ctx_acquire(void); -struct proc_ctx *pub_create_procedure(enum llcp_proc proc); +bool llcp_lr_is_disconnected(struct ll_conn *conn); +bool llcp_lr_is_idle(struct ll_conn *conn); +struct proc_ctx *llcp_lr_dequeue(struct ll_conn *conn); + +bool llcp_rr_is_disconnected(struct ll_conn *conn); +bool llcp_rr_is_idle(struct ll_conn *conn); +struct proc_ctx *llcp_rr_dequeue(struct ll_conn *conn); +void llcp_rr_enqueue(struct ll_conn *conn, struct proc_ctx *ctx); + +uint16_t llcp_local_ctx_buffers_free(void); +uint16_t llcp_remote_ctx_buffers_free(void); +uint16_t llcp_ctx_buffers_free(void); +uint8_t llcp_common_tx_buffer_alloc_count(void); +struct proc_ctx *llcp_proc_ctx_acquire(void); +struct proc_ctx *llcp_create_procedure(enum llcp_proc proc); #endif diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c index 637258c268a0..8136576cf39d 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c @@ -600,17 +600,17 @@ void llcp_lr_abort(struct ll_conn *conn) #ifdef ZTEST_UNITTEST -bool lr_is_disconnected(struct ll_conn *conn) +bool llcp_lr_is_disconnected(struct ll_conn *conn) { return conn->llcp.local.state == LR_STATE_DISCONNECT; } -bool lr_is_idle(struct ll_conn *conn) +bool llcp_lr_is_idle(struct ll_conn *conn) { return conn->llcp.local.state == LR_STATE_IDLE; } -struct proc_ctx *pub_lr_dequeue(struct ll_conn *conn) +struct proc_ctx *llcp_lr_dequeue(struct ll_conn *conn) { return lr_dequeue(conn); } diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c index 7694d85abda1..f3e05e8423d7 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c @@ -920,22 +920,22 @@ static void rr_abort(struct ll_conn *conn) #ifdef ZTEST_UNITTEST -bool rr_is_disconnected(struct ll_conn *conn) +bool llcp_rr_is_disconnected(struct ll_conn *conn) { return conn->llcp.remote.state == RR_STATE_DISCONNECT; } -bool rr_is_idle(struct ll_conn *conn) +bool llcp_rr_is_idle(struct ll_conn *conn) { return conn->llcp.remote.state == RR_STATE_IDLE; } -struct proc_ctx *pub_rr_dequeue(struct ll_conn *conn) +struct proc_ctx *llcp_rr_dequeue(struct ll_conn *conn) { return rr_dequeue(conn); } -void pub_rr_enqueue(struct ll_conn *conn, struct proc_ctx *ctx) +void llcp_rr_enqueue(struct ll_conn *conn, struct proc_ctx *ctx) { rr_enqueue(conn, ctx); } diff --git a/tests/bluetooth/controller/common/src/helper_util.c b/tests/bluetooth/controller/common/src/helper_util.c index 6f507cfac36e..ea72fabf60eb 100644 --- a/tests/bluetooth/controller/common/src/helper_util.c +++ b/tests/bluetooth/controller/common/src/helper_util.c @@ -278,7 +278,7 @@ void test_setup(struct ll_conn *conn) memset(emul_conn_pool, 0x00, sizeof(emul_conn_pool)); emul_conn_pool[0] = conn; - no_of_ctx_buffers_at_test_setup = ctx_buffers_free(); + no_of_ctx_buffers_at_test_setup = llcp_ctx_buffers_free(); } diff --git a/tests/bluetooth/controller/ctrl_api/src/main.c b/tests/bluetooth/controller/ctrl_api/src/main.c index c8e9ca152778..49cc8cea0960 100644 --- a/tests/bluetooth/controller/ctrl_api/src/main.c +++ b/tests/bluetooth/controller/ctrl_api/src/main.c @@ -55,8 +55,8 @@ ZTEST(public, test_api_init) ull_llcp_init(&conn); - zassert_true(lr_is_disconnected(&conn)); - zassert_true(rr_is_disconnected(&conn)); + zassert_true(llcp_lr_is_disconnected(&conn)); + zassert_true(llcp_rr_is_disconnected(&conn)); } ZTEST(public, test_api_connect) @@ -66,8 +66,8 @@ ZTEST(public, test_api_connect) ull_llcp_init(&conn); ull_cp_state_set(&conn, ULL_CP_CONNECTED); - zassert_true(lr_is_idle(&conn)); - zassert_true(rr_is_idle(&conn)); + zassert_true(llcp_lr_is_idle(&conn)); + zassert_true(llcp_rr_is_idle(&conn)); } ZTEST(public, test_api_disconnect) @@ -77,16 +77,16 @@ ZTEST(public, test_api_disconnect) ull_llcp_init(&conn); ull_cp_state_set(&conn, ULL_CP_DISCONNECTED); - zassert_true(lr_is_disconnected(&conn)); - zassert_true(rr_is_disconnected(&conn)); + zassert_true(llcp_lr_is_disconnected(&conn)); + zassert_true(llcp_rr_is_disconnected(&conn)); ull_cp_state_set(&conn, ULL_CP_CONNECTED); - zassert_true(lr_is_idle(&conn)); - zassert_true(rr_is_idle(&conn)); + zassert_true(llcp_lr_is_idle(&conn)); + zassert_true(llcp_rr_is_idle(&conn)); ull_cp_state_set(&conn, ULL_CP_DISCONNECTED); - zassert_true(lr_is_disconnected(&conn)); - zassert_true(rr_is_disconnected(&conn)); + zassert_true(llcp_lr_is_disconnected(&conn)); + zassert_true(llcp_rr_is_disconnected(&conn)); } ZTEST(public, test_int_disconnect_loc) @@ -106,13 +106,13 @@ ZTEST(public, test_int_disconnect_loc) test_set_role(&conn, BT_HCI_ROLE_CENTRAL); ull_cp_state_set(&conn, ULL_CP_CONNECTED); - nr_free_ctx = ctx_buffers_free(); + nr_free_ctx = llcp_ctx_buffers_free(); zassert_equal(nr_free_ctx, test_ctx_buffers_cnt()); err = ull_cp_version_exchange(&conn); zassert_equal(err, BT_HCI_ERR_SUCCESS); - nr_free_ctx = ctx_buffers_free(); + nr_free_ctx = llcp_ctx_buffers_free(); zassert_equal(nr_free_ctx, test_ctx_buffers_cnt() - 1); event_prepare(&conn); @@ -125,7 +125,7 @@ ZTEST(public, test_int_disconnect_loc) */ ull_cp_state_set(&conn, ULL_CP_DISCONNECTED); - nr_free_ctx = ctx_buffers_free(); + nr_free_ctx = llcp_ctx_buffers_free(); zassert_equal(nr_free_ctx, test_ctx_buffers_cnt()); ut_rx_q_is_empty(); @@ -136,7 +136,7 @@ ZTEST(public, test_int_disconnect_loc) event_prepare(&conn); event_done(&conn); - nr_free_ctx = ctx_buffers_free(); + nr_free_ctx = llcp_ctx_buffers_free(); zassert_equal(nr_free_ctx, test_ctx_buffers_cnt()); /* @@ -164,7 +164,7 @@ ZTEST(public, test_int_disconnect_rem) /* Connect */ ull_cp_state_set(&conn, ULL_CP_CONNECTED); - nr_free_ctx = ctx_buffers_free(); + nr_free_ctx = llcp_ctx_buffers_free(); zassert_equal(nr_free_ctx, test_ctx_buffers_cnt()); /* Prepare */ event_prepare(&conn); @@ -172,7 +172,7 @@ ZTEST(public, test_int_disconnect_rem) /* Rx */ lt_tx(LL_VERSION_IND, &conn, &remote_version_ind); - nr_free_ctx = ctx_buffers_free(); + nr_free_ctx = llcp_ctx_buffers_free(); zassert_equal(nr_free_ctx, test_ctx_buffers_cnt()); /* Disconnect before we reply */ @@ -188,7 +188,7 @@ ZTEST(public, test_int_disconnect_rem) /* Done */ event_done(&conn); - nr_free_ctx = ctx_buffers_free(); + nr_free_ctx = llcp_ctx_buffers_free(); zassert_equal(nr_free_ctx, test_ctx_buffers_cnt()); /* There should not be a host notifications */ @@ -343,30 +343,30 @@ ZTEST(internal, test_int_mem_proc_ctx) ull_cp_init(); - nr_of_free_ctx = ctx_buffers_free(); + nr_of_free_ctx = llcp_ctx_buffers_free(); 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_LOCAL_PROC_CTX_BUF_NUM; i++) { - ctx1 = pub_proc_ctx_acquire(); + ctx1 = llcp_proc_ctx_acquire(); /* The previous acquire should be valid */ zassert_not_null(ctx1, NULL); } - nr_of_free_ctx = local_ctx_buffers_free(); + nr_of_free_ctx = llcp_local_ctx_buffers_free(); zassert_equal(nr_of_free_ctx, 0); - ctx2 = pub_proc_ctx_acquire(); + ctx2 = llcp_proc_ctx_acquire(); /* The last acquire should fail */ zassert_is_null(ctx2, NULL); llcp_proc_ctx_release(ctx1); - nr_of_free_ctx = local_ctx_buffers_free(); + nr_of_free_ctx = llcp_local_ctx_buffers_free(); zassert_equal(nr_of_free_ctx, 1); - ctx1 = pub_proc_ctx_acquire(); + ctx1 = llcp_proc_ctx_acquire(); /* Releasing returns the context to the avilable pool */ zassert_not_null(ctx1, NULL); @@ -443,7 +443,7 @@ ZTEST(internal, test_int_create_proc) ull_cp_init(); - ctx = pub_create_procedure(PROC_VERSION_EXCHANGE); + ctx = llcp_create_procedure(PROC_VERSION_EXCHANGE); zassert_not_null(ctx, NULL); zassert_equal(ctx->proc, PROC_VERSION_EXCHANGE); @@ -451,7 +451,7 @@ ZTEST(internal, test_int_create_proc) for (int i = 0U; i < CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM; i++) { zassert_not_null(ctx, NULL); - ctx = pub_create_procedure(PROC_VERSION_EXCHANGE); + ctx = llcp_create_procedure(PROC_VERSION_EXCHANGE); } zassert_is_null(ctx, NULL); @@ -487,7 +487,7 @@ ZTEST(internal, test_int_local_pending_requests) peek_ctx = llcp_lr_peek(&conn); zassert_is_null(peek_ctx, NULL); - dequeue_ctx = pub_lr_dequeue(&conn); + dequeue_ctx = llcp_lr_dequeue(&conn); zassert_is_null(dequeue_ctx, NULL); llcp_lr_enqueue(&conn, &ctx); @@ -497,13 +497,13 @@ ZTEST(internal, test_int_local_pending_requests) peek_ctx = llcp_lr_peek(&conn); zassert_equal_ptr(peek_ctx, &ctx, NULL); - dequeue_ctx = pub_lr_dequeue(&conn); + dequeue_ctx = llcp_lr_dequeue(&conn); zassert_equal_ptr(dequeue_ctx, &ctx, NULL); peek_ctx = llcp_lr_peek(&conn); zassert_is_null(peek_ctx, NULL); - dequeue_ctx = pub_lr_dequeue(&conn); + dequeue_ctx = llcp_lr_dequeue(&conn); zassert_is_null(dequeue_ctx, NULL); } @@ -521,23 +521,23 @@ ZTEST(internal, test_int_remote_pending_requests) peek_ctx = llcp_rr_peek(&conn); zassert_is_null(peek_ctx, NULL); - dequeue_ctx = pub_rr_dequeue(&conn); + dequeue_ctx = llcp_rr_dequeue(&conn); zassert_is_null(dequeue_ctx, NULL); - pub_rr_enqueue(&conn, &ctx); + llcp_rr_enqueue(&conn, &ctx); peek_ctx = (struct proc_ctx *)sys_slist_peek_head(&conn.llcp.remote.pend_proc_list); zassert_equal_ptr(peek_ctx, &ctx, NULL); peek_ctx = llcp_rr_peek(&conn); zassert_equal_ptr(peek_ctx, &ctx, NULL); - dequeue_ctx = pub_rr_dequeue(&conn); + dequeue_ctx = llcp_rr_dequeue(&conn); zassert_equal_ptr(dequeue_ctx, &ctx, NULL); peek_ctx = llcp_rr_peek(&conn); zassert_is_null(peek_ctx, NULL); - dequeue_ctx = pub_rr_dequeue(&conn); + dequeue_ctx = llcp_rr_dequeue(&conn); zassert_is_null(dequeue_ctx, NULL); } diff --git a/tests/bluetooth/controller/ctrl_chmu/src/main.c b/tests/bluetooth/controller/ctrl_chmu/src/main.c index b06f7872e492..2e5cbdc803ff 100644 --- a/tests/bluetooth/controller/ctrl_chmu/src/main.c +++ b/tests/bluetooth/controller/ctrl_chmu/src/main.c @@ -134,8 +134,8 @@ ZTEST(chmu, test_channel_map_update_central_loc) zassert_mem_equal(conn.lll.data_chan_map, chm, sizeof(conn.lll.data_chan_map), "Channel map invalid"); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(chmu, test_channel_map_update_central_invalid) @@ -205,8 +205,8 @@ ZTEST(chmu, test_channel_map_update_central_invalid) zassert_equal(conn.llcp_terminate.reason_final, BT_HCI_ERR_LMP_PDU_NOT_ALLOWED, "Terminate reason %d", conn.llcp_terminate.reason_final); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(chmu, test_channel_map_update_periph_rem) @@ -276,8 +276,8 @@ ZTEST(chmu, test_channel_map_update_periph_rem) zassert_mem_equal(conn.lll.data_chan_map, chm, sizeof(conn.lll.data_chan_map), "Channel map invalid"); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(chmu, test_channel_map_update_periph_invalid) @@ -335,8 +335,8 @@ ZTEST(chmu, test_channel_map_update_periph_invalid) zassert_equal(conn.llcp_terminate.reason_final, BT_HCI_ERR_LMP_PDU_NOT_ALLOWED, "Terminate reason %d", conn.llcp_terminate.reason_final); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(chmu, test_channel_map_update_periph_loc) @@ -353,8 +353,8 @@ ZTEST(chmu, test_channel_map_update_periph_loc) err = ull_cp_chan_map_update(&conn, chm); zassert_equal(err, BT_HCI_ERR_CMD_DISALLOWED); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(chmu, NULL, NULL, chmu_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_cis_create/src/main.c b/tests/bluetooth/controller/ctrl_cis_create/src/main.c index 801fc2667c4c..e9f5d78facc4 100644 --- a/tests/bluetooth/controller/ctrl_cis_create/src/main.c +++ b/tests/bluetooth/controller/ctrl_cis_create/src/main.c @@ -215,8 +215,8 @@ ZTEST(cis_create, test_cc_create_periph_rem_host_accept) /* Done */ event_done(&conn); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -286,8 +286,8 @@ ZTEST(cis_create, test_cc_create_periph_rem_host_reject) /* Done */ event_done(&conn); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -366,8 +366,8 @@ ZTEST(cis_create, test_cc_create_periph_rem_host_accept_to) /* Done */ event_done(&conn); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -445,8 +445,8 @@ ZTEST(cis_create, test_cc_create_periph_rem_invalid_phy) /* Done */ event_done(&conn); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(cis_create, NULL, NULL, cis_create_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/src/main.c b/tests/bluetooth/controller/ctrl_cis_terminate/src/main.c index 79105e053701..1403b02593ac 100644 --- a/tests/bluetooth/controller/ctrl_cis_terminate/src/main.c +++ b/tests/bluetooth/controller/ctrl_cis_terminate/src/main.c @@ -71,8 +71,8 @@ static void test_cis_terminate_rem(uint8_t role) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(cis_terminate, test_cis_terminate_cen_rem) @@ -144,8 +144,8 @@ void test_cis_terminate_loc(uint8_t role) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(cis_terminate, test_cis_terminate_cen_loc) diff --git a/tests/bluetooth/controller/ctrl_collision/src/main.c b/tests/bluetooth/controller/ctrl_collision/src/main.c index f94ab808a7eb..82cdf64429ba 100644 --- a/tests/bluetooth/controller/ctrl_collision/src/main.c +++ b/tests/bluetooth/controller/ctrl_collision/src/main.c @@ -311,8 +311,8 @@ ZTEST(collision, test_phy_update_central_loc_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(collision, test_phy_update_central_rem_collision) @@ -483,8 +483,8 @@ ZTEST(collision, test_phy_update_central_rem_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(collision, test_phy_update_periph_loc_collision) @@ -607,8 +607,8 @@ ZTEST(collision, test_phy_update_periph_loc_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(collision, test_phy_conn_update_central_loc_collision) @@ -745,8 +745,8 @@ ZTEST(collision, test_phy_conn_update_central_loc_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(collision, NULL, NULL, collision_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_conn_update/src/main.c b/tests/bluetooth/controller/ctrl_conn_update/src/main.c index 26b48352eda6..7da7a69c1f7a 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_conn_update/src/main.c @@ -324,8 +324,8 @@ ZTEST(central_loc, test_conn_update_central_loc_accept) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -584,8 +584,8 @@ ZTEST(central_loc, test_conn_update_central_loc_accept_reject_2nd_cpr) ull_cp_release_ntf(ntf); /* One less CTXs as the conn_3rd CPR is still 'running' */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -657,8 +657,8 @@ ZTEST(central_loc, test_conn_update_central_loc_invalid_param_rsp) /* Done */ event_done(&conn); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -723,8 +723,8 @@ ZTEST(central_loc, test_conn_update_central_loc_invalid_rsp) /* There should be no host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -795,8 +795,8 @@ ZTEST(central_loc, test_conn_update_central_loc_reject) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -920,8 +920,8 @@ ZTEST(central_loc, test_conn_update_central_loc_remote_legacy) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1045,8 +1045,8 @@ ZTEST(central_loc, test_conn_update_central_loc_unsupp_wo_feat_exch) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1141,8 +1141,8 @@ ZTEST(central_loc, test_conn_update_central_loc_unsupp_w_feat_exch) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1308,8 +1308,8 @@ ZTEST(central_loc, test_conn_update_central_loc_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1428,8 +1428,8 @@ ZTEST(central_rem, test_conn_update_central_rem_accept) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1484,8 +1484,8 @@ ZTEST(central_rem, test_conn_update_central_rem_invalid_req) /* Release Tx */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -1562,8 +1562,8 @@ ZTEST(central_rem, test_conn_update_central_rem_reject) /* Done */ event_done(&conn); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1803,8 +1803,8 @@ ZTEST(central_rem, test_conn_update_central_rem_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1907,8 +1907,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_accept) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -1987,8 +1987,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_reject) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -2067,8 +2067,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_unsupp_feat_wo_feat_exch) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -2115,8 +2115,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_unsupp_feat_w_feat_exch) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -2307,8 +2307,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -2438,8 +2438,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_accept) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } #define RADIO_CONN_EVENTS(x, y) ((uint16_t)(((x) + (y) - 1) / (y))) @@ -2587,8 +2587,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_apm_accept_right_away) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); #endif } @@ -2697,8 +2697,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_apm_reject_right_away) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); #endif } @@ -2872,8 +2872,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_apm_accept_defered) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); #endif } @@ -3008,8 +3008,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_apm_reject_defered) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); #endif /* CONFIG_BT_CTLR_USER_CPR_ANCHOR_POINT_MOVE */ } @@ -3135,8 +3135,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_collision_reject_2nd_cpr) event_done(&conn); { - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-2, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-2, + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Parallel CPR from central */ /* Now CPR is active on 'conn' so let 'conn_2nd' attempt to start a CPR */ /* Prepare */ @@ -3159,8 +3159,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_collision_reject_2nd_cpr) ull_cp_release_tx(&conn_2nd, tx); /* There should be no 'extra' procedure on acount of the parallel CPR */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-2, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-2, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* Prepare */ @@ -3192,8 +3192,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_collision_reject_2nd_cpr) ull_cp_release_tx(&conn_3rd, tx); /* There should be no 'extra' procedure on acount of the parallel CPR */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-2, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-2, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* Prepare */ @@ -3329,8 +3329,8 @@ ZTEST(periph_loc, test_conn_update_periph_loc_collision_reject_2nd_cpr) ull_cp_release_ntf(ntf); /* One less CTXs as the conn_2nd CPR is still 'running' */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -3445,8 +3445,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_accept_reject_2nd_cpr) ull_cp_release_tx(&conn_2nd, tx); /* There should be no 'extra' procedure on acount of the parallel CPR */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* Prepare */ @@ -3478,8 +3478,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_accept_reject_2nd_cpr) ull_cp_release_tx(&conn_3rd, tx); /* There should be no 'extra' procedure on acount of the parallel CPR */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* There should be one host notification */ @@ -3590,8 +3590,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_accept_reject_2nd_cpr) ull_cp_release_ntf(ntf); /* One less CTXs as the conn_2nd CPR is still 'running' */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt()-1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt()-1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -3646,8 +3646,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_invalid_req) /* Release Tx */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -3760,8 +3760,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_invalid_ind) /* There should be no host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); event_prepare(&conn); @@ -3821,8 +3821,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_invalid_ind) /* There should be no host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Prepare */ event_prepare(&conn); @@ -3880,8 +3880,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_invalid_ind) /* There should be no host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -3960,8 +3960,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_reject) /* Done */ event_done(&conn); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -4191,8 +4191,8 @@ ZTEST(periph_rem, test_conn_update_periph_rem_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } #else /* CONFIG_BT_CTLR_CONN_PARAM_REQ */ @@ -4300,8 +4300,8 @@ ZTEST(central_loc_no_param_req, test_conn_update_central_loc_accept_no_param_req } } while (parameters_changed-- > 0U); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -4364,8 +4364,8 @@ ZTEST(central_rem_no_param_req, test_conn_update_central_rem_unknown_no_param_re /* There should NOT be a host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Check UNKNOWN_RSP on Connection Parameter Request */ unknown_rsp.type = PDU_DATA_LLCTRL_TYPE_CONN_PARAM_REQ; @@ -4391,8 +4391,8 @@ ZTEST(central_rem_no_param_req, test_conn_update_central_rem_unknown_no_param_re /* There should NOT be a host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -4450,8 +4450,8 @@ ZTEST(periph_rem_no_param_req, test_conn_update_periph_rem_unknown_no_param_req) /* There should NOT be a host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -4543,8 +4543,8 @@ ZTEST(periph_rem_no_param_req, test_conn_update_periph_rem_accept_no_param_req) } } while (parameters_changed-- > 0U); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -4588,8 +4588,8 @@ ZTEST(periph_loc_no_param_req, test_conn_update_periph_loc_disallowed_no_param_r /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } #endif diff --git a/tests/bluetooth/controller/ctrl_cte_req/src/main.c b/tests/bluetooth/controller/ctrl_cte_req/src/main.c index 5aa37450cb0a..949f1d783212 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/src/main.c +++ b/tests/bluetooth/controller/ctrl_cte_req/src/main.c @@ -138,8 +138,8 @@ ZTEST(cte_req_after_fex, test_cte_req_central_local) /* Release tx node */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -213,8 +213,8 @@ ZTEST(cte_req_after_fex, test_cte_req_peripheral_local) /* Release tx node */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -282,8 +282,8 @@ ZTEST(cte_req_after_fex, test_cte_req_central_remote) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -351,8 +351,8 @@ ZTEST(cte_req_after_fex, test_cte_req_peripheral_remote) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* Tests of expected failures during execution of CTE Request Procedure */ @@ -432,8 +432,8 @@ ZTEST(cte_req_after_fex, test_cte_req_rejected_inv_ll_param_central_local) /* Release tx node */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -511,8 +511,8 @@ ZTEST(cte_req_after_fex, test_cte_req_rejected_inv_ll_param_peripheral_local) /* Release tx node */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -583,8 +583,8 @@ ZTEST(cte_req_after_fex, test_cte_req_reject_inv_ll_param_central_remote) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -655,8 +655,8 @@ ZTEST(cte_req_after_fex, test_cte_req_reject_inv_ll_param_peripheral_remote) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -731,8 +731,8 @@ static void test_cte_req_ll_unknown_rsp_local(uint8_t role) /* Release tx node */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", - ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", + llcp_ctx_buffers_free()); /* Verify that CTE response feature is marked as not supported by peer device */ err = ull_cp_cte_req(&conn, local_cte_req.min_cte_len_req, local_cte_req.cte_type_req); @@ -931,8 +931,8 @@ static void check_phy_update(bool is_local, struct pdu_data_llctrl_phy_req *phy_ } /* There is still queued CTE REQ so number of contexts is smaller by 1 than max */ - zassert_equal(ctx_buffers_free(), ctx_num_at_end, "Free CTX buffers %d", - ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), ctx_num_at_end, "Free CTX buffers %d", + llcp_ctx_buffers_free()); } /** @@ -1147,8 +1147,8 @@ static void test_local_cte_req_wait_for_phy_update_complete_and_disable(uint8_t /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(cte_req_after_fex, test_central_local_cte_req_wait_for_phy_update_complete_and_disable) @@ -1201,8 +1201,8 @@ static void test_local_cte_req_wait_for_phy_update_complete(uint8_t role) /* PHY update was completed. Handle CTE request */ run_local_cte_req(&local_cte_req); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(cte_req_after_fex, test_central_local_cte_req_wait_for_phy_update_complete) @@ -1245,8 +1245,8 @@ static void test_local_phy_update_wait_for_cte_req_complete(uint8_t role) /* Handle CTE request */ run_local_cte_req(&local_cte_req); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt() - 1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt() - 1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); if (role == BT_HCI_ROLE_CENTRAL) { run_phy_update_central(true, &phy_req, pu_event_counter(&conn), @@ -1335,8 +1335,8 @@ static void test_phy_update_wait_for_remote_cte_req_complete(uint8_t role) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt() - 1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt() - 1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); if (role == BT_HCI_ROLE_CENTRAL) { run_phy_update_central(true, &phy_req, pu_event_counter(&conn), @@ -1460,8 +1460,8 @@ static void test_cte_req_wait_for_remote_phy_update_complete(uint8_t role) /* PHY update was completed. Handle CTE request */ run_local_cte_req(&local_cte_req); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", - ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", + llcp_ctx_buffers_free()); } ZTEST(cte_req_after_fex, test_central_cte_req_wait_for_remote_phy_update_complete) diff --git a/tests/bluetooth/controller/ctrl_data_length_update/src/main.c b/tests/bluetooth/controller/ctrl_data_length_update/src/main.c index 4dd81092d622..76e9047f408a 100644 --- a/tests/bluetooth/controller/ctrl_data_length_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_data_length_update/src/main.c @@ -203,8 +203,8 @@ ZTEST(dle_central, test_data_length_update_central_loc_unknown_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -280,8 +280,8 @@ ZTEST(dle_central, test_data_length_update_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Init DLE data */ ull_conn_default_tx_octets_set(251); @@ -315,8 +315,8 @@ ZTEST(dle_central, test_data_length_update_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* diff --git a/tests/bluetooth/controller/ctrl_encrypt/src/main.c b/tests/bluetooth/controller/ctrl_encrypt/src/main.c index 02ed0b9b58e8..1793f7dd7deb 100644 --- a/tests/bluetooth/controller/ctrl_encrypt/src/main.c +++ b/tests/bluetooth/controller/ctrl_encrypt/src/main.c @@ -292,8 +292,8 @@ ZTEST(encryption_start, test_encryption_start_central_loc) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -521,8 +521,8 @@ ZTEST(encryption_start, test_encryption_start_central_loc_limited_memory) /* Release dummy procedure */ llcp_proc_ctx_release(ctx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -623,8 +623,8 @@ ZTEST(encryption_start, test_encryption_start_central_loc_reject_ext) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -720,8 +720,8 @@ ZTEST(encryption_start, test_encryption_start_central_loc_reject) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -831,8 +831,8 @@ ZTEST(encryption_start, test_encryption_start_central_loc_no_ltk) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -937,8 +937,8 @@ ZTEST(encryption_start, test_encryption_start_central_loc_no_ltk_2) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -1069,8 +1069,8 @@ ZTEST(encryption_start, test_encryption_start_central_loc_mic) } /* Note that for this test the context is not released */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt() - 1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt() - 1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -1281,8 +1281,8 @@ ZTEST(encryption_start, test_encryption_start_periph_rem) /* CCM Tx Direction should be S->M */ CHECK_TX_CCM_STATE(conn, sk_be, iv, 0U, CCM_DIR_S_TO_M); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -1580,8 +1580,8 @@ ZTEST(encryption_start, test_encryption_start_periph_rem_limited_memory) /* Release dummy procedure */ llcp_proc_ctx_release(ctx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -1724,8 +1724,8 @@ ZTEST(encryption_start, test_encryption_start_periph_rem_no_ltk) /* All contexts should be released until now. This is a side-effect of a call to * ull_cp_tx_ntf that internall calls rr_check_done and lr_check_done. */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -1873,8 +1873,8 @@ ZTEST(encryption_start, test_encryption_start_periph_rem_mic) } /* Note that for this test the context is not released */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt() - 1, - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt() - 1, + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -2020,8 +2020,8 @@ ZTEST(encryption_pause, test_encryption_pause_central_loc) /* Rx Decryption should be enabled */ zassert_equal(conn.lll.enc_rx, 1U); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(encryption_pause, test_encryption_pause_periph_rem) @@ -2191,8 +2191,8 @@ ZTEST(encryption_pause, test_encryption_pause_periph_rem) /* Tx Encryption should be enabled */ zassert_equal(conn.lll.enc_tx, 1U); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(encryption_start, NULL, NULL, enc_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c b/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c index 6c5bb8a8c1f4..d00b7ece07a5 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c +++ b/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c @@ -166,8 +166,8 @@ ZTEST(fex_central, test_feat_exchange_central_loc) zassert_equal(conn.lll.event_counter, feat_to_test + 1, "Wrong event-count %d\n", conn.lll.event_counter); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -235,8 +235,8 @@ ZTEST(fex_central, test_feat_exchange_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); test_set_role(&conn, BT_HCI_ROLE_CENTRAL); /* Connect */ @@ -266,8 +266,8 @@ ZTEST(fex_central, test_feat_exchange_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(fex_central, test_feat_exchange_central_loc_2) @@ -284,9 +284,9 @@ ZTEST(fex_central, test_feat_exchange_central_loc_2) } zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL); - zassert_equal(ctx_buffers_free(), + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM, - "Free CTX buffers %d", ctx_buffers_free()); + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* @@ -349,8 +349,8 @@ ZTEST(fex_central, test_feat_exchange_central_rem) } zassert_equal(conn.lll.event_counter, CENTRAL_NR_OF_EVENTS * (feat_to_test), "Wrong event-count %d\n", conn.lll.event_counter); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } #undef CENTRAL_NR_OF_EVENTS @@ -437,8 +437,8 @@ ZTEST(fex_central, test_feat_exchange_central_rem_2) zassert_equal(conn.lll.event_counter, CENTRAL_NR_OF_EVENTS * (feat_to_test), "Wrong event-count %d\n", conn.lll.event_counter); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(fex_periph, test_peripheral_feat_exchange_periph_loc) @@ -495,8 +495,8 @@ ZTEST(fex_periph, test_peripheral_feat_exchange_periph_loc) ut_rx_q_is_empty(); zassert_equal(conn.lll.event_counter, 2, "Wrong event-count %d\n", conn.lll.event_counter); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(fex_periph, test_feat_exchange_periph_loc_unknown_rsp) @@ -557,8 +557,8 @@ ZTEST(fex_periph, test_feat_exchange_periph_loc_unknown_rsp) ut_rx_q_is_empty(); zassert_equal(conn.lll.event_counter, 3, "Wrong event-count %d\n", conn.lll.event_counter); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(fex_central, NULL, NULL, fex_setup, NULL, NULL); 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 bcccd4190432..336f65b03c5d 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c +++ b/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c @@ -140,8 +140,8 @@ ZTEST(hci_fex, test_hci_feat_exchange_central_loc) ll_conn_release(conn_from_pool); } - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(hci_fex, test_hci_feat_exchange_wrong_handle) @@ -169,8 +169,8 @@ ZTEST(hci_fex, test_hci_feat_exchange_wrong_handle) err = ll_feature_req_send(conn_handle); zassert_equal(err, BT_HCI_ERR_CMD_DISALLOWED, "Wrong reply for wrong handle\n"); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt() - (ctx_counter - 1), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt() - (ctx_counter - 1), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(hci_fex, NULL, NULL, hci_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_invalid/src/main.c b/tests/bluetooth/controller/ctrl_invalid/src/main.c index 665b4e35f4e3..427bf7399120 100644 --- a/tests/bluetooth/controller/ctrl_invalid/src/main.c +++ b/tests/bluetooth/controller/ctrl_invalid/src/main.c @@ -110,8 +110,8 @@ static void lt_tx_invalid_pdu_size(enum helper_pdu_opcode opcode, int adj_size) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(invalid, test_invalid_pdu_ignore_rx) diff --git a/tests/bluetooth/controller/ctrl_le_ping/src/main.c b/tests/bluetooth/controller/ctrl_le_ping/src/main.c index 63e83c00d5a8..cbcb9fa625db 100644 --- a/tests/bluetooth/controller/ctrl_le_ping/src/main.c +++ b/tests/bluetooth/controller/ctrl_le_ping/src/main.c @@ -116,8 +116,8 @@ ZTEST(ping_central, test_ping_central_loc) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Initiate another LE Ping Procedure */ err = ull_cp_le_ping(&conn); @@ -142,8 +142,8 @@ ZTEST(ping_central, test_ping_central_loc) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -214,8 +214,8 @@ ZTEST(ping_central, test_ping_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Initiate another LE Ping Procedure */ err = ull_cp_le_ping(&conn); @@ -244,8 +244,8 @@ ZTEST(ping_central, test_ping_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -303,8 +303,8 @@ ZTEST(ping_periph, test_ping_periph_loc) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -357,8 +357,8 @@ ZTEST(ping_central, test_ping_central_rem) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -411,8 +411,8 @@ ZTEST(ping_periph, test_ping_periph_rem) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(ping_central, NULL, NULL, le_ping_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c b/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c index 95dd6cd0c4d8..b222fd593952 100644 --- a/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c +++ b/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c @@ -106,8 +106,8 @@ ZTEST(muc_periph, test_min_used_chans_periph_loc) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(muc_central, test_min_used_chans_central_loc) @@ -124,8 +124,8 @@ ZTEST(muc_central, test_min_used_chans_central_loc) err = ull_cp_min_used_chans(&conn, 1, 2); zassert_equal(err, BT_HCI_ERR_CMD_DISALLOWED); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(muc_central, test_min_used_chans_central_rem) @@ -160,8 +160,8 @@ ZTEST(muc_central, test_min_used_chans_central_rem) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(muc_central, NULL, NULL, muc_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_phy_update/src/main.c b/tests/bluetooth/controller/ctrl_phy_update/src/main.c index 4ea5b15c59b2..d67a44b6b482 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_phy_update/src/main.c @@ -226,8 +226,8 @@ ZTEST(phy_central, test_phy_update_central_loc) CHECK_CURRENT_PHY_STATE(conn, PHY_2M, PREFER_S8_CODING, PHY_2M); CHECK_PREF_PHY_STATE(conn, PHY_2M, PHY_2M); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_central, test_phy_update_central_loc_invalid) @@ -274,8 +274,8 @@ ZTEST(phy_central, test_phy_update_central_loc_invalid) /* There should be nohost notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_central, test_phy_update_central_loc_unsupp_feat) @@ -325,8 +325,8 @@ ZTEST(phy_central, test_phy_update_central_loc_unsupp_feat) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_central, test_phy_update_central_rem) @@ -419,8 +419,8 @@ ZTEST(phy_central, test_phy_update_central_rem) CHECK_CURRENT_PHY_STATE(conn, PHY_1M, PREFER_S8_CODING, PHY_2M); CHECK_PREF_PHY_STATE(conn, PHY_1M | PHY_2M | PHY_CODED, PHY_1M | PHY_2M | PHY_CODED); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_periph, test_phy_update_periph_loc) @@ -508,8 +508,8 @@ ZTEST(phy_periph, test_phy_update_periph_loc) CHECK_CURRENT_PHY_STATE(conn, PHY_2M, PREFER_S8_CODING, PHY_2M); CHECK_PREF_PHY_STATE(conn, PHY_2M, PHY_2M); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_periph, test_phy_update_periph_rem) @@ -607,8 +607,8 @@ ZTEST(phy_periph, test_phy_update_periph_rem) CHECK_CURRENT_PHY_STATE(conn, PHY_2M, PREFER_S8_CODING, PHY_1M); CHECK_PREF_PHY_STATE(conn, PHY_1M | PHY_2M | PHY_CODED, PHY_1M | PHY_2M | PHY_CODED); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_periph, test_phy_update_periph_loc_unsupp_feat) @@ -658,8 +658,8 @@ ZTEST(phy_periph, test_phy_update_periph_loc_unsupp_feat) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_periph, test_phy_update_periph_rem_invalid) @@ -714,8 +714,8 @@ ZTEST(phy_periph, test_phy_update_periph_rem_invalid) /* Release Tx */ ull_cp_release_tx(&conn, tx); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_central, test_phy_update_central_loc_collision) @@ -883,8 +883,8 @@ ZTEST(phy_central, test_phy_update_central_loc_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_central, test_phy_update_central_rem_collision) @@ -1060,8 +1060,8 @@ ZTEST(phy_central, test_phy_update_central_rem_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_periph, test_phy_update_periph_loc_collision) @@ -1184,8 +1184,8 @@ ZTEST(phy_periph, test_phy_update_periph_loc_collision) /* Release Ntf */ ull_cp_release_ntf(ntf); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(phy_central, test_phy_update_central_loc_no_act_change) @@ -1270,8 +1270,8 @@ ZTEST(phy_central, test_phy_update_central_loc_no_act_change) CHECK_CURRENT_PHY_STATE(conn, PHY_1M, PREFER_S8_CODING, PHY_1M); CHECK_PREF_PHY_STATE(conn, PHY_1M, PHY_1M); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", - ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", + llcp_ctx_buffers_free()); } ZTEST(phy_central, test_phy_update_central_rem_no_actual_change) @@ -1335,8 +1335,8 @@ ZTEST(phy_central, test_phy_update_central_rem_no_actual_change) CHECK_CURRENT_PHY_STATE(conn, PHY_1M, PREFER_S8_CODING, PHY_1M); CHECK_PREF_PHY_STATE(conn, PHY_1M | PHY_2M | PHY_CODED, PHY_1M | PHY_2M | PHY_CODED); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", - ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", + llcp_ctx_buffers_free()); } ZTEST(phy_periph, test_phy_update_periph_loc_no_actual_change) @@ -1398,8 +1398,8 @@ ZTEST(phy_periph, test_phy_update_periph_loc_no_actual_change) CHECK_CURRENT_PHY_STATE(conn, PHY_1M, PREFER_S8_CODING, PHY_1M); CHECK_PREF_PHY_STATE(conn, PHY_1M, PHY_1M); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", - ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", + llcp_ctx_buffers_free()); } ZTEST(phy_periph, test_phy_update_periph_rem_no_actual_change) @@ -1462,8 +1462,8 @@ ZTEST(phy_periph, test_phy_update_periph_rem_no_actual_change) CHECK_CURRENT_PHY_STATE(conn, PHY_1M, PREFER_S8_CODING, PHY_1M); CHECK_PREF_PHY_STATE(conn, PHY_1M | PHY_2M | PHY_CODED, PHY_1M | PHY_2M | PHY_CODED); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", - ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", + llcp_ctx_buffers_free()); } ZTEST_SUITE(phy_central, NULL, NULL, phy_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_sca_update/src/main.c b/tests/bluetooth/controller/ctrl_sca_update/src/main.c index 37ff887f934b..285035cd6767 100644 --- a/tests/bluetooth/controller/ctrl_sca_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_sca_update/src/main.c @@ -125,8 +125,8 @@ ZTEST(sca_central, test_sca_central_loc) ut_rx_node(NODE_PEER_SCA_UPDATE, &ntf, &scau); ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Initiate another SCA Procedure */ err = ull_cp_req_peer_sca(&conn); @@ -162,8 +162,8 @@ ZTEST(sca_central, test_sca_central_loc) ut_rx_node(NODE_PEER_SCA_UPDATE, &ntf, &scau); ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -234,8 +234,8 @@ ZTEST(sca_central, test_sca_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Initiate another SCA Procedure */ err = ull_cp_req_peer_sca(&conn); @@ -264,8 +264,8 @@ ZTEST(sca_central, test_sca_central_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -336,8 +336,8 @@ ZTEST(sca_periph, test_sca_peripheral_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Initiate another SCA Procedure */ err = ull_cp_req_peer_sca(&conn); @@ -366,8 +366,8 @@ ZTEST(sca_periph, test_sca_peripheral_loc_invalid_rsp) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } @@ -430,8 +430,8 @@ ZTEST(sca_periph, test_ping_periph_loc) ut_rx_node(NODE_PEER_SCA_UPDATE, &ntf, &scau); ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -487,8 +487,8 @@ ZTEST(sca_central, test_ping_central_rem) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -544,8 +544,8 @@ ZTEST(sca_periph, test_ping_periph_rem) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(sca_central, NULL, NULL, sca_setup, NULL, NULL); diff --git a/tests/bluetooth/controller/ctrl_terminate/src/main.c b/tests/bluetooth/controller/ctrl_terminate/src/main.c index 4939be3a9587..3aa29fe72c67 100644 --- a/tests/bluetooth/controller/ctrl_terminate/src/main.c +++ b/tests/bluetooth/controller/ctrl_terminate/src/main.c @@ -82,8 +82,8 @@ static void test_terminate_rem(uint8_t role) ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(term_central, test_terminate_central_rem) @@ -134,8 +134,8 @@ static void test_terminate_loc(uint8_t role) /* There should be no host notification */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(term_central, test_terminate_central_loc) diff --git a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c index 0bfc0d3f3fcd..68ecadb31064 100644 --- a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c +++ b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c @@ -51,7 +51,9 @@ static struct ll_conn conn[CONFIG_BT_CTLR_LLCP_CONN]; static void alloc_setup(void *data) { ull_conn_init(); - test_setup(&conn[0]); + for (int i = 0; i < CONFIG_BT_MAX_CONN; i++) { + test_setup(&conn[i]); + } } ZTEST(tx_buffer_alloc, test_tx_buffer_alloc) @@ -76,18 +78,20 @@ ZTEST(tx_buffer_alloc, test_tx_buffer_alloc) zassert_true(llcp_tx_alloc_peek(&conn[0], ctxs[0])); tx[tx_alloc_idx] = llcp_tx_alloc(&conn[0], ctxs[0]); zassert_equal(conn[0].llcp.tx_buffer_alloc, i + 1); - zassert_equal(common_tx_buffer_alloc_count(), 0); + zassert_equal(llcp_common_tx_buffer_alloc_count(), 0); zassert_not_null(tx[tx_alloc_idx], NULL); tx_alloc_idx++; + } for (i = 0; i < CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM; i++) { zassert_true(llcp_tx_alloc_peek(&conn[0], ctxs[0])); tx[tx_alloc_idx] = llcp_tx_alloc(&conn[0], ctxs[0]); zassert_equal(conn[0].llcp.tx_buffer_alloc, CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM + i + 1, NULL); - zassert_equal(common_tx_buffer_alloc_count(), i+1); + zassert_equal(llcp_common_tx_buffer_alloc_count(), i+1); zassert_not_null(tx[tx_alloc_idx], NULL); tx_alloc_idx++; + } zassert_false(llcp_tx_alloc_peek(&conn[0], ctxs[0])); zassert_equal(ctxs[0]->wait_reason, WAITING_FOR_TX_BUFFER); @@ -98,7 +102,7 @@ ZTEST(tx_buffer_alloc, test_tx_buffer_alloc) zassert_true(llcp_tx_alloc_peek(&conn[j], ctxs[j])); tx[tx_alloc_idx] = llcp_tx_alloc(&conn[j], ctxs[j]); zassert_not_null(tx[tx_alloc_idx], NULL); - zassert_equal(common_tx_buffer_alloc_count(), + zassert_equal(llcp_common_tx_buffer_alloc_count(), CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM, NULL); zassert_equal(conn[j].llcp.tx_buffer_alloc, i + 1); tx_alloc_idx++; @@ -107,9 +111,8 @@ ZTEST(tx_buffer_alloc, test_tx_buffer_alloc) zassert_false(llcp_tx_alloc_peek(&conn[j], ctxs[j])); zassert_equal(ctxs[j]->wait_reason, WAITING_FOR_TX_BUFFER); } - ull_cp_release_tx(&conn[0], tx[1]); - zassert_equal(common_tx_buffer_alloc_count(), + zassert_equal(llcp_common_tx_buffer_alloc_count(), CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM - 1, NULL); zassert_equal(conn[0].llcp.tx_buffer_alloc, CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM + CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM - 1, NULL); @@ -120,15 +123,16 @@ ZTEST(tx_buffer_alloc, test_tx_buffer_alloc) /* ... ctxs[0] is */ zassert_true(llcp_tx_alloc_peek(&conn[0], ctxs[0])); tx[tx_alloc_idx] = llcp_tx_alloc(&conn[0], ctxs[0]); - zassert_equal(common_tx_buffer_alloc_count(), CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM, - NULL); - zassert_equal(conn[0].llcp.tx_buffer_alloc, CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM + + zassert_equal(llcp_common_tx_buffer_alloc_count(), + CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM, NULL); + zassert_equal(conn[0].llcp.tx_buffer_alloc, + CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM + CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM, NULL); zassert_not_null(tx[tx_alloc_idx], NULL); tx_alloc_idx++; ull_cp_release_tx(&conn[0], tx[tx_alloc_idx - 1]); - zassert_equal(common_tx_buffer_alloc_count(), + zassert_equal(llcp_common_tx_buffer_alloc_count(), CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM - 1, NULL); zassert_equal(conn[0].llcp.tx_buffer_alloc, CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM + CONFIG_BT_CTLR_LLCP_COMMON_TX_CTRL_BUF_NUM - 1, NULL); diff --git a/tests/bluetooth/controller/ctrl_unsupported/src/main.c b/tests/bluetooth/controller/ctrl_unsupported/src/main.c index 7db817f7cf42..dba145e6f3fc 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/src/main.c +++ b/tests/bluetooth/controller/ctrl_unsupported/src/main.c @@ -106,8 +106,8 @@ static void lt_tx_pdu_and_rx_unknown_rsp(enum helper_pdu_opcode opcode) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } static void lt_tx_undef_opcode_and_rx_unknown_rsp(uint8_t opcode) @@ -156,8 +156,8 @@ static void lt_tx_undef_opcode_and_rx_unknown_rsp(uint8_t opcode) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(invalid, test_invalid_per_rem) diff --git a/tests/bluetooth/controller/ctrl_version/src/main.c b/tests/bluetooth/controller/ctrl_version/src/main.c index f28ac11583d4..7fdd19de960f 100644 --- a/tests/bluetooth/controller/ctrl_version/src/main.c +++ b/tests/bluetooth/controller/ctrl_version/src/main.c @@ -114,8 +114,8 @@ ZTEST(version_central, test_version_exchange_central_loc) ut_rx_pdu(LL_VERSION_IND, &ntf, &remote_version_ind); ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -195,8 +195,8 @@ ZTEST(version_central, test_version_exchange_central_loc_invalid_rsp) /* There should be no host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Cheat, to allow second VEX */ conn.llcp.vex.sent = 0; @@ -231,8 +231,8 @@ ZTEST(version_central, test_version_exchange_central_loc_invalid_rsp) /* There should be no host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); /* Cheat, to allow second VEX */ conn.llcp.vex.sent = 0; @@ -264,8 +264,8 @@ ZTEST(version_central, test_version_exchange_central_loc_invalid_rsp) /* There should be no host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST(version_central, test_version_exchange_central_loc_2) @@ -285,9 +285,9 @@ ZTEST(version_central, test_version_exchange_central_loc_2) zassert_not_equal(err, BT_HCI_ERR_SUCCESS, NULL); - zassert_equal(ctx_buffers_free(), + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt() - CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM, - "Free CTX buffers %d", ctx_buffers_free()); + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -345,8 +345,8 @@ ZTEST(version_central, test_version_exchange_central_rem) /* There should not be a host notifications */ ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -413,8 +413,8 @@ ZTEST(version_central, test_version_exchange_central_rem_2) ut_rx_pdu(LL_VERSION_IND, &ntf, &remote_version_ind); ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } /* +-----+ +-------+ +-----+ @@ -508,8 +508,8 @@ ZTEST(version_central, test_version_exchange_central_loc_twice) /* Second attempt to run the version exchange completes immediately in idle state. * The context is released just after that. */ - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); + zassert_equal(llcp_ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", llcp_ctx_buffers_free()); } ZTEST_SUITE(version_central, NULL, NULL, version_setup, NULL, NULL);