Commit 9d8059b6 authored by Erik Brockhoff's avatar Erik Brockhoff Committed by Johan Hedberg
Browse files

Bluetooth: controller: minor cleanup and a fix-up re. LLCP

Only perform retention if not already done.
Ensure 'sched' is performed on phy ntf even if dle is not.

Signed-off-by: default avatarErik Brockhoff <erbr@oticon.com>
parent 806a4fcf
Loading
Loading
Loading
Loading
+4 −0
Changes for subsys/bluetooth/controller/ll_sw/ull_llcp.c: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -284,17 +284,21 @@ void llcp_rx_node_retain(struct proc_ctx *ctx)
{
	LL_ASSERT(ctx->node_ref.rx);

	/* 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;
	}
}

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;
+0 −6
Changes for subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c: 0 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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)