Bluetooth: controller: Wait for accept/reject from host for LL_CIS_RSP

Wait until host has accepted/rejected a CIS before responding with
LL_CIS_RSP.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
This commit is contained in:
Wolfgang Puffitsch 2021-10-04 15:34:54 +02:00 committed by Christopher Friedt
commit b56310d4d4

View file

@ -192,6 +192,9 @@ static uint8_t force_md_cnt_calc(struct lll_conn *lll_conn, uint32_t tx_rate);
#define TERM_REQ 1
#define TERM_ACKED 3
/* CIS Establishment procedure state values */
#define CIS_REQUEST_AWAIT_HOST 2
static MFIFO_DEFINE(conn_tx, sizeof(struct lll_tx), CONFIG_BT_BUF_ACL_TX_COUNT);
static MFIFO_DEFINE(conn_ack, sizeof(struct lll_tx),
(CONFIG_BT_BUF_ACL_TX_COUNT + CONN_TX_CTRL_BUFFERS));
@ -5955,6 +5958,11 @@ void event_send_cis_rsp(struct ll_conn *conn)
{
struct node_tx *tx;
/* If waiting for accept/reject from host, do nothing */
if (((conn->llcp_cis.req - conn->llcp_cis.ack) & 0xFF) == CIS_REQUEST_AWAIT_HOST) {
return;
}
tx = mem_acquire(&mem_conn_tx_ctrl.free);
if (tx) {
struct pdu_data *pdu = (void *)tx->pdu;