Skip to content

Commit c5e077c

Browse files
cvinayakcfriedt
authored andcommitted
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 fa02dc4 commit c5e077c

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
@@ -817,9 +817,12 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle)
817817
memq_link_t *link;
818818
uint8_t cmplt = 0U;
819819

820-
#if defined(CONFIG_BT_CONN)
820+
#if defined(CONFIG_BT_CONN) || \
821+
(defined(CONFIG_BT_OBSERVER) && defined(CONFIG_BT_CTLR_ADV_EXT))
821822
ll_rx_get_again:
822-
#endif /* CONFIG_BT_CONN */
823+
#endif /* CONFIG_BT_CONN ||
824+
* (CONFIG_BT_OBSERVER && CONFIG_BT_CTLR_ADV_EXT)
825+
*/
823826

824827
*node_rx = NULL;
825828

@@ -839,11 +842,15 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle)
839842
mfifo_tx_ack.l);
840843
} while ((cmplt_prev != 0U) ||
841844
(cmplt_prev != cmplt_curr));
845+
#endif /* CONFIG_BT_CONN */
842846

847+
if (0) {
848+
#if defined(CONFIG_BT_CONN) || \
849+
(defined(CONFIG_BT_OBSERVER) && defined(CONFIG_BT_CTLR_ADV_EXT))
843850
/* Do not send up buffers to Host thread that are
844851
* marked for release
845852
*/
846-
if (rx->type == NODE_RX_TYPE_RELEASE) {
853+
} else if (rx->type == NODE_RX_TYPE_RELEASE) {
847854
(void)memq_dequeue(memq_ll_rx.tail,
848855
&memq_ll_rx.head, NULL);
849856
mem_release(link, &mem_link_rx.free);
@@ -855,8 +862,10 @@ uint8_t ll_rx_get(void **node_rx, uint16_t *handle)
855862
rx_alloc(1);
856863

857864
goto ll_rx_get_again;
865+
#endif /* CONFIG_BT_CONN ||
866+
* (CONFIG_BT_OBSERVER && CONFIG_BT_CTLR_ADV_EXT)
867+
*/
858868
}
859-
#endif /* CONFIG_BT_CONN */
860869

861870
*node_rx = rx;
862871

0 commit comments

Comments
 (0)