Lines Matching full:ep

69 #define ASE_ID(_ase) ase->ep.status.id
79 struct bt_bap_ep ep; member
128 static int ascs_ep_get_status(struct bt_bap_ep *ep, struct net_buf_simple *buf);
181 static enum bt_bap_ep_state ascs_ep_get_state(struct bt_bap_ep *ep) in ascs_ep_get_state() argument
183 return ep->status.state; in ascs_ep_get_state()
190 LOG_DBG("conn %p ase %p id 0x%02x", (void *)ase->conn, ase, ase->ep.status.id); in ase_free()
192 if (ase->ep.iso != NULL) { in ase_free()
193 bt_bap_iso_unbind_ep(ase->ep.iso, &ase->ep); in ase_free()
239 ascs_ep_get_status(&ase->ep, &ase_buf); in ase_state_notify()
261 struct bt_bap_ep *ep = &ase->ep; in ascs_disconnect_stream_work_handler() local
262 struct bt_bap_stream *stream = ep->stream; in ascs_disconnect_stream_work_handler()
265 __ASSERT(ep != NULL && ep->iso && stream != NULL, in ascs_disconnect_stream_work_handler()
267 ep, ep == NULL ? NULL : ep->iso, stream); in ascs_disconnect_stream_work_handler()
269 if (ep->dir == BT_AUDIO_DIR_SINK) { in ascs_disconnect_stream_work_handler()
270 pair_stream = ep->iso->tx.stream; in ascs_disconnect_stream_work_handler()
272 pair_stream = ep->iso->rx.stream; in ascs_disconnect_stream_work_handler()
275 LOG_DBG("ase %p ep %p stream %p pair_stream %p", in ascs_disconnect_stream_work_handler()
276 ase, ep, stream, pair_stream); in ascs_disconnect_stream_work_handler()
281 __ASSERT(pair_stream->ep != NULL, "Invalid pair_stream %p", in ascs_disconnect_stream_work_handler()
284 if (pair_stream->ep->status.state == BT_BAP_EP_STATE_STREAMING) { in ascs_disconnect_stream_work_handler()
292 pair_ase = CONTAINER_OF(pair_stream->ep, struct bt_ascs_ase, in ascs_disconnect_stream_work_handler()
293 ep); in ascs_disconnect_stream_work_handler()
300 ep->iso != NULL && in ascs_disconnect_stream_work_handler()
301 (ep->iso->chan.state == BT_ISO_STATE_CONNECTED || in ascs_disconnect_stream_work_handler()
302 ep->iso->chan.state == BT_ISO_STATE_CONNECTING)) { in ascs_disconnect_stream_work_handler()
314 struct bt_ascs_ase *ase = CONTAINER_OF(stream->ep, struct bt_ascs_ase, in ascs_disconnect_stream()
315 ep); in ascs_disconnect_stream()
325 struct bt_bap_stream *stream = ase->ep.stream; in ase_enter_state_idle()
330 ase->ep.receiver_ready = false; in ase_enter_state_idle()
347 struct bt_bap_stream *stream = ase->ep.stream; in ase_enter_state_codec_configured()
352 ase->ep.receiver_ready = false; in ase_enter_state_codec_configured()
356 ops->configured(stream, &ase->ep.qos_pref); in ase_enter_state_codec_configured()
362 struct bt_bap_stream *stream = ase->ep.stream; in ase_enter_state_qos_configured()
367 ase->ep.receiver_ready = false; in ase_enter_state_qos_configured()
377 struct bt_bap_stream *stream = ase->ep.stream; in ase_enter_state_enabling()
388 if (ase->ep.dir == BT_AUDIO_DIR_SINK && ase->ep.receiver_ready && ase->ep.iso != NULL && in ase_enter_state_enabling()
389 ase->ep.iso->chan.state == BT_ISO_STATE_CONNECTED) { in ase_enter_state_enabling()
390 ascs_ep_set_state(&ase->ep, BT_BAP_EP_STATE_STREAMING); in ase_enter_state_enabling()
396 struct bt_bap_stream *stream = ase->ep.stream; in ase_enter_state_streaming()
409 struct bt_bap_stream *stream = ase->ep.stream; in ase_metadata_updated()
422 struct bt_bap_stream *stream = ase->ep.stream; in ase_exit_state_streaming()
424 const enum bt_bap_ep_state next_state = ascs_ep_get_state(&ase->ep); in ase_exit_state_streaming()
425 uint8_t reason = ase->ep.reason; in ase_exit_state_streaming()
458 struct bt_bap_stream *stream = ase->ep.stream; in ase_exit_state_enabling()
460 const enum bt_bap_ep_state next_state = ascs_ep_get_state(&ase->ep); in ase_exit_state_enabling()
465 * When the EP direction is BT_AUDIO_DIR_SOURCE the state machine goes from in ase_exit_state_enabling()
470 if (next_state == BT_BAP_EP_STATE_QOS_CONFIGURED && ase->ep.dir == BT_AUDIO_DIR_SINK) { in ase_exit_state_enabling()
481 struct bt_bap_stream *stream = ase->ep.stream; in ase_enter_state_disabling()
486 ase->ep.receiver_ready = false; in ase_enter_state_disabling()
496 struct bt_bap_stream *stream = ase->ep.stream; in ase_enter_state_releasing()
500 ase->ep.receiver_ready = false; in ase_enter_state_releasing()
513 ascs_ep_set_state(&ase->ep, BT_BAP_EP_STATE_IDLE); in ase_enter_state_releasing()
521 const enum bt_bap_ep_state old_state = ascs_ep_get_state(&ase->ep); in state_transition_work_handler()
525 ase->ep.status.state = new_state; in state_transition_work_handler()
535 ase->ep.status.state = old_state; in state_transition_work_handler()
556 LOG_DBG("ase %p ep %p id 0x%02x %s -> %s", ase, &ase->ep, ase->ep.status.id, in state_transition_work_handler()
610 int ascs_ep_set_state(struct bt_bap_ep *ep, uint8_t state) in ascs_ep_set_state() argument
612 struct bt_ascs_ase *ase = CONTAINER_OF(ep, struct bt_ascs_ase, ep); in ascs_ep_set_state()
613 const enum bt_bap_ep_state old_state = ascs_ep_get_state(&ase->ep); in ascs_ep_set_state()
639 valid_state_transition = ase->ep.dir == BT_AUDIO_DIR_SOURCE; in ascs_ep_set_state()
646 valid_state_transition = ase->ep.dir == BT_AUDIO_DIR_SINK || in ascs_ep_set_state()
674 valid_state_transition = ase->ep.dir == BT_AUDIO_DIR_SOURCE; in ascs_ep_set_state()
688 valid_state_transition = ase->ep.dir == BT_AUDIO_DIR_SOURCE; in ascs_ep_set_state()
713 static void ascs_ep_get_status_config(struct bt_bap_ep *ep, struct net_buf_simple *buf) in ascs_ep_get_status_config() argument
716 struct bt_bap_qos_cfg_pref *pref = &ep->qos_pref; in ascs_ep_get_status_config()
728 cfg->codec.id = ep->codec_cfg.id; in ascs_ep_get_status_config()
729 cfg->codec.cid = sys_cpu_to_le16(ep->codec_cfg.cid); in ascs_ep_get_status_config()
730 cfg->codec.vid = sys_cpu_to_le16(ep->codec_cfg.vid); in ascs_ep_get_status_config()
734 bt_audio_dir_str(ep->dir), pref->unframed_supported, pref->phy, pref->rtn, in ascs_ep_get_status_config()
736 ep->stream->codec_cfg->id); in ascs_ep_get_status_config()
738 cfg->cc_len = ep->codec_cfg.data_len; in ascs_ep_get_status_config()
739 net_buf_simple_add_mem(buf, ep->codec_cfg.data, ep->codec_cfg.data_len); in ascs_ep_get_status_config()
742 static void ascs_ep_get_status_qos(struct bt_bap_ep *ep, struct net_buf_simple *buf) in ascs_ep_get_status_qos() argument
747 qos->cig_id = ep->cig_id; in ascs_ep_get_status_qos()
748 qos->cis_id = ep->cis_id; in ascs_ep_get_status_qos()
749 sys_put_le24(ep->stream->qos->interval, qos->interval); in ascs_ep_get_status_qos()
750 qos->framing = ep->stream->qos->framing; in ascs_ep_get_status_qos()
751 qos->phy = ep->stream->qos->phy; in ascs_ep_get_status_qos()
752 qos->sdu = sys_cpu_to_le16(ep->stream->qos->sdu); in ascs_ep_get_status_qos()
753 qos->rtn = ep->stream->qos->rtn; in ascs_ep_get_status_qos()
754 qos->latency = sys_cpu_to_le16(ep->stream->qos->latency); in ascs_ep_get_status_qos()
755 sys_put_le24(ep->stream->qos->pd, qos->pd); in ascs_ep_get_status_qos()
759 bt_audio_dir_str(ep->dir), ep->stream->codec_cfg->id, ep->stream->qos->interval, in ascs_ep_get_status_qos()
760 ep->stream->qos->framing, ep->stream->qos->phy, ep->stream->qos->rtn, in ascs_ep_get_status_qos()
761 ep->stream->qos->latency, ep->stream->qos->pd); in ascs_ep_get_status_qos()
764 static void ascs_ep_get_status_enable(struct bt_bap_ep *ep, struct net_buf_simple *buf) in ascs_ep_get_status_enable() argument
769 enable->cig_id = ep->cig_id; in ascs_ep_get_status_enable()
770 enable->cis_id = ep->cis_id; in ascs_ep_get_status_enable()
772 enable->metadata_len = ep->codec_cfg.meta_len; in ascs_ep_get_status_enable()
773 net_buf_simple_add_mem(buf, ep->codec_cfg.meta, ep->codec_cfg.meta_len); in ascs_ep_get_status_enable()
776 bt_audio_dir_str(ep->dir), ep->cig_id, ep->cis_id); in ascs_ep_get_status_enable()
792 static int ascs_ep_get_status(struct bt_bap_ep *ep, struct net_buf_simple *buf) in ascs_ep_get_status() argument
794 if (!ep || !buf) { in ascs_ep_get_status()
798 LOG_DBG("ep %p id 0x%02x state %s", ep, ep->status.id, in ascs_ep_get_status()
799 bt_bap_ep_state_str(ep->status.state)); in ascs_ep_get_status()
804 (void)net_buf_simple_add_mem(buf, &ep->status, sizeof(ep->status)); in ascs_ep_get_status()
806 switch (ep->status.state) { in ascs_ep_get_status()
812 ascs_ep_get_status_config(ep, buf); in ascs_ep_get_status()
815 ascs_ep_get_status_qos(ep, buf); in ascs_ep_get_status()
822 ascs_ep_get_status_enable(ep, buf); in ascs_ep_get_status()
842 ase->ep.cig_id != info->cig_id || in ascs_iso_accept()
843 ase->ep.cis_id != info->cis_id) { in ascs_iso_accept()
847 state = ascs_ep_get_state(&ase->ep); in ascs_iso_accept()
853 __ASSERT(ase->ep.iso != NULL, "ep %p not bound with ISO", &ase->ep); in ascs_iso_accept()
855 chan = &ase->ep.iso->chan; in ascs_iso_accept()
879 struct bt_bap_ep *ep; in ascs_iso_recv() local
881 ep = iso->rx.ep; in ascs_iso_recv()
882 if (ep == NULL) { in ascs_iso_recv()
892 LOG_DBG("Valid ISO packet of len %zu received for iso %p not bound with ep", in ascs_iso_recv()
899 if (ep->status.state != BT_BAP_EP_STATE_STREAMING) { in ascs_iso_recv()
901 LOG_DBG("ep %p is not in the streaming state: %s", ep, in ascs_iso_recv()
902 bt_bap_ep_state_str(ep->status.state)); in ascs_iso_recv()
908 stream = ep->stream; in ascs_iso_recv()
910 LOG_ERR("No stream for ep %p", ep); in ascs_iso_recv()
917 LOG_DBG("stream %p ep %p len %zu", stream, stream->ep, net_buf_frags_len(buf)); in ascs_iso_recv()
934 struct bt_bap_ep *ep; in ascs_iso_sent() local
936 ep = iso->tx.ep; in ascs_iso_sent()
937 if (ep == NULL) { in ascs_iso_sent()
938 LOG_ERR("iso %p not bound with ep", chan); in ascs_iso_sent()
942 stream = ep->stream; in ascs_iso_sent()
944 LOG_ERR("No stream for ep %p", ep); in ascs_iso_sent()
951 LOG_DBG("stream %p ep %p", stream, stream->ep); in ascs_iso_sent()
960 static void ascs_update_sdu_size(struct bt_bap_ep *ep) in ascs_update_sdu_size() argument
963 struct bt_bap_qos_cfg *qos_cfg = &ep->qos; in ascs_update_sdu_size()
965 if (ep->dir == BT_AUDIO_DIR_SINK) { in ascs_update_sdu_size()
966 io_qos = ep->iso->chan.qos->rx; in ascs_update_sdu_size()
967 } else if (ep->dir == BT_AUDIO_DIR_SOURCE) { in ascs_update_sdu_size()
968 io_qos = ep->iso->chan.qos->tx; in ascs_update_sdu_size()
977 static void ascs_ep_iso_connected(struct bt_bap_ep *ep) in ascs_ep_iso_connected() argument
979 struct bt_ascs_ase *ase = CONTAINER_OF(ep, struct bt_ascs_ase, ep); in ascs_ep_iso_connected()
983 if (ep->status.state != BT_BAP_EP_STATE_ENABLING) { in ascs_ep_iso_connected()
984 LOG_DBG("ep %p not in enabling state: %s", ep, in ascs_ep_iso_connected()
985 bt_bap_ep_state_str(ep->status.state)); in ascs_ep_iso_connected()
989 stream = ep->stream; in ascs_ep_iso_connected()
991 LOG_ERR("No stream for ep %p", ep); in ascs_ep_iso_connected()
996 ep->reason = BT_HCI_ERR_SUCCESS; in ascs_ep_iso_connected()
1003 ascs_update_sdu_size(ep); in ascs_ep_iso_connected()
1005 LOG_DBG("stream %p ep %p dir %s", stream, ep, bt_audio_dir_str(ep->dir)); in ascs_ep_iso_connected()
1017 if (ep->dir == BT_AUDIO_DIR_SINK && ep->receiver_ready) { in ascs_ep_iso_connected()
1022 ascs_ep_set_state(ep, BT_BAP_EP_STATE_STREAMING); in ascs_ep_iso_connected()
1030 if (iso->rx.ep == NULL && iso->tx.ep == NULL) { in ascs_iso_connected()
1031 LOG_ERR("iso %p not bound with ep", chan); in ascs_iso_connected()
1035 if (iso->rx.ep != NULL) { in ascs_iso_connected()
1036 ascs_ep_iso_connected(iso->rx.ep); in ascs_iso_connected()
1039 if (iso->tx.ep != NULL) { in ascs_iso_connected()
1040 ascs_ep_iso_connected(iso->tx.ep); in ascs_iso_connected()
1044 static void ascs_ep_iso_disconnected(struct bt_bap_ep *ep, uint8_t reason) in ascs_ep_iso_disconnected() argument
1046 struct bt_ascs_ase *ase = CONTAINER_OF(ep, struct bt_ascs_ase, ep); in ascs_ep_iso_disconnected()
1050 stream = ep->stream; in ascs_ep_iso_disconnected()
1052 LOG_ERR("No stream for ep %p", ep); in ascs_ep_iso_disconnected()
1056 LOG_DBG("stream %p ep %p state %s reason 0x%02x", stream, stream->ep, in ascs_ep_iso_disconnected()
1057 bt_bap_ep_state_str(ep->status.state), reason); in ascs_ep_iso_disconnected()
1066 ep->reason = reason; in ascs_ep_iso_disconnected()
1068 if (ep->status.state == BT_BAP_EP_STATE_RELEASING) { in ascs_ep_iso_disconnected()
1069 ascs_ep_set_state(ep, BT_BAP_EP_STATE_IDLE); in ascs_ep_iso_disconnected()
1070 } else if (ep->status.state == BT_BAP_EP_STATE_STREAMING || in ascs_ep_iso_disconnected()
1071 ep->status.state == BT_BAP_EP_STATE_DISABLING) { in ascs_ep_iso_disconnected()
1080 ascs_ep_set_state(ep, BT_BAP_EP_STATE_QOS_CONFIGURED); in ascs_ep_iso_disconnected()
1088 if (iso->rx.ep == NULL && iso->tx.ep == NULL) { in ascs_iso_disconnected()
1092 if (iso->rx.ep != NULL) { in ascs_iso_disconnected()
1093 ascs_ep_iso_disconnected(iso->rx.ep, reason); in ascs_iso_disconnected()
1096 if (iso->tx.ep != NULL) { in ascs_iso_disconnected()
1097 ascs_ep_iso_disconnected(iso->tx.ep, reason); in ascs_iso_disconnected()
1178 enum bt_bap_ep_state state = ascs_ep_get_state(&ase->ep); in ase_release()
1194 err = unicast_server_cb->release(ase->ep.stream, rsp); in ase_release()
1206 ase->ep.reason = reason; in ase_release()
1208 ascs_ep_set_state(&ase->ep, BT_BAP_EP_STATE_RELEASING); in ase_release()
1214 int bt_ascs_release_ase(struct bt_bap_ep *ep) in bt_ascs_release_ase() argument
1216 struct bt_ascs_ase *ase = CONTAINER_OF(ep, struct bt_ascs_ase, ep); in bt_ascs_release_ase()
1217 const enum bt_bap_ep_state state = ascs_ep_get_state(&ase->ep); in bt_ascs_release_ase()
1230 struct bt_bap_ep *ep; in ase_disable() local
1235 ep = &ase->ep; in ase_disable()
1237 switch (ep->status.state) { in ase_disable()
1244 LOG_WRN("Invalid operation in state: %s", bt_bap_ep_state_str(ep->status.state)); in ase_disable()
1250 stream = ep->stream; in ase_disable()
1269 ep->reason = reason; in ase_disable()
1274 if (ep->dir == BT_AUDIO_DIR_SOURCE) { in ase_disable()
1275 ascs_ep_set_state(ep, BT_BAP_EP_STATE_DISABLING); in ase_disable()
1277 ascs_ep_set_state(ep, BT_BAP_EP_STATE_QOS_CONFIGURED); in ase_disable()
1284 int bt_ascs_disable_ase(struct bt_bap_ep *ep) in bt_ascs_disable_ase() argument
1286 struct bt_ascs_ase *ase = CONTAINER_OF(ep, struct bt_ascs_ase, ep); in bt_ascs_disable_ase()
1300 if (ase->ep.status.state != BT_BAP_EP_STATE_IDLE) { in disconnected()
1309 ase->ep.reason = reason; in disconnected()
1330 const struct bt_bap_ep *ep; in bap_iso_find_func() local
1332 if (iso->rx.ep != NULL) { in bap_iso_find_func()
1333 ep = iso->rx.ep; in bap_iso_find_func()
1334 } else if (iso->tx.ep != NULL) { in bap_iso_find_func()
1335 ep = iso->tx.ep; in bap_iso_find_func()
1340 return ep->stream->conn == params->acl && in bap_iso_find_func()
1341 ep->cig_id == params->cig_id && in bap_iso_find_func()
1342 ep->cis_id == params->cis_id; in bap_iso_find_func()
1376 if (ase->ep.status.id == POINTER_TO_UINT(BT_AUDIO_CHRC_USER_DATA(attr))) { in ase_attr_cb()
1385 void ascs_ep_init(struct bt_bap_ep *ep, uint8_t id) in ascs_ep_init() argument
1387 LOG_DBG("ep %p id 0x%02x", ep, id); in ascs_ep_init()
1389 (void)memset(ep, 0, sizeof(*ep)); in ascs_ep_init()
1390 ep->status.id = id; in ascs_ep_init()
1391 ep->dir = ASE_DIR(id); in ascs_ep_init()
1392 ep->reason = BT_HCI_ERR_SUCCESS; in ascs_ep_init()
1399 ascs_ep_init(&ase->ep, id); in ase_init()
1441 if (ase->conn == conn && ase->ep.status.id == id) { in ase_find()
1477 ascs_ep_get_status(&ase->ep, &ase_buf); in ascs_ase_read()
1512 static int ascs_ep_set_codec(struct bt_bap_ep *ep, uint8_t id, uint16_t cid, uint16_t vid, in ascs_ep_set_codec() argument
1522 if (ep == NULL) { in ascs_ep_set_codec()
1528 codec_cfg = &ep->codec_cfg; in ascs_ep_set_codec()
1530 LOG_DBG("ep %p dir %s codec id 0x%02x cid 0x%04x vid 0x%04x len %u", in ascs_ep_set_codec()
1531 ep, bt_audio_dir_str(ep->dir), id, cid, vid, len); in ascs_ep_set_codec()
1533 bt_pacs_cap_foreach(ep->dir, codec_lookup_id, &lookup_data); in ascs_ep_set_codec()
1537 id, bt_audio_dir_str(ep->dir)); in ascs_ep_set_codec()
1591 switch (ase->ep.status.state) { in ase_config()
1601 bt_bap_ep_state_str(ase->ep.status.state)); in ase_config()
1610 (void)memcpy(&codec_cfg, &ase->ep.codec_cfg, sizeof(codec_cfg)); in ase_config()
1612 err = ascs_ep_set_codec(&ase->ep, cfg->codec.id, sys_le16_to_cpu(cfg->codec.cid), in ase_config()
1617 (void)memcpy(&ase->ep.codec_cfg, &codec_cfg, sizeof(codec_cfg)); in ase_config()
1622 if (ase->ep.stream != NULL) { in ase_config()
1625 err = unicast_server_cb->reconfig(ase->ep.stream, ase->ep.dir, in ase_config()
1626 &ase->ep.codec_cfg, &ase->ep.qos_pref, in ase_config()
1634 if (err == 0 && !bt_bap_valid_qos_pref(&ase->ep.qos_pref)) { in ase_config()
1655 (void)memcpy(&ase->ep.codec_cfg, &codec_cfg, sizeof(codec_cfg)); in ase_config()
1661 stream = ase->ep.stream; in ase_config()
1666 err = unicast_server_cb->config(ase->conn, &ase->ep, ase->ep.dir, in ase_config()
1667 &ase->ep.codec_cfg, &stream, in ase_config()
1668 &ase->ep.qos_pref, &rsp); in ase_config()
1675 if (err == 0 && !bt_bap_valid_qos_pref(&ase->ep.qos_pref)) { in ase_config()
1696 (void)memcpy(&ase->ep.codec_cfg, &codec_cfg, sizeof(codec_cfg)); in ase_config()
1707 bt_bap_stream_attach(ase->conn, stream, &ase->ep, &ase->ep.codec_cfg); in ase_config()
1709 ascs_ep_set_state(&ase->ep, BT_BAP_EP_STATE_CODEC_CONFIGURED); in ase_config()
1719 if (ase->conn == conn && ase->ep.stream == stream) { in ep_lookup_stream()
1720 return &ase->ep; in ep_lookup_stream()
1733 struct bt_bap_ep *ep; in bt_ascs_config_ase() local
1741 ep = ep_lookup_stream(conn, stream); in bt_ascs_config_ase()
1742 if (ep != NULL) { in bt_ascs_config_ase()
1760 ep = &ase->ep; in bt_ascs_config_ase()
1762 if (ep == NULL) { in bt_ascs_config_ase()
1770 bt_pacs_cap_foreach(ep->dir, codec_lookup_id, &lookup_data); in bt_ascs_config_ase()
1774 codec_cfg->id, bt_audio_dir_str(ep->dir)); in bt_ascs_config_ase()
1778 (void)memcpy(&ep->codec_cfg, codec_cfg, sizeof(ep->codec_cfg)); in bt_ascs_config_ase()
1780 ep->qos_pref = *qos_pref; in bt_ascs_config_ase()
1782 bt_bap_stream_attach(conn, stream, ep, &ep->codec_cfg); in bt_ascs_config_ase()
1784 err = ascs_ep_set_state(ep, BT_BAP_EP_STATE_CODEC_CONFIGURED); in bt_ascs_config_ase()
1931 func(&ase->ep, user_data); in bt_ascs_foreach_ep()
1939 struct bt_bap_ep *ep = &ase->ep; in ase_qos() local
1946 switch (ep->status.state) { in ase_qos()
1953 LOG_WRN("Invalid operation in state: %s", bt_bap_ep_state_str(ep->status.state)); in ase_qos()
1959 stream = ep->stream; in ase_qos()
1966 if (stream->ep == NULL) { in ase_qos()
1967 LOG_ERR("NULL stream->ep"); in ase_qos()
2000 if (ep->iso != NULL && (ep->cig_id != cig_id || ep->cis_id != cis_id)) { in ase_qos()
2001 bt_bap_iso_unbind_ep(ep->iso, ep); in ase_qos()
2004 if (ep->iso == NULL) { in ase_qos()
2015 if (bt_bap_iso_get_ep(false, iso, ep->dir) != NULL) { in ase_qos()
2017 &iso->chan, bt_audio_dir_str(ep->dir)); in ase_qos()
2024 bt_bap_iso_bind_ep(iso, ep); in ase_qos()
2029 ep->qos = *qos; in ase_qos()
2030 stream->qos = &ep->qos; in ase_qos()
2033 * we have the ISO <-> EP coupling completed (due to setting in ase_qos()
2036 bt_bap_iso_configure_data_path(ep, stream->codec_cfg); in ase_qos()
2038 ep->cig_id = cig_id; in ase_qos()
2039 ep->cis_id = cis_id; in ase_qos()
2041 ascs_ep_set_state(ep, BT_BAP_EP_STATE_QOS_CONFIGURED); in ase_qos()
2139 const struct bt_bap_ep *ep; member
2150 const struct bt_bap_ep *ep = result->ep; in ascs_parse_metadata() local
2186 if (!is_context_available(result->conn, ep->dir, context)) { in ascs_parse_metadata()
2212 if (!bt_cap_acceptor_ccid_exist(ep->stream->conn, ccid)) { in ascs_parse_metadata()
2268 static int ascs_verify_metadata(struct bt_bap_ep *ep, const struct bt_ascs_metadata *meta, in ascs_verify_metadata() argument
2271 struct bt_ascs_ase *ase = CONTAINER_OF(ep, struct bt_ascs_ase, ep); in ascs_verify_metadata()
2276 .ep = ep, in ascs_verify_metadata()
2307 struct bt_bap_ep *ep; in ase_metadata() local
2315 ep = &ase->ep; in ase_metadata()
2316 state = ep->status.state; in ase_metadata()
2331 stream = ep->stream; in ase_metadata()
2333 err = ascs_verify_metadata(ep, meta, &rsp); in ase_metadata()
2359 ep->codec_cfg.meta_len = meta->len; in ase_metadata()
2360 (void)memcpy(ep->codec_cfg.meta, meta->data, meta->len); in ase_metadata()
2363 ascs_ep_set_state(ep, ep->status.state); in ase_metadata()
2370 struct bt_bap_ep *ep; in ase_enable() local
2377 ep = &ase->ep; in ase_enable()
2380 if (ep->status.state != BT_BAP_EP_STATE_QOS_CONFIGURED) { in ase_enable()
2382 LOG_WRN("Invalid operation in state: %s", bt_bap_ep_state_str(ep->status.state)); in ase_enable()
2388 stream = ep->stream; in ase_enable()
2390 err = ascs_verify_metadata(ep, meta, &rsp); in ase_enable()
2417 ep->codec_cfg.meta_len = meta->len; in ase_enable()
2418 (void)memcpy(ep->codec_cfg.meta, meta->data, meta->len); in ase_enable()
2420 ascs_ep_set_state(ep, BT_BAP_EP_STATE_ENABLING); in ase_enable()
2514 struct bt_bap_ep *ep; in ase_start() local
2521 ep = &ase->ep; in ase_start()
2524 if (ep->status.state != BT_BAP_EP_STATE_ENABLING) { in ase_start()
2525 LOG_WRN("Invalid operation in state: %s", bt_bap_ep_state_str(ep->status.state)); in ase_start()
2531 if (ep->iso->chan.state != BT_ISO_STATE_CONNECTED) { in ase_start()
2536 ep->iso->chan.state); in ase_start()
2543 err = unicast_server_cb->start(ep->stream, &rsp); in ase_start()
2564 ep->receiver_ready = true; in ase_start()
2566 ascs_ep_set_state(ep, BT_BAP_EP_STATE_STREAMING); in ase_start()
2727 struct bt_bap_ep *ep; in ase_stop() local
2734 ep = &ase->ep; in ase_stop()
2736 if (ep->status.state != BT_BAP_EP_STATE_DISABLING) { in ase_stop()
2737 LOG_WRN("Invalid operation in state: %s", bt_bap_ep_state_str(ep->status.state)); in ase_stop()
2743 stream = ep->stream; in ase_stop()
2777 ascs_ep_set_state(ep, BT_BAP_EP_STATE_QOS_CONFIGURED); in ase_stop()
3265 bt_ascs_release_ase(&ase->ep); in bt_ascs_cleanup()
3285 if (ascs.ase_pool[i].ep.status.state != BT_BAP_EP_STATE_IDLE) { in bt_ascs_unregister()
3286 LOG_DBG("[%zu] ase %p not in idle state: %s", i, &ascs.ase_pool[i].ep, in bt_ascs_unregister()
3287 bt_bap_ep_state_str(ascs.ase_pool[i].ep.status.state)); in bt_ascs_unregister()