Commit 8f9de31f authored by Vinayak Kariappa Chettimada's avatar Vinayak Kariappa Chettimada Committed by Carles Cufi
Browse files

Bluetooth: controller: Initial integrate of ISOAL for Broadcast ISO



This is initial commit towards integration of ISOAL Rx for
Broadcast/Synchronized Receiver ISO support.

Signed-off-by: default avatarVinayak Kariappa Chettimada <vich@nordicsemi.no>
parent 7c8dc9fa
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -568,7 +568,7 @@ static void write_auth_payload_timeout(struct net_buf *buf,
}
#endif /* CONFIG_BT_CTLR_LE_PING */

#if defined(CONFIG_BT_CTLR_CONN_ISO)
#if defined(CONFIG_BT_CTLR_ISO)
static void configure_data_path(struct net_buf *buf,
				struct net_buf **evt)
{
@@ -588,7 +588,7 @@ static void configure_data_path(struct net_buf *buf,
	rp = hci_cmd_complete(evt, sizeof(*rp));
	rp->status = status;
}
#endif /* CONFIG_BT_CTLR_CONN_ISO */
#endif /* CONFIG_BT_CTLR_ISO */

#if defined(CONFIG_BT_CONN)
static void read_tx_power_level(struct net_buf *buf, struct net_buf **evt)
@@ -658,11 +658,11 @@ static int ctrl_bb_cmd_handle(uint16_t ocf, struct net_buf *cmd,
		break;
#endif /* CONFIG_BT_CTLR_LE_PING */

#if defined(CONFIG_BT_CTLR_CONN_ISO)
#if defined(CONFIG_BT_CTLR_ISO)
	case BT_OCF(BT_HCI_OP_CONFIGURE_DATA_PATH):
		configure_data_path(cmd, evt);
		break;
#endif /* CONFIG_BT_CTLR_CONN_ISO */
#endif /* CONFIG_BT_CTLR_ISO */

	default:
		return -EINVAL;
@@ -7423,7 +7423,7 @@ uint8_t hci_get_class(struct node_rx_pdu *node_rx)
#endif /* CONFIG_BT_CTLR_PHY */
			return HCI_CLASS_EVT_CONNECTION;
#endif /* CONFIG_BT_CONN */
#if defined(CONFIG_BT_CTLR_ISO)
#if defined(CONFIG_BT_CTLR_ADV_ISO) || defined(CONFIG_BT_CTLR_CONN_ISO)
		case NODE_RX_TYPE_ISO_PDU:
			return HCI_CLASS_ISO_DATA;
#endif
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <stdint.h>
#include <stdbool.h>

#include <toolchain.h>

static bool dummy;

bool ll_data_path_configured(uint8_t data_path_dir, uint8_t data_path_id)
{
	ARG_UNUSED(data_path_dir);
	ARG_UNUSED(data_path_id);

	return dummy;
}

uint8_t ll_configure_data_path(uint8_t data_path_dir, uint8_t data_path_id,
			       uint8_t vs_config_len, uint8_t *vs_config)
{
	ARG_UNUSED(data_path_dir);
	ARG_UNUSED(data_path_id);
	ARG_UNUSED(vs_config_len);
	ARG_UNUSED(vs_config);

	dummy = true;

	return 0;
}
+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ if(CONFIG_BT_LL_SW_SPLIT)
    CONFIG_BT_CTLR_PERIPHERAL_ISO
    ll_sw/nordic/lll/lll_peripheral_iso.c
    )
  if(CONFIG_BT_CTLR_ADV_ISO OR CONFIG_BT_CTLR_SYNC_ISO OR CONFIG_BT_CTLR_CONN_ISO)
    zephyr_library_sources(
      ll_sw/nordic/ull/ull_iso_vendor.c
      )
  endif()
endif()

zephyr_library_sources(
+9 −4
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@
#if defined(CONFIG_BT_CTLR_CONN_ISO_STREAMS)
/* Allocate data path pools for RX/TX directions for each stream */
static struct ll_iso_datapath datapath_pool[2*CONFIG_BT_CTLR_CONN_ISO_STREAMS];
#endif
static void *datapath_free;
#endif

static int init_reset(void);

@@ -128,11 +128,13 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
	 * shall return the error code Unknown Connection Identifier (0x02)
	 */
#if defined(CONFIG_BT_CTLR_CONN_ISO)
	struct ll_conn_iso_stream *cis = ll_conn_iso_stream_get(handle);
	struct ll_conn_iso_group *cig;
	isoal_sink_handle_t sink_hdl;
	isoal_status_t err = 0;

	struct ll_conn_iso_stream *cis = ll_conn_iso_stream_get(handle);
	struct ll_conn_iso_group *cig;
	cis = ll_conn_iso_stream_get(handle);
	/* TODO: Check valid cis */

	cig = cis->group;

@@ -144,6 +146,7 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
		return BT_HCI_ERR_CMD_DISALLOWED;
	}
#endif

	if (path_is_vendor_specific(path_id) &&
	    !ll_data_path_configured(path_dir, path_id)) {
		/* Data path must be configured prior to setup */
@@ -158,9 +161,12 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,
		return BT_HCI_ERR_INVALID_PARAM;
	}

#if defined(CONFIG_BT_CTLR_CONN_ISO)
	/* Allocate and configure datapath */
	struct ll_iso_datapath *dp = mem_acquire(&datapath_free);

	/* TODO: check valid dp buffer */

	dp->path_dir      = path_dir;
	dp->path_id       = path_id;
	dp->coding_format = coding_format;
@@ -168,7 +174,6 @@ uint8_t ll_setup_iso_path(uint16_t handle, uint8_t path_dir, uint8_t path_id,

	/* TODO dp->sync_delay    = controller_delay; ?*/

#if defined(CONFIG_BT_CTLR_CONN_ISO)
	uint32_t sdu_interval;
	uint8_t burst_number;