Bluetooth: controller: Add handle to ll_data_path_sink_create
For making handle available in vendor sink creation, add ISO handle to function prototype. Expose datapath allocation via new ull_iso_datapath_alloc function. Signed-off-by: Morten Priess <mtpr@oticon.com>
This commit is contained in:
parent
f1c9a02dd6
commit
a803588d2c
3 changed files with 14 additions and 4 deletions
|
@ -197,11 +197,13 @@ uint8_t ll_read_iso_tx_sync(uint16_t handle, uint16_t *seq,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Must be implemented by vendor */
|
/* Must be implemented by vendor */
|
||||||
__weak bool ll_data_path_sink_create(struct ll_iso_datapath *datapath,
|
__weak bool ll_data_path_sink_create(uint16_t handle,
|
||||||
|
struct ll_iso_datapath *datapath,
|
||||||
isoal_sink_sdu_alloc_cb *sdu_alloc,
|
isoal_sink_sdu_alloc_cb *sdu_alloc,
|
||||||
isoal_sink_sdu_emit_cb *sdu_emit,
|
isoal_sink_sdu_emit_cb *sdu_emit,
|
||||||
isoal_sink_sdu_write_cb *sdu_write)
|
isoal_sink_sdu_write_cb *sdu_write)
|
||||||
{
|
{
|
||||||
|
ARG_UNUSED(handle);
|
||||||
ARG_UNUSED(datapath);
|
ARG_UNUSED(datapath);
|
||||||
|
|
||||||
*sdu_alloc = NULL;
|
*sdu_alloc = NULL;
|
||||||
|
@ -406,7 +408,8 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
|
||||||
isoal_sink_sdu_write_cb sdu_write;
|
isoal_sink_sdu_write_cb sdu_write;
|
||||||
|
|
||||||
/* Request vendor sink callbacks for path */
|
/* Request vendor sink callbacks for path */
|
||||||
if (ll_data_path_sink_create(dp, &sdu_alloc, &sdu_emit, &sdu_write)) {
|
if (ll_data_path_sink_create(handle, dp, &sdu_alloc, &sdu_emit,
|
||||||
|
&sdu_write)) {
|
||||||
err = isoal_sink_create(handle, role, framed,
|
err = isoal_sink_create(handle, role, framed,
|
||||||
burst_number, flush_timeout,
|
burst_number, flush_timeout,
|
||||||
sdu_interval, iso_interval,
|
sdu_interval, iso_interval,
|
||||||
|
@ -506,7 +509,7 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
|
||||||
isoal_sink_sdu_write_cb sdu_write;
|
isoal_sink_sdu_write_cb sdu_write;
|
||||||
|
|
||||||
/* Request vendor sink callbacks for path */
|
/* Request vendor sink callbacks for path */
|
||||||
if (ll_data_path_sink_create(dp, &sdu_alloc, &sdu_emit, &sdu_write)) {
|
if (ll_data_path_sink_create(handle, dp, &sdu_alloc, &sdu_emit, &sdu_write)) {
|
||||||
err = isoal_sink_create(handle, role, framed,
|
err = isoal_sink_create(handle, role, framed,
|
||||||
burst_number, flush_timeout,
|
burst_number, flush_timeout,
|
||||||
sdu_interval, iso_interval,
|
sdu_interval, iso_interval,
|
||||||
|
@ -1539,6 +1542,11 @@ void ll_iso_rx_mem_release(void **node_rx)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_SYNC_ISO) || CONFIG_BT_CTLR_CONN_ISO */
|
#endif /* CONFIG_BT_CTLR_SYNC_ISO) || CONFIG_BT_CTLR_CONN_ISO */
|
||||||
|
|
||||||
|
struct ll_iso_datapath *ull_iso_datapath_alloc(void)
|
||||||
|
{
|
||||||
|
return mem_acquire(&datapath_free);
|
||||||
|
}
|
||||||
|
|
||||||
void ull_iso_datapath_release(struct ll_iso_datapath *dp)
|
void ull_iso_datapath_release(struct ll_iso_datapath *dp)
|
||||||
{
|
{
|
||||||
mem_release(dp, &datapath_free);
|
mem_release(dp, &datapath_free);
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
int ull_iso_init(void);
|
int ull_iso_init(void);
|
||||||
int ull_iso_reset(void);
|
int ull_iso_reset(void);
|
||||||
|
struct ll_iso_datapath *ull_iso_datapath_alloc(void);
|
||||||
void ull_iso_datapath_release(struct ll_iso_datapath *dp);
|
void ull_iso_datapath_release(struct ll_iso_datapath *dp);
|
||||||
void ll_iso_rx_put(memq_link_t *link, void *rx);
|
void ll_iso_rx_put(memq_link_t *link, void *rx);
|
||||||
void *ll_iso_rx_get(void);
|
void *ll_iso_rx_get(void);
|
||||||
|
|
|
@ -129,11 +129,12 @@ static isoal_status_t test_sink_sdu_write(void *dbuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ll_data_path_sink_create(struct ll_iso_datapath *datapath,
|
bool ll_data_path_sink_create(uint16_t handle, struct ll_iso_datapath *datapath,
|
||||||
isoal_sink_sdu_alloc_cb *sdu_alloc,
|
isoal_sink_sdu_alloc_cb *sdu_alloc,
|
||||||
isoal_sink_sdu_emit_cb *sdu_emit,
|
isoal_sink_sdu_emit_cb *sdu_emit,
|
||||||
isoal_sink_sdu_write_cb *sdu_write)
|
isoal_sink_sdu_write_cb *sdu_write)
|
||||||
{
|
{
|
||||||
|
ARG_UNUSED(handle);
|
||||||
ARG_UNUSED(datapath);
|
ARG_UNUSED(datapath);
|
||||||
|
|
||||||
*sdu_alloc = test_sink_sdu_alloc;
|
*sdu_alloc = test_sink_sdu_alloc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue