From 22ddc01f3680f155e209a11a8ae05d82b13f7f41 Mon Sep 17 00:00:00 2001 From: Erik Brockhoff Date: Wed, 6 Jul 2022 15:55:16 +0200 Subject: [PATCH] bluetooth: controller: CIS Terminate Procedure PDU flow and unittest Implementing PDU flow and unittest for PDU flow of CIS Terminate. Signed-off-by: Erik Brockhoff --- subsys/bluetooth/controller/ll_sw/ull_adv.c | 7 +- .../bluetooth/controller/ll_sw/ull_central.c | 7 +- subsys/bluetooth/controller/ll_sw/ull_df.c | 4 + subsys/bluetooth/controller/ll_sw/ull_llcp.c | 37 ++++ subsys/bluetooth/controller/ll_sw/ull_llcp.h | 6 + .../controller/ll_sw/ull_llcp_chmu.c | 7 + .../controller/ll_sw/ull_llcp_common.c | 50 ++++++ .../controller/ll_sw/ull_llcp_conn_upd.c | 8 + .../bluetooth/controller/ll_sw/ull_llcp_enc.c | 6 + .../controller/ll_sw/ull_llcp_internal.h | 12 +- .../controller/ll_sw/ull_llcp_local.c | 15 ++ .../bluetooth/controller/ll_sw/ull_llcp_pdu.c | 29 ++++ .../bluetooth/controller/ll_sw/ull_llcp_phy.c | 6 + .../controller/ll_sw/ull_llcp_remote.c | 21 ++- .../controller/ll_sw/ull_peripheral.c | 7 +- .../controller/common/include/helper_pdu.h | 5 + .../controller/common/src/helper_pdu.c | 39 +++++ .../controller/common/src/helper_util.c | 12 ++ .../bluetooth/controller/ctrl_api/src/main.c | 5 + .../bluetooth/controller/ctrl_chmu/src/main.c | 5 + .../ctrl_cis_terminate/CMakeLists.txt | 16 ++ .../controller/ctrl_cis_terminate/src/main.c | 159 ++++++++++++++++++ .../ctrl_cis_terminate/testcase.yaml | 5 + .../controller/ctrl_collision/src/main.c | 4 + .../controller/ctrl_conn_update/src/main.c | 5 + .../controller/ctrl_cte_req/src/main.c | 5 + .../ctrl_data_length_update/src/main.c | 5 + .../controller/ctrl_encrypt/src/main.c | 5 + .../ctrl_feature_exchange/src/main.c | 4 + .../ctrl_feature_exchange/src/main_hci.c | 6 + .../controller/ctrl_invalid/src/main.c | 5 + .../controller/ctrl_le_ping/src/main.c | 5 + .../controller/ctrl_min_used_chans/src/main.c | 5 + .../controller/ctrl_phy_update/src/main.c | 5 + .../controller/ctrl_terminate/src/main.c | 5 + .../ctrl_tx_buffer_alloc/src/main.c | 5 + .../controller/ctrl_unsupported/src/main.c | 5 + .../controller/ctrl_version/src/main.c | 6 + .../bluetooth/controller/mock_ctrl/src/lll.c | 5 + 39 files changed, 542 insertions(+), 6 deletions(-) create mode 100644 tests/bluetooth/controller/ctrl_cis_terminate/CMakeLists.txt create mode 100644 tests/bluetooth/controller/ctrl_cis_terminate/src/main.c create mode 100644 tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv.c b/subsys/bluetooth/controller/ll_sw/ull_adv.c index 042c9b8e17f..a297fb102c9 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv.c @@ -38,6 +38,7 @@ #include "lll/lll_df_types.h" #include "lll_conn.h" #include "lll_filter.h" +#include "lll_conn_iso.h" #if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY) #include "ll_sw/ull_tx_queue.h" @@ -58,7 +59,11 @@ #include "ll_settings.h" #if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY) -#include "ll_sw/ull_llcp.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + +#include "ull_llcp.h" #endif /* !CONFIG_BT_LL_SW_LLCP_LEGACY */ #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) diff --git a/subsys/bluetooth/controller/ll_sw/ull_central.c b/subsys/bluetooth/controller/ll_sw/ull_central.c index 725bd2e17e0..4ea584d9b69 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_central.c +++ b/subsys/bluetooth/controller/ll_sw/ull_central.c @@ -36,6 +36,7 @@ #include "lll_conn.h" #include "lll_central.h" #include "lll_filter.h" +#include "lll_conn_iso.h" #if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY) #include "ull_tx_queue.h" @@ -57,7 +58,11 @@ #include "ll_settings.h" #if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY) -#include "ll_sw/ull_llcp.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + +#include "ull_llcp.h" #endif /* !CONFIG_BT_LL_SW_LLCP_LEGACY */ #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) diff --git a/subsys/bluetooth/controller/ll_sw/ull_df.c b/subsys/bluetooth/controller/ll_sw/ull_df.c index 09f77d15c39..b066fb2b5ff 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_df.c +++ b/subsys/bluetooth/controller/ll_sw/ull_df.c @@ -29,15 +29,19 @@ #include "lll/lll_df_types.h" #include "lll_sync.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "lll_df.h" #include "lll/lll_df_internal.h" +#include "isoal.h" #include "ull_scan_types.h" #include "ull_sync_types.h" #include "ull_sync_internal.h" #include "ull_adv_types.h" #include "ull_tx_queue.h" #include "ull_conn_types.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_internal.h" #include "ull_df_types.h" #include "ull_df_internal.h" diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp.c b/subsys/bluetooth/controller/ll_sw/ull_llcp.c index 55a0a6f281e..03cd271c789 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp.c @@ -26,9 +26,15 @@ #include "lll.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_internal.h" #include "ull_conn_types.h" #include "ull_conn_internal.h" @@ -358,6 +364,9 @@ struct proc_ctx *llcp_create_local_procedure(enum llcp_proc proc) llcp_lp_comm_init_proc(ctx); break; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ + case PROC_CIS_TERMINATE: + llcp_lp_comm_init_proc(ctx); + break; default: /* Unknown procedure */ LL_ASSERT(0); @@ -429,6 +438,9 @@ struct proc_ctx *llcp_create_remote_procedure(enum llcp_proc proc) llcp_rp_comm_init_proc(ctx); break; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ + case PROC_CIS_TERMINATE: + llcp_rp_comm_init_proc(ctx); + break; default: /* Unknown procedure */ LL_ASSERT(0); @@ -801,6 +813,31 @@ uint8_t ull_cp_terminate(struct ll_conn *conn, uint8_t error_code) return BT_HCI_ERR_SUCCESS; } +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) +uint8_t ull_cp_cis_terminate(struct ll_conn *conn, + struct ll_conn_iso_stream *cis, + uint8_t error_code) +{ + struct proc_ctx *ctx; + + if (conn->lll.handle != cis->lll.acl_handle) { + return BT_HCI_ERR_CMD_DISALLOWED; + } + + ctx = llcp_create_local_procedure(PROC_CIS_TERMINATE); + if (!ctx) { + return BT_HCI_ERR_CMD_DISALLOWED; + } + + ctx->data.cis_term.cig_id = cis->group->cig_id; + ctx->data.cis_term.cis_id = cis->cis_id; + ctx->data.cis_term.error_code = error_code; + + llcp_lr_enqueue(conn, ctx); + + return BT_HCI_ERR_SUCCESS; +} +#endif /* defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) */ #if defined(CONFIG_BT_CENTRAL) uint8_t ull_cp_chan_map_update(struct ll_conn *conn, const uint8_t chm[5]) diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp.h b/subsys/bluetooth/controller/ll_sw/ull_llcp.h index 8216c2fcd32..69233575152 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp.h +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp.h @@ -152,6 +152,12 @@ uint8_t ull_cp_remote_cpr_pending(struct ll_conn *conn); */ uint8_t ull_cp_terminate(struct ll_conn *conn, uint8_t error_code); +/** + * @brief Initiate a CIS Termination Procedure. + */ +uint8_t ull_cp_cis_terminate(struct ll_conn *conn, struct ll_conn_iso_stream *cis, + uint8_t error_code); + /** * @brief Initiate a Channel Map Update Procedure. */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c index 12c1f752732..4f87d70760f 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_chmu.c @@ -25,8 +25,15 @@ #include "lll.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_llcp_internal.h" diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c index ccced24e4f1..8d90ca513d2 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c @@ -26,9 +26,15 @@ #include "ll_feat.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_types.h" #include "ull_chan_internal.h" #include "ull_llcp.h" @@ -141,6 +147,13 @@ static void lp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx) ctx->tx_ack = tx; ctx->rx_opcode = PDU_DATA_LLCTRL_TYPE_UNUSED; break; +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + case PROC_CIS_TERMINATE: + llcp_pdu_encode_cis_terminate_ind(ctx, pdu); + ctx->tx_ack = tx; + ctx->rx_opcode = PDU_DATA_LLCTRL_TYPE_UNUSED; + break; +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ #if defined(CONFIG_BT_CTLR_DATA_LENGTH) case PROC_DATA_LENGTH_UPDATE: llcp_pdu_encode_length_req(conn, pdu); @@ -415,6 +428,16 @@ static void lp_comm_complete(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t /* Mark the connection for termination */ conn->llcp_terminate.reason_final = BT_HCI_ERR_LOCALHOST_TERM_CONN; break; +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + case PROC_CIS_TERMINATE: + /* No notification */ + llcp_lr_complete(conn); + ctx->state = LP_COMMON_STATE_IDLE; + + /* Handle CIS termination */ + /* TODO: Do termination */ + break; +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ #if defined(CONFIG_BT_CTLR_DATA_LENGTH) case PROC_DATA_LENGTH_UPDATE: if (ctx->response_opcode == PDU_DATA_LLCTRL_TYPE_LENGTH_RSP) { @@ -520,6 +543,16 @@ static void lp_comm_send_req(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t ctx->state = LP_COMMON_STATE_WAIT_TX_ACK; } break; +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + case PROC_CIS_TERMINATE: + if (ctx->pause || !llcp_tx_alloc_peek(conn, ctx)) { + ctx->state = LP_COMMON_STATE_WAIT_TX; + } else { + lp_comm_tx(conn, ctx); + ctx->state = LP_COMMON_STATE_WAIT_TX_ACK; + } + break; +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ #if defined(CONFIG_BT_CTLR_DATA_LENGTH) case PROC_DATA_LENGTH_UPDATE: if (!ull_cp_remote_dle_pending(conn)) { @@ -624,6 +657,12 @@ static void lp_comm_st_wait_tx_ack(struct ll_conn *conn, struct proc_ctx *ctx, u ctx->tx_ack = NULL; lp_comm_complete(conn, ctx, evt, param); break; +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + case PROC_CIS_TERMINATE: + ctx->tx_ack = NULL; + lp_comm_complete(conn, ctx, evt, param); + break; +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ default: /* Ignore for other procedures */ break; @@ -835,6 +874,9 @@ static void rp_comm_rx_decode(struct ll_conn *conn, struct proc_ctx *ctx, struct /* Make sure no data is tx'ed after RX of terminate ind */ llcp_tx_pause_data(conn, LLCP_TX_QUEUE_PAUSE_DATA_TERMINATE); break; + case PDU_DATA_LLCTRL_TYPE_CIS_TERMINATE_IND: + llcp_pdu_decode_cis_terminate_ind(ctx, pdu); + break; #if defined(CONFIG_BT_CTLR_DATA_LENGTH) case PDU_DATA_LLCTRL_TYPE_LENGTH_REQ: llcp_pdu_decode_length_req(conn, pdu); @@ -1080,6 +1122,14 @@ static void rp_comm_send_rsp(struct ll_conn *conn, struct proc_ctx *ctx, uint8_t rp_comm_terminate(conn, ctx); #endif break; +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + case PROC_CIS_TERMINATE: + /* No response */ + llcp_rr_complete(conn); + ctx->state = RP_COMMON_STATE_IDLE; + + break; +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ #if defined(CONFIG_BT_CTLR_DATA_LENGTH) case PROC_DATA_LENGTH_UPDATE: if (llcp_rr_ispaused(conn) || !llcp_tx_alloc_peek(conn, ctx)) { diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c index b92750a3e01..d6f93675c23 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_conn_upd.c @@ -27,7 +27,15 @@ #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" + #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_internal.h" #include "ull_conn_types.h" #include "ull_internal.h" diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c index ded5f4af244..14b17d666d4 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_enc.c @@ -27,9 +27,15 @@ #include "lll.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_types.h" #include "ull_internal.h" #include "ull_llcp.h" diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h b/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h index 347b000adc4..69ca8485122 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_internal.h @@ -26,9 +26,11 @@ enum llcp_proc { PROC_CHAN_MAP_UPDATE, PROC_DATA_LENGTH_UPDATE, PROC_CTE_REQ, + PROC_CIS_TERMINATE, /* A helper enum entry, to use in pause procedure context */ PROC_NONE = 0x0, }; + enum llcp_tx_q_pause_data_mask { LLCP_TX_QUEUE_PAUSE_DATA_ENCRYPTION = 0x01, LLCP_TX_QUEUE_PAUSE_DATA_PHY_UPDATE = 0x02, @@ -240,7 +242,6 @@ struct proc_ctx { uint8_t has_cte; } cte_remote_rsp; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ - #if defined(CONFIG_BT_CTLR_DF_CONN_CTE_RSP) /* Use by CTE Response Procedure */ struct llcp_df_cte_remote_req { @@ -248,7 +249,11 @@ struct proc_ctx { uint8_t min_cte_len; } cte_remote_req; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */ - + struct { + uint8_t cig_id; + uint8_t cis_id; + uint8_t error_code; + } cis_term; } data; struct { @@ -637,6 +642,9 @@ void llcp_pdu_decode_cte_req(struct proc_ctx *ctx, struct pdu_data *pdu); void llcp_pdu_encode_cte_rsp(const struct proc_ctx *ctx, struct pdu_data *pdu); #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */ +void llcp_pdu_encode_cis_terminate_ind(struct proc_ctx *ctx, struct pdu_data *pdu); +void llcp_pdu_decode_cis_terminate_ind(struct proc_ctx *ctx, struct pdu_data *pdu); + #ifdef ZTEST_UNITTEST bool lr_is_disconnected(struct ll_conn *conn); bool lr_is_idle(struct ll_conn *conn); diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c index 67e94327f06..4d5a9d1c4c0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_local.c @@ -25,9 +25,15 @@ #include "lll.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_llcp_internal.h" @@ -190,6 +196,9 @@ void llcp_lr_rx(struct ll_conn *conn, struct proc_ctx *ctx, struct node_rx_pdu * llcp_lp_comm_rx(conn, ctx, rx); break; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ + case PROC_CIS_TERMINATE: + llcp_lp_comm_rx(conn, ctx, rx); + break; default: /* Unknown procedure */ LL_ASSERT(0); @@ -220,6 +229,9 @@ void llcp_lr_tx_ack(struct ll_conn *conn, struct proc_ctx *ctx, struct node_tx * llcp_lp_pu_tx_ack(conn, ctx, tx); break; #endif /* CONFIG_BT_CTLR_PHY */ + case PROC_CIS_TERMINATE: + llcp_lp_comm_tx_ack(conn, ctx, tx); + break; default: break; /* Ignore tx_ack */ @@ -284,6 +296,9 @@ static void lr_act_run(struct ll_conn *conn) llcp_lp_comm_run(conn, ctx, NULL); break; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ + case PROC_CIS_TERMINATE: + llcp_lp_comm_run(conn, ctx, NULL); + break; default: /* Unknown procedure */ LL_ASSERT(0); diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_pdu.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_pdu.c index 26c0c03c053..503d7d09213 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_pdu.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_pdu.c @@ -25,9 +25,15 @@ #include "lll.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_llcp_internal.h" @@ -828,3 +834,26 @@ void llcp_pdu_encode_cte_rsp(const struct proc_ctx *ctx, struct pdu_data *pdu) pdu->cte_info.type = ctx->data.cte_remote_req.cte_type; } #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */ + +void llcp_pdu_encode_cis_terminate_ind(struct proc_ctx *ctx, struct pdu_data *pdu) +{ + struct pdu_data_llctrl_cis_terminate_ind *p; + + pdu->ll_id = PDU_DATA_LLID_CTRL; + pdu->len = + offsetof(struct pdu_data_llctrl, cis_terminate_ind) + + sizeof(struct pdu_data_llctrl_cis_terminate_ind); + pdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CIS_TERMINATE_IND; + + p = &pdu->llctrl.cis_terminate_ind; + p->cig_id = ctx->data.cis_term.cig_id; + p->cis_id = ctx->data.cis_term.cis_id; + p->error_code = ctx->data.cis_term.error_code; +} + +void llcp_pdu_decode_cis_terminate_ind(struct proc_ctx *ctx, struct pdu_data *pdu) +{ + ctx->data.cis_term.cig_id = pdu->llctrl.cis_terminate_ind.cig_id; + ctx->data.cis_term.cis_id = pdu->llctrl.cis_terminate_ind.cis_id; + ctx->data.cis_term.error_code = pdu->llctrl.cis_terminate_ind.error_code; +} diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c index 60b78f7eaed..0757ffc4748 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_phy.c @@ -26,9 +26,15 @@ #include "ll_feat.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_types.h" #include "ull_internal.h" #include "ull_llcp.h" diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c index b42e45e8b31..891ae1e0471 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c @@ -26,9 +26,15 @@ #include "lll.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" + #include "ull_conn_types.h" #include "ull_conn_internal.h" #include "ull_llcp.h" @@ -86,6 +92,7 @@ static bool proc_with_instant(struct proc_ctx *ctx) case PROC_TERMINATE: case PROC_DATA_LENGTH_UPDATE: case PROC_CTE_REQ: + case PROC_CIS_TERMINATE: return 0U; case PROC_PHY_UPDATE: case PROC_CONN_UPDATE: @@ -260,6 +267,11 @@ void llcp_rr_rx(struct ll_conn *conn, struct proc_ctx *ctx, struct node_rx_pdu * llcp_rp_comm_rx(conn, ctx, rx); break; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */ +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + case PROC_CIS_TERMINATE: + llcp_rp_comm_rx(conn, ctx, rx); + break; +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ default: /* Unknown procedure */ LL_ASSERT(0); @@ -350,6 +362,11 @@ static void rr_act_run(struct ll_conn *conn) llcp_rp_comm_run(conn, ctx, NULL); break; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */ +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + case PROC_CIS_TERMINATE: + llcp_rp_comm_run(conn, ctx, NULL); + break; +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ default: /* Unknown procedure */ LL_ASSERT(0); @@ -776,6 +793,9 @@ static const struct proc_role new_proc_lut[] = { [PDU_DATA_LLCTRL_TYPE_CTE_REQ] = { PROC_CTE_REQ, ACCEPT_ROLE_BOTH }, #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */ [PDU_DATA_LLCTRL_TYPE_CTE_RSP] = { PROC_UNKNOWN, ACCEPT_ROLE_NONE }, +#if defined(CONFIG_BT_CTLR_CENTRAL_ISO) || defined(CONFIG_BT_CTLR_PERIPHERAL_ISO) + [PDU_DATA_LLCTRL_TYPE_CIS_TERMINATE_IND] = { PROC_CIS_TERMINATE, ACCEPT_ROLE_BOTH }, +#endif /* CONFIG_BT_CTLR_CENTRAL_ISO || CONFIG_BT_CTLR_PERIPHERAL_ISO */ }; void llcp_rr_new(struct ll_conn *conn, struct node_rx_pdu *rx, bool valid_pdu) @@ -786,7 +806,6 @@ void llcp_rr_new(struct ll_conn *conn, struct node_rx_pdu *rx, bool valid_pdu) pdu = (struct pdu_data *)rx->pdu; - /* Is this a valid opcode */ if (valid_pdu && pdu->llctrl.opcode < ARRAY_SIZE(new_proc_lut)) { /* Lookup procedure */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_peripheral.c b/subsys/bluetooth/controller/ll_sw/ull_peripheral.c index 9dbd1ee58cc..d48093df3cd 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_peripheral.c +++ b/subsys/bluetooth/controller/ll_sw/ull_peripheral.c @@ -35,6 +35,7 @@ #include "lll_conn.h" #include "lll_peripheral.h" #include "lll_filter.h" +#include "lll_conn_iso.h" #if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY) #include "ull_tx_queue.h" @@ -52,7 +53,11 @@ #include "ll.h" #if (!defined(CONFIG_BT_LL_SW_LLCP_LEGACY)) -#include "ll_sw/ull_llcp.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + +#include "ull_llcp.h" #endif #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) diff --git a/tests/bluetooth/controller/common/include/helper_pdu.h b/tests/bluetooth/controller/common/include/helper_pdu.h index 4905212aad1..bcc2e1e8717 100644 --- a/tests/bluetooth/controller/common/include/helper_pdu.h +++ b/tests/bluetooth/controller/common/include/helper_pdu.h @@ -53,6 +53,7 @@ void helper_pdu_encode_cte_rsp(struct pdu_data *pdu, void *param); void helper_node_encode_cte_rsp(struct node_rx_pdu *rx, void *param); void helper_pdu_encode_zero(struct pdu_data *pdu, void *param); +void helper_pdu_encode_cis_terminate_ind(struct pdu_data *pdu, void *param); void helper_pdu_verify_ping_req(const char *file, uint32_t line, struct pdu_data *pdu, void *param); void helper_pdu_verify_ping_rsp(const char *file, uint32_t line, struct pdu_data *pdu, void *param); @@ -134,6 +135,9 @@ void helper_node_verify_cte_rsp(const char *file, uint32_t line, struct node_rx_ void helper_pdu_ntf_verify_cte_rsp(const char *file, uint32_t line, struct pdu_data *pdu, void *param); +void helper_pdu_verify_cis_terminate_ind(const char *file, uint32_t line, struct pdu_data *pdu, + void *param); + enum helper_pdu_opcode { LL_VERSION_IND, LL_LE_PING_REQ, @@ -163,6 +167,7 @@ enum helper_pdu_opcode { LL_LENGTH_RSP, LL_CTE_REQ, LL_CTE_RSP, + LL_CIS_TERMINATE_IND, LL_ZERO, }; diff --git a/tests/bluetooth/controller/common/src/helper_pdu.c b/tests/bluetooth/controller/common/src/helper_pdu.c index a931c479411..2f12e4e83f4 100644 --- a/tests/bluetooth/controller/common/src/helper_pdu.c +++ b/tests/bluetooth/controller/common/src/helper_pdu.c @@ -27,9 +27,14 @@ #include "lll.h" #include "lll_df_types.h" +#include "lll_conn_iso.h" + #include "lll_conn.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" #include "ull_conn_types.h" +#include "ull_conn_iso_types.h" #include "ull_llcp.h" @@ -402,6 +407,19 @@ void helper_node_encode_cte_rsp(struct node_rx_pdu *rx, void *param) rx->hdr.rx_ftr.iq_report = (struct cte_conn_iq_report *)param; } +void helper_pdu_encode_cis_terminate_ind(struct pdu_data *pdu, void *param) +{ + struct pdu_data_llctrl_cis_terminate_ind *p = param; + + pdu->ll_id = PDU_DATA_LLID_CTRL; + pdu->len = offsetof(struct pdu_data_llctrl, cis_terminate_ind) + + sizeof(struct pdu_data_llctrl_cis_terminate_ind); + pdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CIS_TERMINATE_IND; + pdu->llctrl.cis_terminate_ind.cig_id = p->cig_id; + pdu->llctrl.cis_terminate_ind.cis_id = p->cis_id; + pdu->llctrl.cis_terminate_ind.error_code = p->error_code; +} + void helper_pdu_verify_version_ind(const char *file, uint32_t line, struct pdu_data *pdu, void *param) { @@ -964,3 +982,24 @@ void helper_pdu_ntf_verify_cte_rsp(const char *file, uint32_t line, struct pdu_d zassert_equal(pdu->llctrl.opcode, PDU_DATA_LLCTRL_TYPE_CTE_RSP, "Not a LL_CTE_RSP. Called at %s:%d\n", file, line); } + +void helper_pdu_verify_cis_terminate_ind(const char *file, uint32_t line, struct pdu_data *pdu, + void *param) +{ + struct pdu_data_llctrl_cis_terminate_ind *p = param; + + zassert_equal(pdu->ll_id, PDU_DATA_LLID_CTRL, "Not a Control PDU.\nCalled at %s:%d\n", file, + line); + zassert_equal(pdu->len, + offsetof(struct pdu_data_llctrl, cis_terminate_ind) + + sizeof(struct pdu_data_llctrl_cis_terminate_ind), + "Wrong length.\nCalled at %s:%d\n", file, line); + zassert_equal(pdu->llctrl.opcode, PDU_DATA_LLCTRL_TYPE_CIS_TERMINATE_IND, + "Not a LL_CIS_TERMINATE_IND.\nCalled at %s:%d\n", file, line); + zassert_equal(pdu->llctrl.cis_terminate_ind.cig_id, p->cig_id, + "CIG ID mismatch.\nCalled at %s:%d\n", file, line); + zassert_equal(pdu->llctrl.cis_terminate_ind.cis_id, p->cis_id, + "CIS ID mismatch.\nCalled at %s:%d\n", file, line); + zassert_equal(pdu->llctrl.cis_terminate_ind.error_code, p->error_code, + "Error code mismatch.\nCalled at %s:%d\n", file, line); +} diff --git a/tests/bluetooth/controller/common/src/helper_util.c b/tests/bluetooth/controller/common/src/helper_util.c index a2a6fb2e5a9..1c51e88cf31 100644 --- a/tests/bluetooth/controller/common/src/helper_util.c +++ b/tests/bluetooth/controller/common/src/helper_util.c @@ -28,7 +28,14 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" + #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_iso_internal.h" #include "ull_conn_types.h" #include "ull_conn_internal.h" @@ -80,6 +87,7 @@ helper_pdu_encode_func_t *const helper_pdu_encode[] = { [LL_LENGTH_RSP] = helper_pdu_encode_length_rsp, [LL_CTE_REQ] = helper_pdu_encode_cte_req, [LL_CTE_RSP] = helper_pdu_encode_cte_rsp, + [LL_CIS_TERMINATE_IND] = helper_pdu_encode_cis_terminate_ind, [LL_ZERO] = helper_pdu_encode_zero, }; @@ -112,6 +120,7 @@ helper_pdu_verify_func_t *const helper_pdu_verify[] = { [LL_LENGTH_RSP] = helper_pdu_verify_length_rsp, [LL_CTE_REQ] = helper_pdu_verify_cte_req, [LL_CTE_RSP] = helper_pdu_verify_cte_rsp, + [LL_CIS_TERMINATE_IND] = helper_pdu_verify_cis_terminate_ind, }; helper_pdu_ntf_verify_func_t *const helper_pdu_ntf_verify[] = { @@ -141,6 +150,8 @@ helper_pdu_ntf_verify_func_t *const helper_pdu_ntf_verify[] = { [LL_LENGTH_RSP] = NULL, [LL_CTE_REQ] = NULL, [LL_CTE_RSP] = helper_pdu_ntf_verify_cte_rsp, + [LL_CTE_RSP] = NULL, + [LL_CIS_TERMINATE_IND] = NULL, }; helper_node_encode_func_t *const helper_node_encode[] = { @@ -168,6 +179,7 @@ helper_node_encode_func_t *const helper_node_encode[] = { [LL_CHAN_MAP_UPDATE_IND] = NULL, [LL_CTE_REQ] = NULL, [LL_CTE_RSP] = helper_node_encode_cte_rsp, + [LL_CIS_TERMINATE_IND] = NULL, }; helper_node_verify_func_t *const helper_node_verify[] = { diff --git a/tests/bluetooth/controller/ctrl_api/src/main.c b/tests/bluetooth/controller/ctrl_api/src/main.c index bc99549fa2e..bbe4c5b47a9 100644 --- a/tests/bluetooth/controller/ctrl_api/src/main.c +++ b/tests/bluetooth/controller/ctrl_api/src/main.c @@ -27,8 +27,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_llcp_internal.h" diff --git a/tests/bluetooth/controller/ctrl_chmu/src/main.c b/tests/bluetooth/controller/ctrl_chmu/src/main.c index c9fe5ee579b..99c60eea1a2 100644 --- a/tests/bluetooth/controller/ctrl_chmu/src/main.c +++ b/tests/bluetooth/controller/ctrl_chmu/src/main.c @@ -28,8 +28,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/CMakeLists.txt b/tests/bluetooth/controller/ctrl_cis_terminate/CMakeLists.txt new file mode 100644 index 00000000000..0bc561e8db4 --- /dev/null +++ b/tests/bluetooth/controller/ctrl_cis_terminate/CMakeLists.txt @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.13.1) + +if (NOT BOARD STREQUAL unit_testing) + message(FATAL_ERROR "This project can only be used with '-DBOARD=unit_testing'.") +endif() + +FILE(GLOB SOURCES + src/*.c +) + +project(bluetooth_ull_llcp_cis_terminate) +find_package(ZephyrUnittest HINTS $ENV{ZEPHYR_BASE}) +include(${ZEPHYR_BASE}/tests/bluetooth/controller/common/defaults_cmake.txt) +target_sources(testbinary PRIVATE ${ll_sw_sources} ${mock_sources} ${common_sources}) diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/src/main.c b/tests/bluetooth/controller/ctrl_cis_terminate/src/main.c new file mode 100644 index 00000000000..e22a4505df4 --- /dev/null +++ b/tests/bluetooth/controller/ctrl_cis_terminate/src/main.c @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2022 Demant + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "kconfig.h" + +#include +#include +#include +#include +#include "hal/ccm.h" + +#include "util/util.h" +#include "util/mem.h" +#include "util/memq.h" +#include "util/dbuf.h" + +#include "pdu.h" +#include "ll.h" +#include "ll_settings.h" + +#include "lll.h" +#include "lll_df_types.h" +#include "lll_conn.h" +#include "lll_conn_iso.h" + +#include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" +#include "ull_conn_types.h" +#include "ull_llcp.h" +#include "ull_conn_internal.h" +#include "ull_llcp_internal.h" + +#include "helper_pdu.h" +#include "helper_util.h" + +struct ll_conn conn; + +static void setup(void) +{ + test_setup(&conn); +} + +static void test_cis_terminate_rem(uint8_t role) +{ + struct pdu_data_llctrl_cis_terminate_ind remote_cis_terminate_ind; + + /* Role */ + test_set_role(&conn, role); + + /* Connect */ + ull_cp_state_set(&conn, ULL_CP_CONNECTED); + + /* Prepare */ + event_prepare(&conn); + + /* Rx */ + lt_tx(LL_CIS_TERMINATE_IND, &conn, &remote_cis_terminate_ind); + + /* Done */ + event_done(&conn); + + /* There should be no host notification */ + ut_rx_q_is_empty(); + + zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", ctx_buffers_free()); +} + +void test_cis_terminate_cen_rem(void) +{ + test_cis_terminate_rem(BT_HCI_ROLE_CENTRAL); +} + +void test_cis_terminate_per_rem(void) +{ + test_cis_terminate_rem(BT_HCI_ROLE_PERIPHERAL); +} + +void test_cis_terminate_loc(uint8_t role) +{ + uint8_t err; + struct node_tx *tx; + struct ll_conn_iso_stream cis = { 0 }; + struct ll_conn_iso_group group = { 0 }; + + struct pdu_data_llctrl_cis_terminate_ind local_cis_terminate_ind = { + .cig_id = 0x03, + .cis_id = 0x04, + .error_code = 0x06, + }; + + /* Role */ + test_set_role(&conn, role); + + /* Connect */ + ull_cp_state_set(&conn, ULL_CP_CONNECTED); + + /* Mock CIS/ACL */ + cis.lll.acl_handle = conn.lll.handle; + group.cig_id = local_cis_terminate_ind.cig_id; + cis.cis_id = local_cis_terminate_ind.cis_id; + cis.group = &group; + + /* Initiate an CIS Terminate Procedure */ + err = ull_cp_cis_terminate(&conn, &cis, local_cis_terminate_ind.error_code); + zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL); + + /* Prepare */ + event_prepare(&conn); + + /* Tx Queue should have one LL Control PDU */ + lt_rx(LL_CIS_TERMINATE_IND, &conn, &tx, &local_cis_terminate_ind); + lt_rx_q_is_empty(&conn); + + /* RX Ack */ + event_tx_ack(&conn, tx); + + /* Done */ + event_done(&conn); + + /* Release tx node */ + ull_cp_release_tx(&conn, tx); + + /* There should be no host notification */ + ut_rx_q_is_empty(); + + zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), + "Free CTX buffers %d", ctx_buffers_free()); +} + +void test_cis_terminate_cen_loc(void) +{ + test_cis_terminate_loc(BT_HCI_ROLE_CENTRAL); +} + +void test_cis_terminate_per_loc(void) +{ + test_cis_terminate_loc(BT_HCI_ROLE_PERIPHERAL); +} + +void test_main(void) +{ + ztest_test_suite( + cis_term, + ztest_unit_test_setup_teardown(test_cis_terminate_cen_rem, setup, unit_test_noop), + ztest_unit_test_setup_teardown(test_cis_terminate_per_rem, setup, unit_test_noop), + ztest_unit_test_setup_teardown(test_cis_terminate_cen_loc, setup, unit_test_noop), + ztest_unit_test_setup_teardown(test_cis_terminate_per_loc, setup, unit_test_noop)); + + ztest_run_test_suite(cis_term); +} diff --git a/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml new file mode 100644 index 00000000000..f8804168cb4 --- /dev/null +++ b/tests/bluetooth/controller/ctrl_cis_terminate/testcase.yaml @@ -0,0 +1,5 @@ +common: + tags: test_framework bluetooth bt_cis_terminate bt_ull_llcp +tests: + bluetooth.controller.ctrl_cis_terminate.test: + type: unit diff --git a/tests/bluetooth/controller/ctrl_collision/src/main.c b/tests/bluetooth/controller/ctrl_collision/src/main.c index 04577ea1155..563f04dfa6a 100644 --- a/tests/bluetooth/controller/ctrl_collision/src/main.c +++ b/tests/bluetooth/controller/ctrl_collision/src/main.c @@ -28,9 +28,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_conn_update/src/main.c b/tests/bluetooth/controller/ctrl_conn_update/src/main.c index 1242ee90d04..02d812bfd90 100644 --- a/tests/bluetooth/controller/ctrl_conn_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_conn_update/src/main.c @@ -27,8 +27,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_cte_req/src/main.c b/tests/bluetooth/controller/ctrl_cte_req/src/main.c index c7b2e162a04..81f19b01d94 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/src/main.c +++ b/tests/bluetooth/controller/ctrl_cte_req/src/main.c @@ -27,8 +27,13 @@ #include "ll_feat.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_data_length_update/src/main.c b/tests/bluetooth/controller/ctrl_data_length_update/src/main.c index 2f6204d3969..180a16597f1 100644 --- a/tests/bluetooth/controller/ctrl_data_length_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_data_length_update/src/main.c @@ -29,8 +29,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_internal.h" #include "ull_conn_types.h" #include "ull_llcp.h" diff --git a/tests/bluetooth/controller/ctrl_encrypt/src/main.c b/tests/bluetooth/controller/ctrl_encrypt/src/main.c index c9f2488e694..7de0f263974 100644 --- a/tests/bluetooth/controller/ctrl_encrypt/src/main.c +++ b/tests/bluetooth/controller/ctrl_encrypt/src/main.c @@ -29,9 +29,14 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + #include "ull_internal.h" #include "ull_conn_types.h" #include "ull_llcp.h" diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c b/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c index 64b7cb18f69..84aaaff2d32 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c +++ b/tests/bluetooth/controller/ctrl_feature_exchange/src/main.c @@ -29,9 +29,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_internal.h" diff --git a/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c b/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c index cd873c4d582..2374a706c06 100644 --- a/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c +++ b/tests/bluetooth/controller/ctrl_feature_exchange/src/main_hci.c @@ -29,7 +29,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" + #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" diff --git a/tests/bluetooth/controller/ctrl_invalid/src/main.c b/tests/bluetooth/controller/ctrl_invalid/src/main.c index 832b0d72932..b8d3e6bf4dc 100644 --- a/tests/bluetooth/controller/ctrl_invalid/src/main.c +++ b/tests/bluetooth/controller/ctrl_invalid/src/main.c @@ -26,10 +26,15 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" +#include "ull_conn_internal.h" #include "ull_llcp_internal.h" #include "helper_pdu.h" diff --git a/tests/bluetooth/controller/ctrl_le_ping/src/main.c b/tests/bluetooth/controller/ctrl_le_ping/src/main.c index f59e4514725..62268b715d2 100644 --- a/tests/bluetooth/controller/ctrl_le_ping/src/main.c +++ b/tests/bluetooth/controller/ctrl_le_ping/src/main.c @@ -26,8 +26,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c b/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c index 51b4bb8dd2e..39543b8c390 100644 --- a/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c +++ b/tests/bluetooth/controller/ctrl_min_used_chans/src/main.c @@ -26,8 +26,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" + +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_phy_update/src/main.c b/tests/bluetooth/controller/ctrl_phy_update/src/main.c index 2eb2ee245c2..aaff9d524f0 100644 --- a/tests/bluetooth/controller/ctrl_phy_update/src/main.c +++ b/tests/bluetooth/controller/ctrl_phy_update/src/main.c @@ -28,9 +28,14 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_terminate/src/main.c b/tests/bluetooth/controller/ctrl_terminate/src/main.c index 2c295320c3d..ecb0a9c19d5 100644 --- a/tests/bluetooth/controller/ctrl_terminate/src/main.c +++ b/tests/bluetooth/controller/ctrl_terminate/src/main.c @@ -27,9 +27,14 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c index 1dacd336276..a30f6b2c970 100644 --- a/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c +++ b/tests/bluetooth/controller/ctrl_tx_buffer_alloc/src/main.c @@ -28,9 +28,14 @@ #include "lll.h" #include "lll/lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_conn_internal.h" diff --git a/tests/bluetooth/controller/ctrl_unsupported/src/main.c b/tests/bluetooth/controller/ctrl_unsupported/src/main.c index ca5be6e9c29..65ca396f46e 100644 --- a/tests/bluetooth/controller/ctrl_unsupported/src/main.c +++ b/tests/bluetooth/controller/ctrl_unsupported/src/main.c @@ -26,8 +26,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" + #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_llcp_internal.h" diff --git a/tests/bluetooth/controller/ctrl_version/src/main.c b/tests/bluetooth/controller/ctrl_version/src/main.c index c749b4c6cb5..9fd97f427b2 100644 --- a/tests/bluetooth/controller/ctrl_version/src/main.c +++ b/tests/bluetooth/controller/ctrl_version/src/main.c @@ -27,8 +27,14 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" + #include "ull_tx_queue.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" + #include "ull_conn_types.h" #include "ull_llcp.h" #include "ull_llcp_internal.h" diff --git a/tests/bluetooth/controller/mock_ctrl/src/lll.c b/tests/bluetooth/controller/mock_ctrl/src/lll.c index f82ce46a839..81a2f1819d6 100644 --- a/tests/bluetooth/controller/mock_ctrl/src/lll.c +++ b/tests/bluetooth/controller/mock_ctrl/src/lll.c @@ -29,8 +29,13 @@ #include "lll.h" #include "lll_df_types.h" #include "lll_conn.h" +#include "lll_conn_iso.h" + #include "ull_tx_queue.h" #include "ull_conn_types.h" +#include "isoal.h" +#include "ull_iso_types.h" +#include "ull_conn_iso_types.h" #include "ull_llcp.h"