Lines Matching refs:iso
38 struct bt_bap_iso *iso = NULL; in bt_bap_iso_new() local
42 iso = &iso_pool[i]; in bt_bap_iso_new()
47 if (!iso) { in bt_bap_iso_new()
51 (void)memset(iso, 0, offsetof(struct bt_bap_iso, ref)); in bt_bap_iso_new()
53 return iso; in bt_bap_iso_new()
56 struct bt_bap_iso *bt_bap_iso_ref(struct bt_bap_iso *iso) in bt_bap_iso_ref() argument
60 __ASSERT_NO_MSG(iso != NULL); in bt_bap_iso_ref()
68 old = atomic_get(&iso->ref); in bt_bap_iso_ref()
73 } while (!atomic_cas(&iso->ref, old, old + 1)); in bt_bap_iso_ref()
75 return iso; in bt_bap_iso_ref()
78 void bt_bap_iso_unref(struct bt_bap_iso *iso) in bt_bap_iso_unref() argument
82 __ASSERT_NO_MSG(iso != NULL); in bt_bap_iso_unref()
84 old = atomic_dec(&iso->ref); in bt_bap_iso_unref()
92 struct bt_bap_iso *iso = bt_bap_iso_ref(&iso_pool[i]); in bt_bap_iso_foreach() local
95 if (!iso) { in bt_bap_iso_foreach()
99 iter = func(iso, user_data); in bt_bap_iso_foreach()
100 bt_bap_iso_unref(iso); in bt_bap_iso_foreach()
109 struct bt_bap_iso *iso; member
114 static bool bt_bap_iso_find_cb(struct bt_bap_iso *iso, void *user_data) in bt_bap_iso_find_cb() argument
119 found = param->func(iso, param->user_data); in bt_bap_iso_find_cb()
121 param->iso = bt_bap_iso_ref(iso); in bt_bap_iso_find_cb()
130 .iso = NULL, in bt_bap_iso_find()
137 return param.iso; in bt_bap_iso_find()
140 void bt_bap_iso_init(struct bt_bap_iso *iso, struct bt_iso_chan_ops *ops) in bt_bap_iso_init() argument
142 iso->chan.ops = ops; in bt_bap_iso_init()
143 iso->chan.qos = &iso->qos; in bt_bap_iso_init()
149 iso->chan.qos->rx = &iso->rx.qos; in bt_bap_iso_init()
150 iso->chan.qos->tx = &iso->tx.qos; in bt_bap_iso_init()
153 static struct bt_bap_iso_dir *bap_iso_get_iso_dir(bool unicast_client, struct bt_bap_iso *iso, in bap_iso_get_iso_dir() argument
160 return &iso->rx; in bap_iso_get_iso_dir()
162 return &iso->tx; in bap_iso_get_iso_dir()
167 return &iso->rx; in bap_iso_get_iso_dir()
169 return &iso->tx; in bap_iso_get_iso_dir()
175 struct bt_bap_iso *bap_iso = ep->iso; in bt_bap_iso_configure_data_path()
215 void bt_bap_iso_bind_ep(struct bt_bap_iso *iso, struct bt_bap_ep *ep) in bt_bap_iso_bind_ep() argument
220 __ASSERT_NO_MSG(iso != NULL); in bt_bap_iso_bind_ep()
221 __ASSERT(ep->iso == NULL, "ep %p bound with iso %p already", ep, ep->iso); in bt_bap_iso_bind_ep()
225 LOG_DBG("iso %p ep %p dir %s", iso, ep, bt_audio_dir_str(ep->dir)); in bt_bap_iso_bind_ep()
227 iso_dir = bap_iso_get_iso_dir(is_unicast_client_ep(ep), iso, ep->dir); in bt_bap_iso_bind_ep()
228 __ASSERT(iso_dir->ep == NULL, "iso %p bound with ep %p", iso, iso_dir); in bt_bap_iso_bind_ep()
231 ep->iso = bt_bap_iso_ref(iso); in bt_bap_iso_bind_ep()
234 void bt_bap_iso_unbind_ep(struct bt_bap_iso *iso, struct bt_bap_ep *ep) in bt_bap_iso_unbind_ep() argument
239 __ASSERT_NO_MSG(iso != NULL); in bt_bap_iso_unbind_ep()
240 __ASSERT(ep->iso == iso, "ep %p not bound with iso %p, was bound to %p", in bt_bap_iso_unbind_ep()
241 ep, iso, ep->iso); in bt_bap_iso_unbind_ep()
245 LOG_DBG("iso %p ep %p dir %s", iso, ep, bt_audio_dir_str(ep->dir)); in bt_bap_iso_unbind_ep()
247 iso_dir = bap_iso_get_iso_dir(is_unicast_client_ep(ep), iso, ep->dir); in bt_bap_iso_unbind_ep()
248 __ASSERT(iso_dir->ep == ep, "iso %p not bound with ep %p", iso, ep); in bt_bap_iso_unbind_ep()
251 bt_bap_iso_unref(ep->iso); in bt_bap_iso_unbind_ep()
252 ep->iso = NULL; in bt_bap_iso_unbind_ep()
255 struct bt_bap_ep *bt_bap_iso_get_ep(bool unicast_client, struct bt_bap_iso *iso, in bt_bap_iso_get_ep() argument
263 LOG_DBG("iso %p dir %s", iso, bt_audio_dir_str(dir)); in bt_bap_iso_get_ep()
265 iso_dir = bap_iso_get_iso_dir(unicast_client, iso, dir); in bt_bap_iso_get_ep()
272 if (ep->iso->rx.ep == ep) { in bt_bap_iso_get_paired_ep()
273 return ep->iso->tx.ep; in bt_bap_iso_get_paired_ep()
275 return ep->iso->rx.ep; in bt_bap_iso_get_paired_ep()
332 struct bt_bap_stream *bt_bap_iso_get_stream(struct bt_bap_iso *iso, enum bt_audio_dir dir) in bt_bap_iso_get_stream() argument
337 LOG_DBG("iso %p dir %s", iso, bt_audio_dir_str(dir)); in bt_bap_iso_get_stream()
341 return iso->rx.stream; in bt_bap_iso_get_stream()
343 return iso->tx.stream; in bt_bap_iso_get_stream()