1 /*
2  * Copyright (c) 2020-2021 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #if defined(CONFIG_BT_CTLR_ADV_ISO) || defined(CONFIG_BT_CTLR_CONN_ISO)
8 /* Calculate ISO PDU buffers required considering SDU fragmentation */
9 /* FIXME: Calculation considering both Connected and Broadcast ISO PDU
10  *        fragmentation.
11  */
12 #if defined(CONFIG_BT_CTLR_CONN_ISO)
13 #define BT_CTLR_ISO_TX_BUFFERS (((CONFIG_BT_CTLR_CONN_ISO_SDU_LEN_MAX + \
14 				  CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX - 1U) / \
15 				 CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX) * \
16 				CONFIG_BT_CTLR_ISO_TX_BUFFERS)
17 #else /* !CONFIG_BT_CTLR_CONN_ISO */
18 #define BT_CTLR_ISO_TX_BUFFERS CONFIG_BT_CTLR_ISO_TX_BUFFERS
19 #endif /* !CONFIG_BT_CTLR_CONN_ISO */
20 #else /* !CONFIG_BT_CTLR_ADV_ISO && !CONFIG_BT_CTLR_CONN_ISO */
21 #define BT_CTLR_ISO_TX_BUFFERS 0
22 #endif /* !CONFIG_BT_CTLR_ADV_ISO && !CONFIG_BT_CTLR_CONN_ISO */
23 
24 int ull_iso_init(void);
25 int ull_iso_reset(void);
26 struct ll_iso_datapath *ull_iso_datapath_alloc(void);
27 void ull_iso_datapath_release(struct ll_iso_datapath *dp);
28 void ll_iso_rx_put(memq_link_t *link, void *rx);
29 void *ll_iso_rx_get(void);
30 void ll_iso_rx_dequeue(void);
31 void ll_iso_transmit_test_send_sdu(uint16_t handle, uint32_t ticks_at_expire);
32 
33 /* Must be implemented by vendor if vendor-specific data path is supported */
34 bool ll_data_path_configured(uint8_t data_path_dir, uint8_t data_path_id);
35 /* Must be implemented by vendor if vendor-specific data path is supported */
36 bool ll_data_path_sink_create(uint16_t handle,
37 			      struct ll_iso_datapath *datapath,
38 			      isoal_sink_sdu_alloc_cb *sdu_alloc,
39 			      isoal_sink_sdu_emit_cb *sdu_emit,
40 			      isoal_sink_sdu_write_cb *sdu_write);
41 /* Must be implemented by vendor if vendor-specific data path is supported */
42 bool ll_data_path_source_create(uint16_t handle,
43 				struct ll_iso_datapath *datapath,
44 				isoal_source_pdu_alloc_cb *pdu_alloc,
45 				isoal_source_pdu_write_cb *pdu_write,
46 				isoal_source_pdu_emit_cb *pdu_emit,
47 				isoal_source_pdu_release_cb *pdu_release);
48