Commit 0b27981f authored by Vinayak Kariappa Chettimada's avatar Vinayak Kariappa Chettimada Committed by Alberto Escolar
Browse files

Bluetooth: Controller: Do not disconnect all CIS on MIC failure



Fix implementation to not disconnect all CIS when one
connection has MIC failure.

Signed-off-by: default avatarVinayak Kariappa Chettimada <vich@nordicsemi.no>
parent 25a39777
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -349,11 +349,18 @@ void ull_conn_iso_done(struct node_rx_event_done *done)

		if (cis->lll.active && cis->lll.handle != LLL_HANDLE_INVALID) {
			/* CIS was setup and is now expected to be going */
			if (done->extra.trx_performed_bitmask &
			    (1U << LL_CIS_IDX_FROM_HANDLE(cis->lll.handle))) {
				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_bitmask &
				     (1U << LL_CIS_IDX_FROM_HANDLE(cis->lll.handle)))) {
					/* 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 {
					cis->event_expire = 0U;
				}
			} else {
				/* We did NOT have successful transaction on established CIS,
				 * or CIS was not yet established, so handle timeout
				 */
@@ -381,8 +388,6 @@ void ull_conn_iso_done(struct node_rx_event_done *done)
							      BT_HCI_ERR_CONN_FAIL_TO_ESTAB);

				}
			} else {
				cis->event_expire = 0U;
			}
		}
	}