1 /*
2  * Copyright (c) 2021 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <stdint.h>
8 #include <stdbool.h>
9 
10 #include <zephyr/bluetooth/hci_types.h>
11 #include "isoal.h"
12 
13 #include "util/util.h"
14 #include "util/memq.h"
15 
16 #include "hal/ccm.h"
17 
18 #include "pdu_df.h"
19 #include "lll/pdu_vendor.h"
20 #include "pdu.h"
21 #include "lll.h"
22 #include "lll_conn.h"
23 
24 #include "ull_iso_types.h"
25 #include "ull_conn_internal.h"
26 #include "ull_internal.h"
27 
28 /* FIXME: Implement vendor specific data path configuration */
29 static bool dummy;
30 
ll_data_path_configured(uint8_t data_path_dir,uint8_t data_path_id)31 bool ll_data_path_configured(uint8_t data_path_dir, uint8_t data_path_id)
32 {
33 	ARG_UNUSED(data_path_dir);
34 	ARG_UNUSED(data_path_id);
35 
36 	return dummy;
37 }
38 
ll_data_path_source_create(uint16_t handle,struct ll_iso_datapath * datapath,isoal_source_pdu_alloc_cb * pdu_alloc,isoal_source_pdu_write_cb * pdu_write,isoal_source_pdu_emit_cb * pdu_emit,isoal_source_pdu_release_cb * pdu_release)39 bool ll_data_path_source_create(uint16_t handle,
40 				struct ll_iso_datapath *datapath,
41 				isoal_source_pdu_alloc_cb *pdu_alloc,
42 				isoal_source_pdu_write_cb *pdu_write,
43 				isoal_source_pdu_emit_cb *pdu_emit,
44 				isoal_source_pdu_release_cb *pdu_release)
45 {
46 	ARG_UNUSED(handle);
47 	ARG_UNUSED(datapath);
48 	ARG_UNUSED(pdu_alloc);
49 	ARG_UNUSED(pdu_write);
50 	ARG_UNUSED(pdu_emit);
51 	ARG_UNUSED(pdu_release);
52 
53 	return false;
54 }
55 
ll_configure_data_path(uint8_t data_path_dir,uint8_t data_path_id,uint8_t vs_config_len,uint8_t * vs_config)56 uint8_t ll_configure_data_path(uint8_t data_path_dir, uint8_t data_path_id,
57 			       uint8_t vs_config_len, uint8_t *vs_config)
58 {
59 	ARG_UNUSED(data_path_id);
60 	ARG_UNUSED(vs_config_len);
61 	ARG_UNUSED(vs_config);
62 
63 	if (!IS_ENABLED(CONFIG_BT_CTLR_SYNC_ISO) ||
64 	    (data_path_dir == BT_HCI_DATAPATH_DIR_CTLR_TO_HOST)) {
65 		dummy = true;
66 	}
67 
68 	return 0;
69 }
70 
ll_data_path_tx_pdu_release(uint16_t handle,struct node_tx_iso * node_tx)71 void ll_data_path_tx_pdu_release(uint16_t handle, struct node_tx_iso *node_tx)
72 {
73 	/* FIXME: ll_tx_ack_put is not LLL callable as it is
74 	 * used by ACL connections in ULL context to dispatch
75 	 * ack.
76 	 */
77 	ll_tx_ack_put(handle, (void *)node_tx);
78 	ll_rx_sched();
79 }
80