Bluetooth: Controller: ISO: Fix issue with removing peripheral data paths

On CIS disconnect, the peripheral will clear all data paths.

However ll_remove_iso_path will fail if attempting to remove a
data path that has not been setup, so if only the CTLR_TO_HOST
direction was set, and the HOST_TO_CTLR bit was set, the
function returned an error and never attempted to clear the other
direction.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2023-05-31 15:39:46 +02:00 committed by Carles Cufí
parent ccfbac8b07
commit e31713de27

View File

@ -1090,11 +1090,13 @@ static void cis_disabled_cb(void *param)
if (IS_PERIPHERAL(cig)) {
/* Remove data path and ISOAL sink/source associated with this
* CIS for both directions.
* CIS for both directions. Disable them one at a time to make sure
* both are removed, even if only one is set.
*/
ll_remove_iso_path(cis->lll.handle,
BIT(BT_HCI_DATAPATH_DIR_CTLR_TO_HOST) |
BIT(BT_HCI_DATAPATH_DIR_HOST_TO_CTLR));
ll_remove_iso_path(cis->lll.handle,
BIT(BT_HCI_DATAPATH_DIR_CTLR_TO_HOST));
ll_conn_iso_stream_release(cis);