Lines Matching +full:validity +full:- +full:control
4 * SPDX-License-Identifier: Apache-2.0
99 ctx = (struct proc_ctx *)mem_acquire(&owner->free); in proc_ctx_acquire()
103 ctx->owner = owner; in proc_ctx_acquire()
112 LL_ASSERT(ctx->owner); in llcp_proc_ctx_release()
115 mem_release(ctx, &ctx->owner->free); in llcp_proc_ctx_release()
124 if (conn->llcp.tx_buffer_alloc > CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) { in ull_cp_update_tx_buffer_queue()
125 common_tx_buffer_alloc -= (conn->llcp.tx_buffer_alloc - in ull_cp_update_tx_buffer_queue()
132 * @brief Check for per conn pre-allocated tx buffer allowance
138 /* Check if per connection pre-aloted tx buffer is available */ in static_tx_buffer_available()
139 if (conn->llcp.tx_buffer_alloc < CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) { in static_tx_buffer_available()
140 /* This connection has not yet used up all the pre-aloted tx buffers */ in static_tx_buffer_available()
148 * @brief pre-alloc/peek of a tx buffer, leave requester on the wait list (@head if first up)
156 /* The conn already has spent its pre-aloted tx buffer(s), in llcp_tx_alloc_peek()
159 if (ctx->wait_reason == WAITING_FOR_NOTHING) { in llcp_tx_alloc_peek()
163 sys_slist_append(&tx_buffer_wait_list, &ctx->wait_node); in llcp_tx_alloc_peek()
164 ctx->wait_reason = WAITING_FOR_TX_BUFFER; in llcp_tx_alloc_peek()
168 if (ctx->wait_reason == WAITING_FOR_TX_BUFFER && in llcp_tx_alloc_peek()
169 sys_slist_peek_head(&tx_buffer_wait_list) == &ctx->wait_node) { in llcp_tx_alloc_peek()
180 * @brief un-peek of a tx buffer, in case ongoing alloc is aborted
185 sys_slist_find_and_remove(&tx_buffer_wait_list, &ctx->wait_node); in llcp_tx_alloc_unpeek()
186 ctx->wait_reason = WAITING_FOR_NOTHING; in llcp_tx_alloc_unpeek()
198 conn->llcp.tx_buffer_alloc++; in llcp_tx_alloc()
200 if (conn->llcp.tx_buffer_alloc > CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) { in llcp_tx_alloc()
206 if (ctx->wait_reason == WAITING_FOR_TX_BUFFER) { in llcp_tx_alloc()
207 sys_slist_find_and_remove(&tx_buffer_wait_list, &ctx->wait_node); in llcp_tx_alloc()
215 ctx->wait_reason = WAITING_FOR_NOTHING; in llcp_tx_alloc()
240 pdu = (struct pdu_data *)tx->pdu; in llcp_tx_alloc()
268 * ULL -> LLL Interface
273 ull_tx_q_enqueue_ctrl(&conn->tx_q, tx); in llcp_tx_enqueue()
279 if (conn->llcp.tx_q_pause_data_mask == 0) { in llcp_tx_pause_data()
280 ull_tx_q_pause_data(&conn->tx_q); in llcp_tx_pause_data()
284 conn->llcp.tx_q_pause_data_mask |= pause_mask; in llcp_tx_pause_data()
290 conn->llcp.tx_q_pause_data_mask &= ~resume_mask; in llcp_tx_resume_data()
293 if (conn->llcp.tx_q_pause_data_mask == 0) { in llcp_tx_resume_data()
294 ull_tx_q_resume_data(&conn->tx_q); in llcp_tx_resume_data()
300 LL_ASSERT(ctx->node_ref.rx); in llcp_rx_node_retain()
303 if (ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN) { in llcp_rx_node_retain()
305 ctx->node_ref.rx->hdr.type = NODE_RX_TYPE_RETAIN; in llcp_rx_node_retain()
308 ctx->node_ref.rx->hdr.link = ctx->node_ref.link; in llcp_rx_node_retain()
314 LL_ASSERT(ctx->node_ref.rx); in llcp_rx_node_release()
317 if (ctx->node_ref.rx->hdr.type == NODE_RX_TYPE_RETAIN) { in llcp_rx_node_release()
319 ctx->node_ref.rx->hdr.type = NODE_RX_TYPE_RELEASE; in llcp_rx_node_release()
320 ll_rx_put_sched(ctx->node_ref.rx->hdr.link, ctx->node_ref.rx); in llcp_rx_node_release()
326 if (ctx->node_ref.rx && ctx->node_ref.rx->hdr.type == NODE_RX_TYPE_RETAIN) { in llcp_nodes_release()
328 ctx->node_ref.rx->hdr.link->mem = conn->llcp.rx_node_release; in llcp_nodes_release()
329 ctx->node_ref.rx->hdr.type = NODE_RX_TYPE_RELEASE; in llcp_nodes_release()
330 conn->llcp.rx_node_release = ctx->node_ref.rx; in llcp_nodes_release()
333 if (ctx->proc == PROC_PHY_UPDATE && ctx->data.pu.ntf_dle_node) { in llcp_nodes_release()
335 ctx->data.pu.ntf_dle_node->hdr.link->mem = conn->llcp.rx_node_release; in llcp_nodes_release()
336 ctx->data.pu.ntf_dle_node->hdr.type = NODE_RX_TYPE_RELEASE; in llcp_nodes_release()
337 conn->llcp.rx_node_release = ctx->data.pu.ntf_dle_node; in llcp_nodes_release()
341 if (ctx->node_ref.tx) { in llcp_nodes_release()
342 ctx->node_ref.tx->next = conn->llcp.tx_node_release; in llcp_nodes_release()
343 conn->llcp.tx_node_release = ctx->node_ref.tx; in llcp_nodes_release()
360 ctx->proc = proc; in create_procedure()
361 ctx->done = 0U; in create_procedure()
362 ctx->rx_greedy = 0U; in create_procedure()
363 ctx->node_ref.rx = NULL; in create_procedure()
364 ctx->node_ref.tx_ack = NULL; in create_procedure()
365 ctx->state = LLCP_STATE_IDLE; in create_procedure()
368 memset((void *)&ctx->data, 0, sizeof(ctx->data)); in create_procedure()
371 ctx->rx_opcode = ULL_LLCP_INVALID_OPCODE; in create_procedure()
372 ctx->tx_opcode = ULL_LLCP_INVALID_OPCODE; in create_procedure()
373 ctx->response_opcode = ULL_LLCP_INVALID_OPCODE; in create_procedure()
413 sys_slist_init(&conn->llcp.local.pend_proc_list); in ull_llcp_init()
414 conn->llcp.local.pause = 0U; in ull_llcp_init()
418 sys_slist_init(&conn->llcp.remote.pend_proc_list); in ull_llcp_init()
419 conn->llcp.remote.pause = 0U; in ull_llcp_init()
420 conn->llcp.remote.incompat = INCOMPAT_NO_COLLISION; in ull_llcp_init()
421 conn->llcp.remote.collision = 0U; in ull_llcp_init()
423 conn->llcp.remote.paused_cmd = PROC_NONE; in ull_llcp_init()
429 conn->llcp.prt_reload = 0U; in ull_llcp_init()
432 memset(&conn->llcp.vex, 0, sizeof(conn->llcp.vex)); in ull_llcp_init()
436 memset(&conn->llcp.muc, 0, sizeof(conn->llcp.muc)); in ull_llcp_init()
440 memset(&conn->llcp.fex, 0, sizeof(conn->llcp.fex)); in ull_llcp_init()
441 conn->llcp.fex.features_used = ll_feat_get(); in ull_llcp_init()
445 conn->lll.enc_tx = 0U; in ull_llcp_init()
446 conn->lll.enc_rx = 0U; in ull_llcp_init()
450 conn->llcp.cte_req.is_enabled = 0U; in ull_llcp_init()
451 conn->llcp.cte_req.req_expire = 0U; in ull_llcp_init()
454 conn->llcp.cte_rsp.is_enabled = 0U; in ull_llcp_init()
455 conn->llcp.cte_rsp.is_active = 0U; in ull_llcp_init()
456 conn->llcp.cte_rsp.disable_param = NULL; in ull_llcp_init()
457 conn->llcp.cte_rsp.disable_cb = NULL; in ull_llcp_init()
461 conn->llcp.tx_buffer_alloc = 0; in ull_llcp_init()
464 conn->llcp.tx_q_pause_data_mask = 0; in ull_llcp_init()
465 conn->lll.event_counter = 0; in ull_llcp_init()
467 conn->llcp.tx_node_release = NULL; in ull_llcp_init()
468 conn->llcp.rx_node_release = NULL; in ull_llcp_init()
475 LL_ASSERT(conn->llcp.tx_buffer_alloc > 0); in ull_cp_release_tx()
476 if (conn->llcp.tx_buffer_alloc > CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM) { in ull_cp_release_tx()
477 common_tx_buffer_alloc--; in ull_cp_release_tx()
479 conn->llcp.tx_buffer_alloc--; in ull_cp_release_tx()
491 *expire -= elapsed_event; in prt_elapse()
494 return -ETIMEDOUT; in prt_elapse()
507 loc_ret = prt_elapse(&conn->llcp.local.prt_expire, elapsed_event); in ull_cp_prt_elapse()
508 if (loc_ret == -ETIMEDOUT) { in ull_cp_prt_elapse()
516 if (ctx->proc == PROC_TERMINATE) { in ull_cp_prt_elapse()
518 *error_code = ctx->data.term.error_code; in ull_cp_prt_elapse()
523 return -ETIMEDOUT; in ull_cp_prt_elapse()
526 rem_ret = prt_elapse(&conn->llcp.remote.prt_expire, elapsed_event); in ull_cp_prt_elapse()
527 if (rem_ret == -ETIMEDOUT) { in ull_cp_prt_elapse()
531 return -ETIMEDOUT; in ull_cp_prt_elapse()
542 conn->llcp.prt_reload = RADIO_CONN_EVENTS((40U * 1000U * 1000U), conn_intv_us); in ull_cp_prt_reload_set()
573 rx = conn->llcp.rx_node_release; in ull_cp_release_nodes()
578 hdr = &rx->hdr; in ull_cp_release_nodes()
579 rx = hdr->link->mem; in ull_cp_release_nodes()
582 ll_rx_put(hdr->link, hdr); in ull_cp_release_nodes()
584 conn->llcp.rx_node_release = NULL; in ull_cp_release_nodes()
586 /* release any llcp pre-allocated tx nodes */ in ull_cp_release_nodes()
587 tx = conn->llcp.tx_node_release; in ull_cp_release_nodes()
592 tx = tx->next; in ull_cp_release_nodes()
596 conn->llcp.tx_node_release = NULL; in ull_cp_release_nodes()
604 if (conn->lll.role != BT_HCI_ROLE_PERIPHERAL) { in ull_cp_min_used_chans()
613 ctx->data.muc.phys = phys; in ull_cp_min_used_chans()
614 ctx->data.muc.min_used_chans = min_used_chans; in ull_cp_min_used_chans()
648 ctx->data.fex.host_initiated = host_initiated; in ull_cp_feature_exchange()
677 if (conn->lll.role != BT_HCI_ROLE_CENTRAL) { in ull_cp_encryption_start()
687 memcpy(ctx->data.enc.rand, rand, sizeof(ctx->data.enc.rand)); in ull_cp_encryption_start()
688 ctx->data.enc.ediv[0] = ediv[0]; in ull_cp_encryption_start()
689 ctx->data.enc.ediv[1] = ediv[1]; in ull_cp_encryption_start()
690 memcpy(ctx->data.enc.ltk, ltk, sizeof(ctx->data.enc.ltk)); in ull_cp_encryption_start()
703 if (conn->lll.role != BT_HCI_ROLE_CENTRAL) { in ull_cp_encryption_pause()
713 memcpy(ctx->data.enc.rand, rand, sizeof(ctx->data.enc.rand)); in ull_cp_encryption_pause()
714 ctx->data.enc.ediv[0] = ediv[0]; in ull_cp_encryption_pause()
715 ctx->data.enc.ediv[1] = ediv[1]; in ull_cp_encryption_pause()
716 memcpy(ctx->data.enc.ltk, ltk, sizeof(ctx->data.enc.ltk)); in ull_cp_encryption_pause()
730 if (ctx && ctx->proc == PROC_ENCRYPTION_PAUSE) { in ull_cp_encryption_paused()
735 if (ctx && ctx->proc == PROC_ENCRYPTION_PAUSE) { in ull_cp_encryption_paused()
754 ctx->data.pu.tx = tx; in ull_cp_phy_update()
755 ctx->data.pu.flags = flags; in ull_cp_phy_update()
756 ctx->data.pu.rx = rx; in ull_cp_phy_update()
757 ctx->data.pu.host_initiated = host_initiated; in ull_cp_phy_update()
777 ctx->data.term.error_code = error_code; in ull_cp_terminate()
790 if (conn->lll.handle != cis->lll.acl_handle) { in ull_cp_cis_terminate()
799 ctx->data.cis_term.cig_id = cis->group->cig_id; in ull_cp_cis_terminate()
800 ctx->data.cis_term.cis_id = cis->cis_id; in ull_cp_cis_terminate()
801 ctx->data.cis_term.error_code = error_code; in ull_cp_cis_terminate()
815 if (!conn->llcp.fex.valid) { in ull_cp_cis_create()
827 cig = cis->group; in ull_cp_cis_create()
828 ctx->data.cis_create.cis_handle = cis->lll.handle; in ull_cp_cis_create()
830 ctx->data.cis_create.cig_id = cis->group->cig_id; in ull_cp_cis_create()
831 ctx->data.cis_create.cis_id = cis->cis_id; in ull_cp_cis_create()
832 ctx->data.cis_create.c_phy = cis->lll.tx.phy; in ull_cp_cis_create()
833 ctx->data.cis_create.p_phy = cis->lll.rx.phy; in ull_cp_cis_create()
834 ctx->data.cis_create.c_sdu_interval = cig->c_sdu_interval; in ull_cp_cis_create()
835 ctx->data.cis_create.p_sdu_interval = cig->p_sdu_interval; in ull_cp_cis_create()
836 ctx->data.cis_create.c_max_pdu = cis->lll.tx.max_pdu; in ull_cp_cis_create()
837 ctx->data.cis_create.p_max_pdu = cis->lll.rx.max_pdu; in ull_cp_cis_create()
838 ctx->data.cis_create.c_max_sdu = cis->c_max_sdu; in ull_cp_cis_create()
839 ctx->data.cis_create.p_max_sdu = cis->p_max_sdu; in ull_cp_cis_create()
840 ctx->data.cis_create.iso_interval = cig->iso_interval; in ull_cp_cis_create()
841 ctx->data.cis_create.framed = cis->framed; in ull_cp_cis_create()
842 ctx->data.cis_create.nse = cis->lll.nse; in ull_cp_cis_create()
843 ctx->data.cis_create.sub_interval = cis->lll.sub_interval; in ull_cp_cis_create()
844 ctx->data.cis_create.c_bn = cis->lll.tx.bn; in ull_cp_cis_create()
845 ctx->data.cis_create.p_bn = cis->lll.rx.bn; in ull_cp_cis_create()
846 ctx->data.cis_create.c_ft = cis->lll.tx.ft; in ull_cp_cis_create()
847 ctx->data.cis_create.p_ft = cis->lll.rx.ft; in ull_cp_cis_create()
849 /* ctx->data.cis_create.conn_event_count will be filled when Tx PDU is in ull_cp_cis_create()
864 if (conn->lll.role != BT_HCI_ROLE_CENTRAL) { in ull_cp_chan_map_update()
873 memcpy(ctx->data.chmu.chm, chm, sizeof(ctx->data.chmu.chm)); in ull_cp_chan_map_update()
885 if (conn->lll.role == BT_HCI_ROLE_CENTRAL) { in ull_cp_chan_map_update_pending()
891 if (ctx && ctx->proc == PROC_CHAN_MAP_UPDATE) { in ull_cp_chan_map_update_pending()
892 return ctx->data.chmu.chm; in ull_cp_chan_map_update_pending()
907 /* Returning BT_HCI_ERR_SUCCESS here might seem counter-intuitive, in ull_cp_data_length_update()
956 if (ctx && (ctx->proc == PROC_ENCRYPTION_START || ctx->proc == PROC_ENCRYPTION_PAUSE) && in ull_cp_ltk_req_reply()
958 memcpy(ctx->data.enc.ltk, ltk, sizeof(ctx->data.enc.ltk)); in ull_cp_ltk_req_reply()
970 if (ctx && (ctx->proc == PROC_ENCRYPTION_START || ctx->proc == PROC_ENCRYPTION_PAUSE) && in ull_cp_ltk_req_neq_reply()
987 } else if (conn->lll.role == BT_HCI_ROLE_CENTRAL) { in ull_cp_conn_update()
993 if (conn->lll.role == BT_HCI_ROLE_PERIPHERAL) { in ull_cp_conn_update()
1004 if (ctx->proc == PROC_CONN_UPDATE) { in ull_cp_conn_update()
1005 ctx->data.cu.interval_max = interval_max; in ull_cp_conn_update()
1006 ctx->data.cu.latency = latency; in ull_cp_conn_update()
1007 ctx->data.cu.timeout = timeout; in ull_cp_conn_update()
1009 } else if (ctx->proc == PROC_CONN_PARAM_REQ) { in ull_cp_conn_update()
1010 ctx->data.cu.interval_min = interval_min; in ull_cp_conn_update()
1011 ctx->data.cu.interval_max = interval_max; in ull_cp_conn_update()
1012 ctx->data.cu.latency = latency; in ull_cp_conn_update()
1013 ctx->data.cu.timeout = timeout; in ull_cp_conn_update()
1014 ctx->data.cu.offsets[0] = offsets ? offsets[0] : 0x0000; in ull_cp_conn_update()
1015 ctx->data.cu.offsets[1] = offsets ? offsets[1] : 0xffff; in ull_cp_conn_update()
1016 ctx->data.cu.offsets[2] = offsets ? offsets[2] : 0xffff; in ull_cp_conn_update()
1017 ctx->data.cu.offsets[3] = offsets ? offsets[3] : 0xffff; in ull_cp_conn_update()
1018 ctx->data.cu.offsets[4] = offsets ? offsets[4] : 0xffff; in ull_cp_conn_update()
1019 ctx->data.cu.offsets[5] = offsets ? offsets[5] : 0xffff; in ull_cp_conn_update()
1022 (conn->lll.role == BT_HCI_ROLE_PERIPHERAL)) { in ull_cp_conn_update()
1053 /* Exactly one of the sync and adv_sync pointers should be non-null */ in ull_cp_periodic_sync()
1066 chan_map = sync->lll.chm[sync->lll.chm_first].data_chan_map; in ull_cp_periodic_sync()
1067 si_sca = sync->lll.sca; in ull_cp_periodic_sync()
1068 access_addr = sync->lll.access_addr; in ull_cp_periodic_sync()
1069 crc_init = sync->lll.crc_init; in ull_cp_periodic_sync()
1070 sid = sync->sid; in ull_cp_periodic_sync()
1071 phy = sync->lll.phy; in ull_cp_periodic_sync()
1072 interval = sync->interval; in ull_cp_periodic_sync()
1074 addr_type = sync->peer_id_addr_type; in ull_cp_periodic_sync()
1075 if (IS_ENABLED(CONFIG_BT_CTLR_PRIVACY) && sync->peer_addr_resolved) { in ull_cp_periodic_sync()
1080 rl_idx = ull_filter_rl_find(addr_type, sync->peer_id_addr, NULL); in ull_cp_periodic_sync()
1091 adva = sync->peer_id_addr; in ull_cp_periodic_sync()
1097 chan_map = adv_sync->lll.chm[adv_sync->lll.chm_first].data_chan_map; in ull_cp_periodic_sync()
1099 access_addr = adv_sync->lll.access_addr; in ull_cp_periodic_sync()
1100 crc_init = adv_sync->lll.crc_init; in ull_cp_periodic_sync()
1101 phy = adv_sync->lll.adv->phy_s; in ull_cp_periodic_sync()
1102 interval = adv_sync->interval; in ull_cp_periodic_sync()
1104 adv = HDR_LLL2ULL(adv_sync->lll.adv); in ull_cp_periodic_sync()
1105 sid = adv->sid; in ull_cp_periodic_sync()
1108 adv_pdu = lll_adv_sync_data_curr_get(&adv_sync->lll); in ull_cp_periodic_sync()
1109 addr_type = adv_pdu->tx_addr; in ull_cp_periodic_sync()
1111 adva = adv_pdu->adv_ext_ind.ext_hdr.data; in ull_cp_periodic_sync()
1115 ctx->data.periodic_sync.sync_handle = sync ? ull_sync_handle_get(sync) : in ull_cp_periodic_sync()
1117 ctx->data.periodic_sync.adv_handle = adv_sync ? ull_adv_sync_handle_get(adv_sync) : in ull_cp_periodic_sync()
1119 ctx->data.periodic_sync.id = service_data; in ull_cp_periodic_sync()
1120 ctx->data.periodic_sync.sca = lll_clock_sca_local_get(); in ull_cp_periodic_sync()
1122 si = &ctx->data.periodic_sync.sync_info; in ull_cp_periodic_sync()
1123 si->interval = sys_cpu_to_le16(interval); in ull_cp_periodic_sync()
1124 (void)memcpy(si->sca_chm, chan_map, sizeof(ctx->data.periodic_sync.sync_info.sca_chm)); in ull_cp_periodic_sync()
1125 si->sca_chm[PDU_SYNC_INFO_SCA_CHM_SCA_BYTE_OFFSET] &= ~PDU_SYNC_INFO_SCA_CHM_SCA_BIT_MASK; in ull_cp_periodic_sync()
1126 si->sca_chm[PDU_SYNC_INFO_SCA_CHM_SCA_BYTE_OFFSET] |= ((si_sca << in ull_cp_periodic_sync()
1129 (void)memcpy(si->aa, access_addr, sizeof(si->aa)); in ull_cp_periodic_sync()
1130 (void)memcpy(si->crc_init, crc_init, sizeof(si->crc_init)); in ull_cp_periodic_sync()
1132 ctx->data.periodic_sync.addr_type = addr_type; in ull_cp_periodic_sync()
1133 (void)memcpy(ctx->data.periodic_sync.adv_addr, adva, BDADDR_SIZE); in ull_cp_periodic_sync()
1134 ctx->data.periodic_sync.sid = sid; in ull_cp_periodic_sync()
1135 ctx->data.periodic_sync.phy = phy; in ull_cp_periodic_sync()
1152 return (ctx && ctx->proc == PROC_DATA_LENGTH_UPDATE); in ull_cp_remote_dle_pending()
1162 if (ctx && ctx->proc == PROC_CONN_PARAM_REQ) { in ull_cp_conn_param_req_reply()
1172 if (ctx && ctx->proc == PROC_CONN_PARAM_REQ) { in ull_cp_conn_param_req_neg_reply()
1173 ctx->data.cu.error = error_code; in ull_cp_conn_param_req_neg_reply()
1184 return (ctx && ctx->proc == PROC_CONN_PARAM_REQ); in ull_cp_remote_cpr_pending()
1194 if (ctx && ctx->proc == PROC_CONN_PARAM_REQ) { in ull_cp_remote_cpr_apm_awaiting_reply()
1207 if (ctx && ctx->proc == PROC_CONN_PARAM_REQ) { in ull_cp_remote_cpr_apm_reply()
1208 ctx->data.cu.offsets[0] = offsets[0]; in ull_cp_remote_cpr_apm_reply()
1209 ctx->data.cu.offsets[1] = offsets[1]; in ull_cp_remote_cpr_apm_reply()
1210 ctx->data.cu.offsets[2] = offsets[2]; in ull_cp_remote_cpr_apm_reply()
1211 ctx->data.cu.offsets[3] = offsets[3]; in ull_cp_remote_cpr_apm_reply()
1212 ctx->data.cu.offsets[4] = offsets[4]; in ull_cp_remote_cpr_apm_reply()
1213 ctx->data.cu.offsets[5] = offsets[5]; in ull_cp_remote_cpr_apm_reply()
1214 ctx->data.cu.error = 0U; in ull_cp_remote_cpr_apm_reply()
1225 if (ctx && ctx->proc == PROC_CONN_PARAM_REQ) { in ull_cp_remote_cpr_apm_neg_reply()
1226 ctx->data.cu.error = error_code; in ull_cp_remote_cpr_apm_neg_reply()
1237 conn->llcp.cte_rsp.is_enabled = enable; in ull_cp_cte_rsp_enable()
1240 conn->llcp.cte_rsp.max_cte_len = max_cte_len; in ull_cp_cte_rsp_enable()
1241 conn->llcp.cte_rsp.cte_types = cte_types; in ull_cp_cte_rsp_enable()
1252 * - by Feature Exchange control procedure that peer device does not support CTE response,
1253 * - by reception LL_UNKNOWN_RSP with unknown type LL_CTE_REQ that peer device does not
1258 if ((conn->llcp.fex.valid &&
1259 (!(conn->llcp.fex.features_peer & BIT64(BT_LE_FEAT_BIT_CONN_CTE_RESP)))) ||
1260 (!conn->llcp.fex.valid && !feature_cte_req(conn))) {
1268 if (conn->lll.phy_rx != PHY_CODED) {
1277 ctx->data.cte_req.min_len = min_cte_len;
1278 ctx->data.cte_req.type = cte_type;
1290 conn->llcp.cte_req.is_enabled = 0U;
1291 conn->llcp.cte_req.req_interval = 0U;
1302 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1303 ctx->data.cis_create.cis_offset_min = cis_offset_min;
1304 ctx->data.cis_create.cis_offset_max = cis_offset_max;
1317 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1329 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1330 return ctx->data.cis_create.cis_handle;
1341 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1342 if (cis_offset_min > ctx->data.cis_create.cis_offset_min) {
1343 if (cis_offset_min > ctx->data.cis_create.cis_offset_max) {
1344 ctx->data.cis_create.error = BT_HCI_ERR_UNSUPP_LL_PARAM_VAL;
1350 ctx->data.cis_create.cis_offset_min = cis_offset_min;
1362 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1363 ctx->data.cis_create.error = error_code;
1376 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1383 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1396 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1410 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1411 ctx->data.cis_create.error = error_code;
1419 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1420 ctx->data.cis_create.error = error_code;
1434 if (ctx && ctx->proc == PROC_CIS_CREATE) {
1459 *adv_sync_handle = ctx->data.periodic_sync.adv_handle;
1460 *sync_handle = ctx->data.periodic_sync.sync_handle;
1482 * connection event count - conn_event_count
1484 uint32_t conn_interval_us = conn->lll.interval * CONN_INT_UNIT_US;
1486 conn_event_offset = DIV_ROUND_UP(offset_us - max_offset, conn_interval_us);
1489 offset_us = offset_us - (conn_event_offset * conn_interval_us);
1491 ctx->data.periodic_sync.conn_event_count = ull_conn_event_counter(conn) +
1495 llcp_pdu_fill_sync_info_offset(&ctx->data.periodic_sync.sync_info, offset_us);
1498 ctx->data.periodic_sync.offset_us = offset_us;
1501 ctx->data.periodic_sync.sync_conn_event_count = ull_conn_event_counter(conn);
1502 ctx->data.periodic_sync.conn_event_count = ull_conn_event_counter(conn) +
1505 ctx->data.periodic_sync.sync_info.evt_cntr = pa_event_counter;
1507 ctx->data.periodic_sync.last_pa_event_counter = last_pa_event_counter;
1520 if (conn->lll.role == BT_HCI_ROLE_PERIPHERAL && done->extra.trx_cnt) {
1524 done->extra.drift.start_to_address_actual_us,
1525 (-done->extra.drift.preamble_to_addr_us));
1527 ctx->data.periodic_sync.conn_start_to_actual_us = start_to_actual_us;
1531 ctx->data.periodic_sync.conn_evt_trx = done->extra.trx_cnt;
1539 return (ctx->rx_opcode == pdu->llctrl.opcode || ctx->rx_greedy);
1544 return ((pdu->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP) &&
1545 (ctx->tx_opcode == pdu->llctrl.unknown_rsp.type));
1550 /* For LL_REJECT_IND there is no simple way of confirming protocol validity of the PDU
1553 return (pdu->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_REJECT_IND);
1558 return ((pdu->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND) &&
1559 (ctx->tx_opcode == pdu->llctrl.reject_ext_ind.reject_opcode));
1569 return pdu->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_TERMINATE_IND;
1572 #define VALIDATE_PDU_LEN(pdu, type) (pdu->len == PDU_DATA_LLCTRL_LEN(type))
1845 if (pdu->len < 1) {
1847 pdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_UNUSED;
1851 if (pdu->llctrl.opcode < ARRAY_SIZE(pdu_validate)) {
1854 cb = pdu_validate[pdu->llctrl.opcode].validate_cb;
1869 if (ctx && ctx->node_ref.tx_ack == tx) {
1875 if (ctx && ctx->node_ref.tx_ack == tx) {
1907 pdu = (struct pdu_data *)rx->pdu;
1961 conn->llcp_terminate.reason_final =