Lines Matching refs:cig

423 			struct bt_iso_cig *cig;  in bt_iso_chan_disconnected()  local
427 cig = get_cig(chan); in bt_iso_chan_disconnected()
428 __ASSERT(cig != NULL, "CIG was NULL"); in bt_iso_chan_disconnected()
431 SYS_SLIST_FOR_EACH_CONTAINER(&cig->cis_channels, cis_chan, node) { in bt_iso_chan_disconnected()
440 cig->state = BT_ISO_CIG_STATE_INACTIVE; in bt_iso_chan_disconnected()
1717 static struct net_buf *hci_le_set_cig_params(const struct bt_iso_cig *cig, in hci_le_set_cig_params() argument
1736 req->cig_id = cig->id; in hci_le_set_cig_params()
1750 cig->id, param->c_to_p_latency, param->p_to_c_latency, param->c_to_p_interval, in hci_le_set_cig_params()
1806 static struct net_buf *hci_le_set_cig_test_params(const struct bt_iso_cig *cig, in hci_le_set_cig_test_params() argument
1825 req->cig_id = cig->id; in hci_le_set_cig_test_params()
1839 cig->id, param->c_to_p_interval, param->p_to_c_interval, param->c_to_p_ft, in hci_le_set_cig_test_params()
1962 static bool cis_is_in_cig(const struct bt_iso_cig *cig, const struct bt_iso_chan *cis) in cis_is_in_cig() argument
1964 if (cig == NULL || cis == NULL || cis->iso == NULL) { in cis_is_in_cig()
1968 return cig->id == cis->iso->iso.cig_id; in cis_is_in_cig()
1971 static int cig_init_cis(struct bt_iso_cig *cig, const struct bt_iso_cig_param *param) in cig_init_cis() argument
1986 iso_conn->cig_id = cig->id; in cig_init_cis()
1988 iso_conn->cis_id = cig->num_cis++; in cig_init_cis()
1992 sys_slist_append(&cig->cis_channels, &cis->node); in cig_init_cis()
1999 static void cleanup_cig(struct bt_iso_cig *cig) in cleanup_cig() argument
2003 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&cig->cis_channels, cis, tmp, node) { in cleanup_cig()
2009 sys_slist_remove(&cig->cis_channels, NULL, &cis->node); in cleanup_cig()
2012 memset(cig, 0, sizeof(*cig)); in cleanup_cig()
2016 const struct bt_iso_cig *cig) in valid_cig_param() argument
2038 if (cis->iso != NULL && !cis_is_in_cig(cig, cis)) { in valid_cig_param()
2138 struct bt_iso_cig *cig; in bt_iso_cig_create() local
2181 cig = get_free_cig(); in bt_iso_cig_create()
2183 if (!cig) { in bt_iso_cig_create()
2187 err = cig_init_cis(cig, param); in bt_iso_cig_create()
2190 cleanup_cig(cig); in bt_iso_cig_create()
2195 rsp = hci_le_set_cig_params(cig, param); in bt_iso_cig_create()
2198 rsp = hci_le_set_cig_test_params(cig, param); in bt_iso_cig_create()
2205 cleanup_cig(cig); in bt_iso_cig_create()
2215 cleanup_cig(cig); in bt_iso_cig_create()
2220 SYS_SLIST_FOR_EACH_CONTAINER(&cig->cis_channels, cis, node) { in bt_iso_cig_create()
2229 *out_cig = cig; in bt_iso_cig_create()
2234 static void restore_cig(struct bt_iso_cig *cig, uint8_t existing_num_cis) in restore_cig() argument
2238 SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&cig->cis_channels, cis, tmp, node) { in restore_cig()
2247 sys_slist_remove(&cig->cis_channels, NULL, &cis->node); in restore_cig()
2248 cig->num_cis--; in restore_cig()
2253 int bt_iso_cig_reconfigure(struct bt_iso_cig *cig, const struct bt_iso_cig_param *param) in bt_iso_cig_reconfigure() argument
2261 CHECKIF(cig == NULL) { in bt_iso_cig_reconfigure()
2271 if (cig->state != BT_ISO_CIG_STATE_CONFIGURED) { in bt_iso_cig_reconfigure()
2272 LOG_DBG("Invalid CIG state: %u", cig->state); in bt_iso_cig_reconfigure()
2280 CHECKIF(!valid_cig_param(param, advanced, cig)) { in bt_iso_cig_reconfigure()
2286 existing_num_cis = cig->num_cis; in bt_iso_cig_reconfigure()
2288 err = cig_init_cis(cig, param); in bt_iso_cig_reconfigure()
2291 restore_cig(cig, existing_num_cis); in bt_iso_cig_reconfigure()
2296 rsp = hci_le_set_cig_params(cig, param); in bt_iso_cig_reconfigure()
2299 rsp = hci_le_set_cig_test_params(cig, param); in bt_iso_cig_reconfigure()
2306 restore_cig(cig, existing_num_cis); in bt_iso_cig_reconfigure()
2317 restore_cig(cig, existing_num_cis); in bt_iso_cig_reconfigure()
2326 restore_cig(cig, existing_num_cis); in bt_iso_cig_reconfigure()
2343 int bt_iso_cig_terminate(struct bt_iso_cig *cig) in bt_iso_cig_terminate() argument
2347 CHECKIF(cig == NULL) { in bt_iso_cig_terminate()
2352 if (cig->state != BT_ISO_CIG_STATE_INACTIVE && cig->state != BT_ISO_CIG_STATE_CONFIGURED) { in bt_iso_cig_terminate()
2353 LOG_DBG("Invalid CIG state: %u", cig->state); in bt_iso_cig_terminate()
2357 err = hci_le_remove_cig(cig->id); in bt_iso_cig_terminate()
2363 cleanup_cig(cig); in bt_iso_cig_terminate()
2448 struct bt_iso_cig *cig = get_cig(iso_chan); in bt_iso_security_changed() local
2450 __ASSERT(cig != NULL, "CIG was NULL"); in bt_iso_security_changed()
2451 cig->state = BT_ISO_CIG_STATE_ACTIVE; in bt_iso_security_changed()
2648 struct bt_iso_cig *cig; in bt_iso_chan_connect() local
2658 cig = get_cig(iso_chan); in bt_iso_chan_connect()
2659 __ASSERT(cig != NULL, "CIG was NULL"); in bt_iso_chan_connect()
2660 cig->state = BT_ISO_CIG_STATE_ACTIVE; in bt_iso_chan_connect()
3563 struct bt_iso_cig *cig = &cigs[i]; in bt_iso_reset() local
3571 SYS_SLIST_FOR_EACH_CONTAINER(&cig->cis_channels, cis, node) { in bt_iso_reset()
3581 cleanup_cig(cig); in bt_iso_reset()