Skip to content

Commit 3fc74be

Browse files
andrzej-kaczmarekcarlescufi
authored andcommitted
Bluetooth: controller: Allow to simply release node allocated in LLL
If we allocate a node in LLL and it turns out that we don't need it (e.g. allocated connection on AUX_CONNECT_REQ, but connection handshake did not complete and we don't need it) we still need to send it to ULL to be released. We can use existing NODE_RX_TYPE_DC_PDU_RELEASE node type for this purpose, but we just need to make sure it's passed from LLL to ULL properly. Also, since this now does not only release DC PDUs, let's change its name to a more generic one. Signed-off-by: Andrzej Kaczmarek <[email protected]>
1 parent 98d7adc commit 3fc74be

File tree

3 files changed

+49
-46
lines changed

3 files changed

+49
-46
lines changed

subsys/bluetooth/controller/ll_sw/lll.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ struct lll_event {
160160
enum node_rx_type {
161161
/* Unused */
162162
NODE_RX_TYPE_NONE = 0x00,
163+
/* Signals release of node */
164+
NODE_RX_TYPE_RELEASE,
163165
/* Signals completion of RX event */
164166
NODE_RX_TYPE_EVENT_DONE,
165167
/* Signals arrival of RX Data Channel payload */
166168
NODE_RX_TYPE_DC_PDU,
167-
/* Signals release of RX Data Channel payload */
168-
NODE_RX_TYPE_DC_PDU_RELEASE,
169169
/* Advertisement report from scanning */
170170
NODE_RX_TYPE_REPORT,
171171
NODE_RX_TYPE_EXT_1M_REPORT,

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle)
634634
/* Do not send up buffers to Host thread that are
635635
* marked for release
636636
*/
637-
if (rx->type == NODE_RX_TYPE_DC_PDU_RELEASE) {
637+
if (rx->type == NODE_RX_TYPE_RELEASE) {
638638
(void)memq_dequeue(memq_ll_rx.tail,
639639
&memq_ll_rx.head, NULL);
640640
mem_release(link, &mem_link_rx.free);
@@ -2003,6 +2003,8 @@ static inline int rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx)
20032003
#if defined(CONFIG_BT_CTLR_SCAN_INDICATION)
20042004
case NODE_RX_TYPE_SCAN_INDICATION:
20052005
#endif /* CONFIG_BT_CTLR_SCAN_INDICATION */
2006+
2007+
case NODE_RX_TYPE_RELEASE:
20062008
{
20072009
memq_dequeue(memq_ull_rx.tail, &memq_ull_rx.head, NULL);
20082010
ll_rx_put(link, rx);

0 commit comments

Comments
 (0)