Bluetooth: controller: fixing CIS establish flow for refactored LLCP

Latest modification to LLCP removed 'monitoring' of cis->established
flag in LLCP, relying instead on signal through ULL.

For this to work properly the signal must also be generated, so this is
introduced. Note - checking of cis->established flag could be removed
if caller ensures only calling once (on establish condition)

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit is contained in:
Erik Brockhoff 2023-03-06 13:36:11 +01:00 committed by Alberto Escolar
parent 86ee761552
commit 1d8acfe5fa

View file

@ -296,15 +296,12 @@ void ull_conn_iso_lll_cis_established(struct lll_conn_iso_stream *cis_lll)
{
struct ll_conn_iso_stream *cis =
ll_conn_iso_stream_get(cis_lll->handle);
struct node_rx_pdu *node_rx;
if (cis->established) {
return;
}
#if defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
struct node_rx_conn_iso_estab *est;
struct node_rx_pdu *node_rx;
node_rx = ull_pdu_rx_alloc();
if (!node_rx) {
/* No node available - try again later */
@ -313,6 +310,8 @@ void ull_conn_iso_lll_cis_established(struct lll_conn_iso_stream *cis_lll)
node_rx->hdr.type = NODE_RX_TYPE_CIS_ESTABLISHED;
#if defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
struct node_rx_conn_iso_estab *est;
/* TODO: Send CIS_ESTABLISHED with status != 0 in error scenarios */
node_rx->hdr.handle = 0xFFFF;
node_rx->hdr.rx_ftr.param = cis;
@ -322,7 +321,12 @@ void ull_conn_iso_lll_cis_established(struct lll_conn_iso_stream *cis_lll)
est->cis_handle = cis_lll->handle;
ll_rx_put_sched(node_rx->hdr.link, node_rx);
#endif /* !CONFIG_BT_LL_SW_LLCP_LEGACY */
#else
/* Send node to ULL RX demuxer for triggering LLCP state machine */
node_rx->hdr.handle = cis->lll.acl_handle;
ull_rx_put_sched(node_rx->hdr.link, node_rx);
#endif /* defined(CONFIG_BT_LL_SW_LLCP_LEGACY) */
cis->established = 1;
}