Lines Matching refs:ev
390 static inline void usbd_evt_free(struct usbd_event *ev) in usbd_evt_free() argument
392 k_mem_slab_free(&fifo_elem_slab, (void *)ev->block.data); in usbd_evt_free()
400 static inline void usbd_evt_put(struct usbd_event *ev) in usbd_evt_put() argument
402 k_fifo_put(&usbd_evt_fifo, ev); in usbd_evt_put()
418 struct usbd_event *ev; in usbd_evt_flush() local
421 ev = usbd_evt_get(); in usbd_evt_flush()
422 if (ev) { in usbd_evt_flush()
423 usbd_evt_free(ev); in usbd_evt_flush()
425 } while (ev != NULL); in usbd_evt_flush()
437 struct usbd_event *ev; in usbd_evt_alloc() local
458 ev = (struct usbd_event *)block.data; in usbd_evt_alloc()
459 ev->block = block; in usbd_evt_alloc()
460 ev->evt_type = USBD_EVT_REINIT; in usbd_evt_alloc()
461 usbd_evt_put(ev); in usbd_evt_alloc()
467 ev = (struct usbd_event *)block.data; in usbd_evt_alloc()
468 ev->block = block; in usbd_evt_alloc()
470 return ev; in usbd_evt_alloc()
475 struct usbd_event *ev = usbd_evt_alloc(); in submit_dc_power_event() local
477 if (!ev) { in submit_dc_power_event()
481 ev->evt_type = USBD_EVT_POWER; in submit_dc_power_event()
482 ev->evt.pwr_evt.state = state; in submit_dc_power_event()
484 usbd_evt_put(ev); in submit_dc_power_event()
855 struct usbd_event *ev = usbd_evt_alloc(); in usbd_event_transfer_ctrl() local
857 if (!ev) { in usbd_event_transfer_ctrl()
862 ev->evt_type = USBD_EVT_EP; in usbd_event_transfer_ctrl()
863 ev->evt.ep_evt.evt_type = EP_EVT_WRITE_COMPLETE; in usbd_event_transfer_ctrl()
864 ev->evt.ep_evt.ep = ep_ctx; in usbd_event_transfer_ctrl()
867 usbd_evt_put(ev); in usbd_event_transfer_ctrl()
888 struct usbd_event *ev = usbd_evt_alloc(); in usbd_event_transfer_ctrl() local
890 if (!ev) { in usbd_event_transfer_ctrl()
897 ev->evt_type = USBD_EVT_EP; in usbd_event_transfer_ctrl()
898 ev->evt.ep_evt.evt_type = EP_EVT_RECV_REQ; in usbd_event_transfer_ctrl()
899 ev->evt.ep_evt.ep = ep_ctx; in usbd_event_transfer_ctrl()
901 usbd_evt_put(ev); in usbd_event_transfer_ctrl()
908 struct usbd_event *ev = usbd_evt_alloc(); in usbd_event_transfer_ctrl() local
910 if (!ev) { in usbd_event_transfer_ctrl()
915 ev->evt_type = USBD_EVT_EP; in usbd_event_transfer_ctrl()
916 ev->evt.ep_evt.evt_type = EP_EVT_RECV_COMPLETE; in usbd_event_transfer_ctrl()
917 ev->evt.ep_evt.ep = ep_ctx; in usbd_event_transfer_ctrl()
937 usbd_evt_put(ev); in usbd_event_transfer_ctrl()
960 struct usbd_event *ev = usbd_evt_alloc(); in usbd_event_transfer_data() local
962 if (!ev) { in usbd_event_transfer_data()
970 ev->evt_type = USBD_EVT_EP; in usbd_event_transfer_data()
971 ev->evt.ep_evt.evt_type = EP_EVT_WRITE_COMPLETE; in usbd_event_transfer_data()
972 ev->evt.ep_evt.ep = ep_ctx; in usbd_event_transfer_data()
973 usbd_evt_put(ev); in usbd_event_transfer_data()
995 struct usbd_event *ev = usbd_evt_alloc(); in usbd_event_transfer_data() local
997 if (!ev) { in usbd_event_transfer_data()
1005 ev->evt_type = USBD_EVT_EP; in usbd_event_transfer_data()
1006 ev->evt.ep_evt.evt_type = EP_EVT_RECV_REQ; in usbd_event_transfer_data()
1007 ev->evt.ep_evt.ep = ep_ctx; in usbd_event_transfer_data()
1009 usbd_evt_put(ev); in usbd_event_transfer_data()
1015 struct usbd_event *ev = usbd_evt_alloc(); in usbd_event_transfer_data() local
1017 if (!ev) { in usbd_event_transfer_data()
1028 ev->evt_type = USBD_EVT_EP; in usbd_event_transfer_data()
1029 ev->evt.ep_evt.evt_type = EP_EVT_RECV_COMPLETE; in usbd_event_transfer_data()
1030 ev->evt.ep_evt.ep = ep_ctx; in usbd_event_transfer_data()
1032 usbd_evt_put(ev); in usbd_event_transfer_data()
1133 struct usbd_event *ev; in usbd_event_handler() local
1135 ev = usbd_evt_alloc(); in usbd_event_handler()
1136 if (!ev) { in usbd_event_handler()
1139 ev->evt_type = evt.evt_type; in usbd_event_handler()
1140 ev->evt = evt.evt; in usbd_event_handler()
1141 usbd_evt_put(ev); in usbd_event_handler()
1179 struct usbd_event *ev; in usbd_sof_trigger_iso_read() local
1194 ev = usbd_evt_alloc(); in usbd_sof_trigger_iso_read()
1195 if (!ev) { in usbd_sof_trigger_iso_read()
1199 ev->evt_type = USBD_EVT_EP; in usbd_sof_trigger_iso_read()
1200 ev->evt.ep_evt.evt_type = EP_EVT_RECV_REQ; in usbd_sof_trigger_iso_read()
1201 ev->evt.ep_evt.ep = ep_ctx; in usbd_sof_trigger_iso_read()
1202 usbd_evt_put(ev); in usbd_sof_trigger_iso_read()
1213 struct usbd_event *ev; in usbd_work_handler() local
1217 while ((ev = usbd_evt_get()) != NULL) { in usbd_work_handler()
1218 if (!dev_ready() && ev->evt_type != USBD_EVT_POWER) { in usbd_work_handler()
1220 usbd_evt_free(ev); in usbd_work_handler()
1224 switch (ev->evt_type) { in usbd_work_handler()
1228 (uint32_t)ev->evt.ep_evt.ep->cfg.addr); in usbd_work_handler()
1230 usbd_work_process_ep_events(&ev->evt.ep_evt); in usbd_work_handler()
1233 usbd_work_process_pwr_events(&ev->evt.pwr_evt); in usbd_work_handler()
1262 LOG_ERR("Unknown USBD event: %"PRId16, ev->evt_type); in usbd_work_handler()
1265 usbd_evt_free(ev); in usbd_work_handler()
1796 struct usbd_event *ev = usbd_evt_alloc(); in usb_dc_ep_read_continue() local
1798 if (!ev) { in usb_dc_ep_read_continue()
1803 ev->evt_type = USBD_EVT_EP; in usb_dc_ep_read_continue()
1804 ev->evt.ep_evt.ep = ep_ctx; in usb_dc_ep_read_continue()
1805 ev->evt.ep_evt.evt_type = EP_EVT_RECV_REQ; in usb_dc_ep_read_continue()
1806 usbd_evt_put(ev); in usb_dc_ep_read_continue()