Skip to content

Commit ae70d76

Browse files
erbr-othenrikbrixandersen
authored andcommitted
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: Erik Brockhoff <[email protected]> (cherry picked from commit 9d8059b) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent d1a10bc commit ae70d76

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

subsys/bluetooth/controller/ll_sw/ull_llcp.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,21 @@ void llcp_rx_node_retain(struct proc_ctx *ctx)
284284
{
285285
LL_ASSERT(ctx->node_ref.rx);
286286

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

290-
/* store link element reference to use once this node is moved up */
291-
ctx->node_ref.rx->hdr.link = ctx->node_ref.link;
292+
/* store link element reference to use once this node is moved up */
293+
ctx->node_ref.rx->hdr.link = ctx->node_ref.link;
294+
}
292295
}
293296

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

301+
/* Only release if retained */
298302
if (ctx->node_ref.rx->hdr.type == NODE_RX_TYPE_RETAIN) {
299303
/* Mark RX node to release and release */
300304
ctx->node_ref.rx->hdr.type = NODE_RX_TYPE_RELEASE;

subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,9 @@ static void pu_ntf(struct ll_conn *conn, struct proc_ctx *ctx)
450450
}
451451

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

460455
ctx->data.pu.ntf_pu = 0;
461-
ctx->node_ref.rx = NULL;
462456
}
463457

464458
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)

0 commit comments

Comments
 (0)