From 90d0d93a9c64c11f3d0b587f2b6ca620907f6e43 Mon Sep 17 00:00:00 2001 From: Morten Priess Date: Thu, 29 Sep 2022 15:42:31 +0200 Subject: [PATCH] Bluetooth: controller: Fix missing CIS disconnect on MIC failure Disconnect CIS immediately if event done extra status indicates MIC failure. Return reason BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL. Fixes EBQ test /LL/CIS/PER/BV-27-C. Signed-off-by: Morten Priess --- subsys/bluetooth/controller/ll_sw/ull_conn_iso.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c index 9602cadf551..e4f24cabd2f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_iso.c @@ -314,7 +314,10 @@ void ull_conn_iso_done(struct node_rx_event_done *done) if (cis->lll.handle != LLL_HANDLE_INVALID) { /* CIS was setup and is now expected to be going */ - if (!(done->extra.trx_performed_mask & + if (done->extra.mic_state == LLL_CONN_MIC_FAIL) { + /* MIC failure - stop CIS and defer cleanup to after teardown. */ + ull_conn_iso_cis_stop(cis, NULL, BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL); + } else if (!(done->extra.trx_performed_mask & (1U << LL_CIS_IDX_FROM_HANDLE(cis->lll.handle)))) { /* We did NOT have successful transaction on established CIS, * or CIS was not yet established, so handle timeout