Skip to content

Commit a11a45e

Browse files
committed
fixup! Bluetooth: Controller: Introduce LL_ASSERT_DBG/ERR
Introduce development and fatal assertion classification in the Controller implementation. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent a5444f0 commit a11a45e

File tree

10 files changed

+111
-111
lines changed

10 files changed

+111
-111
lines changed

subsys/bluetooth/controller/ll_sw/ull_llcp.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static struct proc_ctx *proc_ctx_acquire(struct llcp_mem_pool *owner)
109109
void llcp_proc_ctx_release(struct proc_ctx *ctx)
110110
{
111111
/* We need to have an owner otherwise the memory allocated would leak */
112-
LL_ASSERT(ctx->owner);
112+
LL_ASSERT_DBG(ctx->owner);
113113

114114
/* Release the memory back to the owner */
115115
mem_release(ctx, &ctx->owner->free);
@@ -297,7 +297,7 @@ void llcp_tx_resume_data(struct ll_conn *conn, enum llcp_tx_q_pause_data_mask re
297297

298298
void llcp_rx_node_retain(struct proc_ctx *ctx)
299299
{
300-
LL_ASSERT(ctx->node_ref.rx);
300+
LL_ASSERT_DBG(ctx->node_ref.rx);
301301

302302
/* Only retain if not already retained */
303303
if (ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN) {
@@ -311,7 +311,7 @@ void llcp_rx_node_retain(struct proc_ctx *ctx)
311311

312312
void llcp_rx_node_release(struct proc_ctx *ctx)
313313
{
314-
LL_ASSERT(ctx->node_ref.rx);
314+
LL_ASSERT_DBG(ctx->node_ref.rx);
315315

316316
/* Only release if retained */
317317
if (ctx->node_ref.rx->hdr.type == NODE_RX_TYPE_RETAIN) {
@@ -472,7 +472,7 @@ void ull_cp_release_tx(struct ll_conn *conn, struct node_tx *tx)
472472
{
473473
#if defined(LLCP_TX_CTRL_BUF_QUEUE_ENABLE)
474474
if (conn) {
475-
LL_ASSERT(conn->llcp.tx_buffer_alloc > 0);
475+
LL_ASSERT_DBG(conn->llcp.tx_buffer_alloc > 0);
476476
if (conn->llcp.tx_buffer_alloc > CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) {
477477
common_tx_buffer_alloc--;
478478
}
@@ -511,7 +511,7 @@ int ull_cp_prt_elapse(struct ll_conn *conn, uint16_t elapsed_event, uint8_t *err
511511
struct proc_ctx *ctx;
512512

513513
ctx = llcp_lr_peek(conn);
514-
LL_ASSERT(ctx);
514+
LL_ASSERT_DBG(ctx);
515515

516516
if (ctx->proc == PROC_TERMINATE) {
517517
/* Active procedure is ACL Termination */
@@ -1026,7 +1026,7 @@ uint8_t ull_cp_conn_update(struct ll_conn *conn, uint16_t interval_min, uint16_t
10261026
}
10271027
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
10281028
} else {
1029-
LL_ASSERT(0); /* Unknown procedure */
1029+
LL_ASSERT_DBG(0); /* Unknown procedure */
10301030
}
10311031

10321032
llcp_lr_enqueue(conn, ctx);
@@ -1051,7 +1051,7 @@ uint8_t ull_cp_periodic_sync(struct ll_conn *conn, struct ll_sync_set *sync,
10511051
uint8_t phy;
10521052

10531053
/* Exactly one of the sync and adv_sync pointers should be non-null */
1054-
LL_ASSERT((!adv_sync && sync) || (adv_sync && !sync));
1054+
LL_ASSERT_DBG((!adv_sync && sync) || (adv_sync && !sync));
10551055

10561056
if (!feature_peer_periodic_sync_recv(conn)) {
10571057
return BT_HCI_ERR_UNSUPP_REMOTE_FEATURE;
@@ -1080,7 +1080,7 @@ uint8_t ull_cp_periodic_sync(struct ll_conn *conn, struct ll_sync_set *sync,
10801080
rl_idx = ull_filter_rl_find(addr_type, sync->peer_id_addr, NULL);
10811081

10821082
/* A resolved address must be present in the resolve list */
1083-
LL_ASSERT(rl_idx < ll_rl_size_get());
1083+
LL_ASSERT_DBG(rl_idx < ll_rl_size_get());
10841084

10851085
/* Generate RPAs if required */
10861086
ull_filter_rpa_update(false);
@@ -1999,7 +1999,7 @@ void ull_cp_rx(struct ll_conn *conn, memq_link_t *link, struct node_rx_pdu *rx)
19991999
*/
20002000

20012001
/* Process PDU as a new remote request */
2002-
LL_ASSERT(pdu_valid);
2002+
LL_ASSERT_DBG(pdu_valid);
20032003
llcp_rr_new(conn, link, rx, true);
20042004
} else {
20052005
/* Local active procedure

subsys/bluetooth/controller/ll_sw/ull_llcp_cc.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void cc_ntf_established(struct ll_conn *conn, struct proc_ctx *ctx)
6565

6666
/* Allocate ntf node */
6767
ntf = ctx->node_ref.rx;
68-
LL_ASSERT(ntf);
68+
LL_ASSERT_DBG(ntf);
6969
ctx->node_ref.rx = NULL;
7070

7171
piggy_back = (ntf->hdr.type != NODE_RX_TYPE_RETAIN);
@@ -146,7 +146,7 @@ static void llcp_rp_cc_tx_rsp(struct ll_conn *conn, struct proc_ctx *ctx)
146146

147147
/* Allocate tx node */
148148
tx = llcp_tx_alloc(conn, ctx);
149-
LL_ASSERT(tx);
149+
LL_ASSERT_DBG(tx);
150150

151151
pdu = (struct pdu_data *)tx->pdu;
152152
conn_event_count = ctx->data.cis_create.conn_event_count;
@@ -201,7 +201,7 @@ static void llcp_rp_cc_tx_reject(struct ll_conn *conn, struct proc_ctx *ctx, uin
201201

202202
/* Allocate tx node */
203203
tx = ctx->node_ref.tx;
204-
LL_ASSERT(tx);
204+
LL_ASSERT_DBG(tx);
205205
ctx->node_ref.tx = NULL;
206206

207207
pdu = (struct pdu_data *)tx->pdu;
@@ -221,7 +221,7 @@ static void rp_cc_ntf_create(struct ll_conn *conn, struct proc_ctx *ctx)
221221

222222
ntf = ctx->node_ref.rx;
223223
ctx->node_ref.rx = NULL;
224-
LL_ASSERT(ntf);
224+
LL_ASSERT_DBG(ntf);
225225

226226
ntf->hdr.type = NODE_RX_TYPE_CIS_REQUEST;
227227
ntf->hdr.handle = conn->lll.handle;
@@ -490,7 +490,7 @@ static void rp_cc_state_wait_rx_cis_ind(struct ll_conn *conn, struct proc_ctx *c
490490
}
491491
/* If we get to here the CIG_ID referred in req/acquire has become void/invalid */
492492
/* This cannot happen unless the universe has started to deflate */
493-
LL_ASSERT(0);
493+
LL_ASSERT_DBG(0);
494494
case RP_CC_EVT_REJECT:
495495
/* Handle CIS creation rejection */
496496
break;
@@ -656,7 +656,7 @@ static void rp_cc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_
656656
break;
657657
default:
658658
/* Unknown state */
659-
LL_ASSERT(0);
659+
LL_ASSERT_DBG(0);
660660
}
661661
}
662662

@@ -767,7 +767,7 @@ static void lp_cc_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode)
767767

768768
/* Allocate tx node */
769769
tx = llcp_tx_alloc(conn, ctx);
770-
LL_ASSERT(tx);
770+
LL_ASSERT_DBG(tx);
771771

772772
pdu = (struct pdu_data *)tx->pdu;
773773

@@ -781,7 +781,7 @@ static void lp_cc_tx(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t opcode)
781781
break;
782782
default:
783783
/* Unknown opcode */
784-
LL_ASSERT(0);
784+
LL_ASSERT_DBG(0);
785785
break;
786786
}
787787

@@ -929,7 +929,7 @@ static void lp_cc_st_idle(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ev
929929
break;
930930
default:
931931
/* Unknown procedure */
932-
LL_ASSERT(0);
932+
LL_ASSERT_DBG(0);
933933
break;
934934
}
935935
break;
@@ -971,7 +971,7 @@ static void cc_prepare_cis_ind(struct ll_conn *conn, struct proc_ctx *ctx)
971971
&ctx->data.cis_create.cis_offset_max,
972972
&ctx->data.cis_create.conn_event_count,
973973
ctx->data.cis_create.aa);
974-
LL_ASSERT(!err);
974+
LL_ASSERT_DBG(!err);
975975

976976
ctx->state = LP_CC_STATE_WAIT_INSTANT;
977977
ctx->rx_opcode = PDU_DATA_LLCTRL_TYPE_UNUSED;
@@ -1054,7 +1054,7 @@ static void lp_cc_st_wait_rx_cis_rsp_cancel(struct ll_conn *conn, struct proc_ct
10541054
case LP_CC_EVT_CIS_RSP:
10551055
/* Allocate tx node */
10561056
tx = llcp_tx_alloc(conn, ctx);
1057-
LL_ASSERT(tx);
1057+
LL_ASSERT_DBG(tx);
10581058

10591059
pdu = (struct pdu_data *)tx->pdu;
10601060

@@ -1177,7 +1177,7 @@ static void lp_cc_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint8_
11771177
break;
11781178
default:
11791179
/* Unknown state */
1180-
LL_ASSERT(0);
1180+
LL_ASSERT_DBG(0);
11811181
break;
11821182
}
11831183
}

subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void lp_chmu_tx(struct ll_conn *conn, struct proc_ctx *ctx)
8989

9090
/* Allocate tx node */
9191
tx = llcp_tx_alloc(conn, ctx);
92-
LL_ASSERT(tx);
92+
LL_ASSERT_DBG(tx);
9393

9494
pdu = (struct pdu_data *)tx->pdu;
9595

@@ -180,7 +180,7 @@ static void lp_chmu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint
180180
break;
181181
default:
182182
/* Unknown state */
183-
LL_ASSERT(0);
183+
LL_ASSERT_DBG(0);
184184
}
185185
}
186186

@@ -293,7 +293,7 @@ static void rp_chmu_execute_fsm(struct ll_conn *conn, struct proc_ctx *ctx, uint
293293
break;
294294
default:
295295
/* Unknown state */
296-
LL_ASSERT(0);
296+
LL_ASSERT_DBG(0);
297297
}
298298
}
299299

0 commit comments

Comments
 (0)