Bluetooth: Controller: Fix to release aux context stored in node rx
Fix to release aux context stored in node rx, and not in the
superior scan or sync context as the one in the superior scan
or sync context could be reset or have a different new aux
context when multiple advertising chain reception is used.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit a8065926acaccef1255c29522a9b8f86dd83f4cf)
diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c
index 37bc040..11dd28f 100644
--- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c
+++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c
@@ -1100,6 +1100,7 @@
node_rx2->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE;
node_rx2->rx_ftr.param = lll;
+ node_rx2->rx_ftr.lll_aux = lll->lll_aux;
ull_rx_put_sched(node_rx2->hdr.link, node_rx2);
}
diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c
index 1613119..d764fe9 100644
--- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c
+++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan_aux.c
@@ -707,6 +707,7 @@
node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE;
node_rx->rx_ftr.param = lll;
+ node_rx->rx_ftr.lll_aux = lll->lll_aux;
node_rx->rx_ftr.aux_failed = 1U;
ull_rx_put_sched(node_rx->hdr.link, node_rx);
@@ -891,6 +892,7 @@
* free it.
*/
node_rx2->rx_ftr.param = lll;
+ node_rx2->rx_ftr.lll_aux = lll->lll_aux;
ull_rx_put_sched(node_rx2->hdr.link, node_rx2);
}
@@ -1612,7 +1614,8 @@
node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE;
- node_rx->rx_ftr.param = lll->lll_aux;
+ node_rx->rx_ftr.param = lll;
+ node_rx->rx_ftr.lll_aux = lll->lll_aux;
ull_rx_put_sched(node_rx->hdr.link, node_rx);
diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c
index 5d1d463..2613de2 100644
--- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c
+++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync.c
@@ -1152,6 +1152,7 @@
node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE;
node_rx->rx_ftr.param = lll;
+ node_rx->rx_ftr.lll_aux = lll->lll_aux;
node_rx->rx_ftr.aux_failed = 1U;
ull_rx_put(node_rx->hdr.link, node_rx);
@@ -1250,6 +1251,7 @@
node_rx->hdr.type = NODE_RX_TYPE_EXT_AUX_RELEASE;
node_rx->rx_ftr.param = lll;
+ node_rx->rx_ftr.lll_aux = lll->lll_aux;
node_rx->rx_ftr.aux_failed = 1U;
ull_rx_put_sched(node_rx->hdr.link, node_rx);
diff --git a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c
index 44975d0..da3ac2e 100644
--- a/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c
+++ b/subsys/bluetooth/controller/ll_sw/ull_scan_aux.c
@@ -1100,7 +1100,7 @@
rx->hdr.type = NODE_RX_TYPE_RELEASE;
lll = rx->rx_ftr.param;
- lll_aux = lll->lll_aux;
+ lll_aux = rx->rx_ftr.lll_aux;
} else if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_PERIODIC) ||
ull_scan_aux_is_valid_get(param_ull)) {
@@ -1119,7 +1119,7 @@
sync->data_len = 0U;
lll = rx->rx_ftr.param;
- lll_aux = lll->lll_aux;
+ lll_aux = rx->rx_ftr.lll_aux;
/* Change node type so HCI can dispatch report for truncated
* data properly.