Skip to content

Commit

Permalink
Bluetooth: controller: minor cleanup and a fix-up re. LLCP
Browse files Browse the repository at this point in the history
Only perform retention if not already done.
Ensure 'sched' is performed on phy ntf even if dle is not.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
  • Loading branch information
erbr-ot authored and jhedberg committed May 20, 2024
1 parent 806a4fc commit 9d8059b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 8 additions & 4 deletions subsys/bluetooth/controller/ll_sw/ull_llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,21 @@ void llcp_rx_node_retain(struct proc_ctx *ctx)
{
LL_ASSERT(ctx->node_ref.rx);

/* Mark RX node to NOT release */
ctx->node_ref.rx->hdr.type = NODE_RX_TYPE_RETAIN;
/* Only retain if not already retained */
if (ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN) {
/* Mark RX node to NOT release */
ctx->node_ref.rx->hdr.type = NODE_RX_TYPE_RETAIN;

/* store link element reference to use once this node is moved up */
ctx->node_ref.rx->hdr.link = ctx->node_ref.link;
/* store link element reference to use once this node is moved up */
ctx->node_ref.rx->hdr.link = ctx->node_ref.link;
}
}

void llcp_rx_node_release(struct proc_ctx *ctx)
{
LL_ASSERT(ctx->node_ref.rx);

/* Only release if retained */
if (ctx->node_ref.rx->hdr.type == NODE_RX_TYPE_RETAIN) {
/* Mark RX node to release and release */
ctx->node_ref.rx->hdr.type = NODE_RX_TYPE_RELEASE;
Expand Down
6 changes: 0 additions & 6 deletions subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,15 +450,9 @@ static void pu_ntf(struct ll_conn *conn, struct proc_ctx *ctx)
}

/* Enqueue notification towards LL */
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
/* only 'put' as the 'sched' is handled when handling DLE ntf */
ll_rx_put(ntf->hdr.link, ntf);
#else
ll_rx_put_sched(ntf->hdr.link, ntf);
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */

ctx->data.pu.ntf_pu = 0;
ctx->node_ref.rx = NULL;
}

#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
Expand Down

0 comments on commit 9d8059b

Please sign in to comment.