Bluetooth: ISO: Fix CIG auto-allocation to select configurable CIG
authorPauli Virtanen <pav@iki.fi>
Sun, 21 May 2023 15:48:29 +0000 (15:48 +0000)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 6 Jun 2023 00:13:14 +0000 (17:13 -0700)
commite6a7a46b8636efe95c75bed63a57fc05c13feba4
treebc894afdb8266b2aee5e0118f8f813ad55bb3a7c
parent31c5f9164949347c9cb34f041a7e04fdc08b1b85
Bluetooth: ISO: Fix CIG auto-allocation to select configurable CIG

Make CIG auto-allocation to select the first CIG_ID that is still
configurable. Also use correct CIG_ID range (see Core v5.3 Vol 4 Part E
Sec 7.8.97 p.2553).

Previously, it would always select CIG_ID 0 regardless of anything,
because cis_list with data.cis == 0xff (BT_ISO_QOS_CIS_UNSET) would not
count any CIS. Since we are not adding CIS here, use find_cis instead.

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_conn.c