Lines Matching refs:as_idx
123 get_as_data_ep(struct usbd_class_data *const c_data, int as_idx) in get_as_data_ep() argument
136 if ((as_idx >= 0) && (as_idx < cfg->num_ifaces) && in get_as_data_ep()
137 cfg->ep_indexes[as_idx] && descriptors) { in get_as_data_ep()
138 desc = descriptors[cfg->ep_indexes[as_idx]]; in get_as_data_ep()
145 get_as_feedback_ep(struct usbd_class_data *const c_data, int as_idx) in get_as_feedback_ep() argument
158 if ((as_idx < cfg->num_ifaces) && cfg->fb_indexes[as_idx] && in get_as_feedback_ep()
160 desc = descriptors[cfg->fb_indexes[as_idx]]; in get_as_feedback_ep()
200 for (int as_idx = 0; as_idx < cfg->num_ifaces; as_idx++) { in terminal_to_as_interface() local
201 if (terminal == cfg->as_terminals[as_idx]) { in terminal_to_as_interface()
202 return as_idx; in terminal_to_as_interface()
253 int as_idx = terminal_to_as_interface(dev, terminal); in usbd_uac2_send() local
256 desc = get_as_data_ep(cfg->c_data, as_idx); in usbd_uac2_send()
266 if (!atomic_test_bit(&ctx->as_active, as_idx)) { in usbd_uac2_send()
272 if (atomic_test_and_set_bit(queued_bits, as_idx)) { in usbd_uac2_send()
274 if (atomic_test_and_set_bit(queued_bits, as_idx)) { in usbd_uac2_send()
286 atomic_clear_bit(queued_bits, as_idx); in usbd_uac2_send()
295 atomic_clear_bit(queued_bits, as_idx); in usbd_uac2_send()
310 int as_idx = terminal_to_as_interface(dev, terminal); in schedule_iso_out_read() local
316 __ASSERT_NO_MSG((as_idx >= 0) && (as_idx < cfg->num_ifaces)); in schedule_iso_out_read()
320 if (!((as_idx >= 0) && atomic_test_bit(&ctx->as_active, as_idx))) { in schedule_iso_out_read()
325 if (atomic_test_and_set_bit(&ctx->as_queued, as_idx)) { in schedule_iso_out_read()
334 atomic_clear_bit(&ctx->as_queued, as_idx); in schedule_iso_out_read()
347 atomic_clear_bit(&ctx->as_queued, as_idx); in schedule_iso_out_read()
355 atomic_clear_bit(&ctx->as_queued, as_idx); in schedule_iso_out_read()
368 int as_idx = terminal_to_as_interface(dev, terminal); in write_explicit_feedback() local
371 __ASSERT_NO_MSG(as_idx >= 0); in write_explicit_feedback()
395 ctx->fb_queued |= BIT(as_idx); in write_explicit_feedback()
409 uint8_t as_idx; in uac2_update() local
436 as_idx = iface - iad->bFirstInterface - 1; in uac2_update()
439 ctx->ops->terminal_update_cb(dev, cfg->as_terminals[as_idx], alternate, in uac2_update()
446 atomic_clear_bit(&ctx->as_active, as_idx); in uac2_update()
450 atomic_set_bit(&ctx->as_active, as_idx); in uac2_update()
452 data_ep = get_as_data_ep(c_data, as_idx); in uac2_update()
461 cfg->as_terminals[as_idx]); in uac2_update()
463 fb_ep = get_as_feedback_ep(c_data, as_idx); in uac2_update()
466 cfg->as_terminals[as_idx]); in uac2_update()
746 int as_idx; in uac2_request() local
762 as_idx = ep_to_as_interface(dev, ep, &is_feedback); in uac2_request()
763 __ASSERT_NO_MSG((as_idx >= 0) && (as_idx < cfg->num_ifaces)); in uac2_request()
764 terminal = cfg->as_terminals[as_idx]; in uac2_request()
767 ctx->fb_queued &= ~BIT(as_idx); in uac2_request()
768 } else if (!atomic_test_and_clear_bit(&ctx->as_queued, as_idx) || buf->frags) { in uac2_request()
769 atomic_clear_bit(&ctx->as_double, as_idx); in uac2_request()
788 write_explicit_feedback(c_data, ep, cfg->as_terminals[as_idx]); in uac2_request()
801 int as_idx; in uac2_sof() local
805 for (as_idx = 0; as_idx < cfg->num_ifaces; as_idx++) { in uac2_sof()
810 data_ep = get_as_data_ep(c_data, as_idx); in uac2_sof()
814 cfg->as_terminals[as_idx]); in uac2_sof()
818 feedback_ep = get_as_feedback_ep(c_data, as_idx); in uac2_sof()
827 if (ctx->fb_queued & BIT(as_idx)) { in uac2_sof()
832 if (!atomic_test_bit(&ctx->as_active, as_idx)) { in uac2_sof()
841 cfg->as_terminals[as_idx]); in uac2_sof()