Skip to content

Commit 85b503e

Browse files
mtpr-otcarlescufi
authored andcommitted
Bluetooth: controller: ISO Sync Receiver vendor data path fixes
Add checks for vendor specific data path in ULL and HCI driver, to enable use of vendor data path for BIS reception. Signed-off-by: Morten Priess <[email protected]>
1 parent 14191f1 commit 85b503e

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

subsys/bluetooth/controller/hci/hci_driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ static inline struct net_buf *encode_node(struct node_rx_pdu *node_rx,
458458
/* Check validity of the data path sink. FIXME: A channel disconnect race
459459
* may cause ISO data pending without valid data path.
460460
*/
461-
if (stream && stream->dp) {
461+
if (stream && stream->dp &&
462+
(stream->dp->path_id == BT_HCI_DATAPATH_ID_HCI)) {
462463
isoal_rx.meta = &node_rx->hdr.rx_iso_meta;
463464
isoal_rx.pdu = (void *)node_rx->pdu;
464465
err = isoal_rx_pdu_recombine(stream->dp->sink_hdl, &isoal_rx);

subsys/bluetooth/controller/ll_sw/ull_iso.c

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,14 +1569,14 @@ static void iso_rx_cig_ref_point_update(struct ll_conn_iso_group *cig,
15691569

15701570
static void iso_rx_demux(void *param)
15711571
{
1572-
#if defined(CONFIG_BT_CTLR_CONN_ISO)
1573-
struct ll_conn_iso_stream *cis;
1574-
struct ll_conn_iso_group *cig;
1572+
#if defined(CONFIG_BT_CTLR_CONN_ISO) || \
1573+
defined(CONFIG_BT_CTLR_SYNC_ISO)
15751574
struct ll_iso_datapath *dp;
1575+
#endif /* CONFIG_BT_CTLR_CONN_ISO || CONFIG_BT_CTLR_SYNC_ISO */
15761576
struct node_rx_pdu *rx_pdu;
1577-
#endif /* CONFIG_BT_CTLR_CONN_ISO */
15781577
struct node_rx_hdr *rx;
15791578
memq_link_t *link;
1579+
uint16_t handle;
15801580

15811581
do {
15821582
link = memq_peek(memq_ull_iso_rx.head, memq_ull_iso_rx.tail,
@@ -1596,14 +1596,35 @@ static void iso_rx_demux(void *param)
15961596
(void)memq_dequeue(memq_ull_iso_rx.tail, &memq_ull_iso_rx.head,
15971597
NULL);
15981598

1599-
#if defined(CONFIG_BT_CTLR_CONN_ISO)
16001599
rx_pdu = (struct node_rx_pdu *)rx;
1601-
cis = ll_conn_iso_stream_get(rx_pdu->hdr.handle);
1602-
cig = cis->group;
1603-
dp = cis->hdr.datapath_out;
1600+
handle = rx_pdu->hdr.handle;
1601+
dp = NULL;
16041602

1605-
iso_rx_cig_ref_point_update(cig, cis, &rx_pdu->hdr.rx_iso_meta);
1603+
if (false) {
1604+
#if defined(CONFIG_BT_CTLR_CONN_ISO)
1605+
} else if (IS_CIS_HANDLE(handle)) {
1606+
struct ll_conn_iso_stream *cis;
1607+
struct ll_conn_iso_group *cig;
1608+
1609+
cis = ll_conn_iso_stream_get(handle);
1610+
cig = cis->group;
1611+
dp = cis->hdr.datapath_out;
16061612

1613+
iso_rx_cig_ref_point_update(cig, cis,
1614+
&rx_pdu->hdr.rx_iso_meta);
1615+
#endif /* CONFIG_BT_CTLR_CONN_ISO */
1616+
#if defined(CONFIG_BT_CTLR_SYNC_ISO)
1617+
} else if (IS_SYNC_ISO_HANDLE(handle)) {
1618+
struct lll_sync_iso_stream *sync_stream;
1619+
uint16_t stream_handle;
1620+
1621+
stream_handle = LL_BIS_SYNC_IDX_FROM_HANDLE(handle);
1622+
sync_stream = ull_sync_iso_stream_get(stream_handle);
1623+
dp = sync_stream ? sync_stream->dp : NULL;
1624+
#endif /* CONFIG_BT_CTLR_SYNC_ISO */
1625+
}
1626+
1627+
#if defined(CONFIG_BT_CTLR_CONN_ISO) || defined(CONFIG_BT_CTLR_SYNC_ISO)
16071628
if (dp && dp->path_id != BT_HCI_DATAPATH_ID_HCI) {
16081629
/* If vendor specific datapath pass to ISO AL here,
16091630
* in case of HCI destination it will be passed in
@@ -1620,7 +1641,7 @@ static void iso_rx_demux(void *param)
16201641

16211642
LL_ASSERT(err == ISOAL_STATUS_OK); /* TODO handle err */
16221643
}
1623-
#endif /* CONFIG_BT_CTLR_CONN_ISO */
1644+
#endif /* CONFIG_BT_CTLR_CONN_ISO || CONFIG_BT_CTLR_SYNC_ISO */
16241645

16251646
/* Let ISO PDU start its long journey upwards */
16261647
ll_iso_rx_put(link, rx);

0 commit comments

Comments
 (0)