Skip to content

Commit 31e6c89

Browse files
committed
Bluetooth: Controller: Make node rx release code conditionally reusable
Make the block of code that is used to release node rx with type NODE_RX_TYPE_RELEASE to be conditionally available for other Kconfig selectable features like Extended Scanning. Previously it was only available for CONFIG_BT_CONN, but now Extended Scanning with LLL scheduling releases node rx when radio event is closed due to failure to receive an auxiliary PDU. Relates to commit 2feffaf ("Bluetooth: Controller: Release LLL scheduling aux on incomplete data"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 52b2d39 commit 31e6c89

File tree

1 file changed

+13
-4
lines changed
  • subsys/bluetooth/controller/ll_sw

1 file changed

+13
-4
lines changed

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,12 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle)
820820
memq_link_t *link;
821821
uint8_t cmplt = 0U;
822822

823-
#if defined(CONFIG_BT_CONN)
823+
#if defined(CONFIG_BT_CONN) || \
824+
(defined(CONFIG_BT_OBSERVER) && defined(CONFIG_BT_CTLR_ADV_EXT))
824825
ll_rx_get_again:
825-
#endif /* CONFIG_BT_CONN */
826+
#endif /* CONFIG_BT_CONN ||
827+
* (CONFIG_BT_OBSERVER && CONFIG_BT_CTLR_ADV_EXT)
828+
*/
826829

827830
*node_rx = NULL;
828831

@@ -842,11 +845,15 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle)
842845
mfifo_tx_ack.l);
843846
} while ((cmplt_prev != 0U) ||
844847
(cmplt_prev != cmplt_curr));
848+
#endif /* CONFIG_BT_CONN */
845849

850+
if (0) {
851+
#if defined(CONFIG_BT_CONN) || \
852+
(defined(CONFIG_BT_OBSERVER) && defined(CONFIG_BT_CTLR_ADV_EXT))
846853
/* Do not send up buffers to Host thread that are
847854
* marked for release
848855
*/
849-
if (rx->type == NODE_RX_TYPE_RELEASE) {
856+
} else if (rx->type == NODE_RX_TYPE_RELEASE) {
850857
(void)memq_dequeue(memq_ll_rx.tail,
851858
&memq_ll_rx.head, NULL);
852859
mem_release(link, &mem_link_rx.free);
@@ -858,8 +865,10 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle)
858865
rx_alloc(1);
859866

860867
goto ll_rx_get_again;
868+
#endif /* CONFIG_BT_CONN ||
869+
* (CONFIG_BT_OBSERVER && CONFIG_BT_CTLR_ADV_EXT)
870+
*/
861871
}
862-
#endif /* CONFIG_BT_CONN */
863872

864873
*node_rx = rx;
865874

0 commit comments

Comments
 (0)