Lines Matching refs:cig
158 struct ll_conn_iso_group *cig; in ll_cig_parameters_commit() local
185 cig = ll_conn_iso_group_get_by_id(cig_id); in ll_cig_parameters_commit()
186 if (!cig) { in ll_cig_parameters_commit()
188 cig = ll_conn_iso_group_acquire(); in ll_cig_parameters_commit()
189 if (!cig) { in ll_cig_parameters_commit()
195 cig->lll.num_cis = 0U; in ll_cig_parameters_commit()
198 } else if (cig->state != CIG_STATE_CONFIGURABLE) { in ll_cig_parameters_commit()
204 num_cis = cig->lll.num_cis; in ll_cig_parameters_commit()
207 memcpy(cig, &ll_iso_setup.group, sizeof(struct ll_conn_iso_group)); in ll_cig_parameters_commit()
209 cig->state = CIG_STATE_CONFIGURABLE; in ll_cig_parameters_commit()
212 cig->lll.handle = ll_conn_iso_group_handle_get(cig); in ll_cig_parameters_commit()
213 cig->lll.role = BT_HCI_ROLE_CENTRAL; in ll_cig_parameters_commit()
214 cig->lll.resume_cis = LLL_HANDLE_INVALID; in ll_cig_parameters_commit()
215 cig->lll.num_cis = num_cis; in ll_cig_parameters_commit()
218 if (!cig->central.test) { in ll_cig_parameters_commit()
234 iso_interval_us = cig->c_sdu_interval; in ll_cig_parameters_commit()
245 if (cig->central.framing && cig->c_sdu_interval == 10000U) { in ll_cig_parameters_commit()
250 if (!cig->central.framing && (cig->c_sdu_interval % ISO_INT_UNIT_US)) { in ll_cig_parameters_commit()
257 iso_interval_us = cig->iso_interval * ISO_INT_UNIT_US; in ll_cig_parameters_commit()
262 lll_hdr_init(&cig->lll, cig); in ll_cig_parameters_commit()
297 cig->lll.num_cis++; in ll_cig_parameters_commit()
307 cis->group = cig; in ll_cig_parameters_commit()
308 cis->framed = cig->central.framing || force_framed; in ll_cig_parameters_commit()
316 num_cis = cig->lll.num_cis; in ll_cig_parameters_commit()
341 cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); in ll_cig_parameters_commit()
343 if (cig->central.test) { in ll_cig_parameters_commit()
350 LL_ASSERT(cis->framed || iso_interval_us >= cig->c_sdu_interval); in ll_cig_parameters_commit()
352 tx = cig->c_sdu_interval && cis->c_max_sdu; in ll_cig_parameters_commit()
353 rx = cig->p_sdu_interval && cis->p_max_sdu; in ll_cig_parameters_commit()
376 cig->c_sdu_interval, cis->c_max_sdu, &bn, &max_pdu); in ll_cig_parameters_commit()
398 cig->p_sdu_interval, cis->p_max_sdu, &bn, &max_pdu); in ll_cig_parameters_commit()
423 cig->lll.iso_interval_us = iso_interval_us; in ll_cig_parameters_commit()
424 cig->iso_interval = iso_interval_us / ISO_INT_UNIT_US; in ll_cig_parameters_commit()
432 if (cig->central.packing == BT_ISO_PACKING_SEQUENTIAL) { in ll_cig_parameters_commit()
453 cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); in ll_cig_parameters_commit()
455 if (!cig->central.test) { in ll_cig_parameters_commit()
458 LL_ASSERT(cig->central.packing == BT_ISO_PACKING_SEQUENTIAL); in ll_cig_parameters_commit()
475 cig->c_sdu_interval, cig->c_latency, in ll_cig_parameters_commit()
479 cig->p_sdu_interval, cig->p_latency, in ll_cig_parameters_commit()
494 if (cig->central.packing == BT_ISO_PACKING_SEQUENTIAL) { in ll_cig_parameters_commit()
509 cig->sync_delay = cig_sync_delay; in ll_cig_parameters_commit()
522 cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); in ll_cig_parameters_commit()
526 c_latency = cig->sync_delay + in ll_cig_parameters_commit()
528 cig->c_sdu_interval; in ll_cig_parameters_commit()
529 p_latency = cig->sync_delay + in ll_cig_parameters_commit()
531 cig->p_sdu_interval; in ll_cig_parameters_commit()
535 c_latency = cig->sync_delay + in ll_cig_parameters_commit()
537 cig->c_sdu_interval; in ll_cig_parameters_commit()
538 p_latency = cig->sync_delay + in ll_cig_parameters_commit()
540 cig->p_sdu_interval; in ll_cig_parameters_commit()
543 if (!cig->central.test) { in ll_cig_parameters_commit()
545 if ((c_latency > cig->c_latency) || (p_latency > cig->p_latency)) { in ll_cig_parameters_commit()
573 if (cig->central.packing == BT_ISO_PACKING_SEQUENTIAL) { in ll_cig_parameters_commit()
589 cig->c_latency = c_max_latency; in ll_cig_parameters_commit()
590 cig->p_latency = p_max_latency; in ll_cig_parameters_commit()
598 slot_us = cig->sync_delay; in ll_cig_parameters_commit()
603 cig->ull.ticks_active_to_start = 0U; in ll_cig_parameters_commit()
604 cig->ull.ticks_prepare_to_start = in ll_cig_parameters_commit()
606 cig->ull.ticks_preempt_to_start = in ll_cig_parameters_commit()
608 cig->ull.ticks_slot = HAL_TICKER_US_TO_TICKS_CEIL(slot_us); in ll_cig_parameters_commit()
630 ll_conn_iso_group_release(cig); in ll_cig_parameters_commit()
774 struct ll_conn_iso_group *cig; in ll_cig_remove() local
777 cig = ll_conn_iso_group_get_by_id(cig_id); in ll_cig_remove()
778 if (!cig) { in ll_cig_remove()
783 if ((cig->state == CIG_STATE_INITIATING) || (cig->state == CIG_STATE_ACTIVE)) { in ll_cig_remove()
789 for (uint8_t i = 0U; i < cig->lll.num_cis; i++) { in ll_cig_remove()
792 cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); in ll_cig_remove()
810 for (uint8_t i = 0U; i < cig->lll.num_cis; i++) { in ll_cig_remove()
811 cis = ll_conn_iso_stream_get_by_group(cig, &handle_iter); in ll_cig_remove()
819 ll_conn_iso_group_release(cig); in ll_cig_remove()
843 struct ll_conn_iso_group *cig; in ull_central_iso_setup() local
853 cig = cis->group; in ull_central_iso_setup()
854 if (!cig) { in ull_central_iso_setup()
869 if (cig->state == CIG_STATE_ACTIVE) { in ull_central_iso_setup()
888 cig_ref_point = cig->cig_ref_point; in ull_central_iso_setup()
890 cig_ref_point += cig->iso_interval * ISO_INT_UNIT_US; in ull_central_iso_setup()
894 (cig->sync_delay - cis->sync_delay); in ull_central_iso_setup()
914 cis_offset += cig->sync_delay - cis->sync_delay; in ull_central_iso_setup()
949 *cig_sync_delay = cig->sync_delay; in ull_central_iso_setup()
965 struct ll_conn_iso_group *cig; in ull_central_iso_cis_offset_get() local
979 cig = cis->group; in ull_central_iso_cis_offset_get()
981 cig->sync_delay; in ull_central_iso_cis_offset_get()
989 if (cig->state == CIG_STATE_ACTIVE) { in ull_central_iso_cis_offset_get()
1001 *cis_offset_min += cig->sync_delay - cis->sync_delay; in ull_central_iso_cis_offset_get()
1023 struct ll_conn_iso_group *cig; in mfy_cig_offset_get() local
1033 cig = cis->group; in mfy_cig_offset_get()
1038 err = ull_sched_conn_iso_free_offset_get(cig->ull.ticks_slot, in mfy_cig_offset_get()
1045 offset_min_us += cig->sync_delay - cis->sync_delay; in mfy_cig_offset_get()
1057 offset_max_us = conn_interval_us - cig->sync_delay; in mfy_cig_offset_get()
1079 struct ll_conn_iso_group *cig; in mfy_cis_offset_get() local
1095 cig = cis->group; in mfy_cis_offset_get()
1096 ticker_id = TICKER_ID_CONN_ISO_BASE + ll_conn_iso_group_handle_get(cig); in mfy_cis_offset_get()
1167 cig_remainder_us + cig->sync_delay - in mfy_cis_offset_get()
1179 cig_interval_us = cig->iso_interval * ISO_INT_UNIT_US; in mfy_cis_offset_get()
1190 offset_limit_us = cig_interval_us + cig->sync_delay - cis->sync_delay; in mfy_cis_offset_get()