Lines Matching refs:ep_cur
249 static inline uint32_t numaker_usbd_ep_fifo_max(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_fifo_max() argument
252 __ASSERT_NO_MSG(ep_cur->dmabuf_valid); in numaker_usbd_ep_fifo_max()
253 __ASSERT_NO_MSG(ep_cur->mps_valid); in numaker_usbd_ep_fifo_max()
254 __ASSERT_NO_MSG(ep_cur->mps <= ep_cur->dmabuf_size); in numaker_usbd_ep_fifo_max()
255 return ep_cur->mps; in numaker_usbd_ep_fifo_max()
258 static inline uint32_t numaker_usbd_ep_fifo_used(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_fifo_used() argument
260 __ASSERT_NO_MSG(ep_cur->dmabuf_valid); in numaker_usbd_ep_fifo_used()
262 return USB_EP_DIR_IS_OUT(ep_cur->addr) in numaker_usbd_ep_fifo_used()
263 ? ep_cur->read_fifo_used in numaker_usbd_ep_fifo_used()
264 : numaker_usbd_ep_fifo_max(ep_cur) - ep_cur->write_fifo_free; in numaker_usbd_ep_fifo_used()
271 static void numaker_usbd_ep_fifo_reset(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_fifo_reset() argument
273 if (ep_cur->dmabuf_valid && ep_cur->mps_valid) { in numaker_usbd_ep_fifo_reset()
274 if (USB_EP_DIR_IS_OUT(ep_cur->addr)) { in numaker_usbd_ep_fifo_reset()
276 ep_cur->read_fifo_pos = ep_cur->dmabuf_base; in numaker_usbd_ep_fifo_reset()
277 ep_cur->read_fifo_used = 0; in numaker_usbd_ep_fifo_reset()
280 ep_cur->write_fifo_pos = ep_cur->dmabuf_base; in numaker_usbd_ep_fifo_reset()
281 ep_cur->write_fifo_free = numaker_usbd_ep_fifo_max(ep_cur); in numaker_usbd_ep_fifo_reset()
286 static inline void numaker_usbd_ep_set_stall(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_set_stall() argument
288 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_set_stall()
289 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_set_stall()
296 static inline void numaker_usbd_ep_clear_stall_n_data_toggle(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_clear_stall_n_data_toggle() argument
298 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_clear_stall_n_data_toggle()
299 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_clear_stall_n_data_toggle()
308 static inline bool numaker_usbd_ep_is_stalled(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_is_stalled() argument
310 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_is_stalled()
311 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_is_stalled()
509 static int numaker_usbd_ep_fifo_copy_to_user(struct numaker_usbd_ep *ep_cur, uint8_t *usrbuf, in numaker_usbd_ep_fifo_copy_to_user() argument
512 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_fifo_copy_to_user()
516 __ASSERT_NO_MSG(ep_cur->dmabuf_valid); in numaker_usbd_ep_fifo_copy_to_user()
518 dmabuf_addr = numaker_usbd_buf_base(dev) + ep_cur->read_fifo_pos; in numaker_usbd_ep_fifo_copy_to_user()
521 *size_p = MIN(*size_p, numaker_usbd_ep_fifo_used(ep_cur)); in numaker_usbd_ep_fifo_copy_to_user()
526 ep_cur->read_fifo_pos += *size_p; in numaker_usbd_ep_fifo_copy_to_user()
527 ep_cur->read_fifo_used -= *size_p; in numaker_usbd_ep_fifo_copy_to_user()
528 if (ep_cur->read_fifo_used == 0) { in numaker_usbd_ep_fifo_copy_to_user()
529 ep_cur->read_fifo_pos = ep_cur->dmabuf_base; in numaker_usbd_ep_fifo_copy_to_user()
539 static int numaker_usbd_ep_fifo_copy_from_user(struct numaker_usbd_ep *ep_cur, in numaker_usbd_ep_fifo_copy_from_user() argument
542 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_fifo_copy_from_user()
543 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_fifo_copy_from_user()
548 __ASSERT_NO_MSG(ep_cur->dmabuf_valid); in numaker_usbd_ep_fifo_copy_from_user()
549 __ASSERT_NO_MSG(ep_cur->mps_valid); in numaker_usbd_ep_fifo_copy_from_user()
550 __ASSERT_NO_MSG(ep_cur->mps <= ep_cur->dmabuf_size); in numaker_usbd_ep_fifo_copy_from_user()
553 fifo_free = numaker_usbd_ep_fifo_max(ep_cur) - numaker_usbd_ep_fifo_used(ep_cur); in numaker_usbd_ep_fifo_copy_from_user()
560 ep_cur->write_fifo_pos += *size_p; in numaker_usbd_ep_fifo_copy_from_user()
561 ep_cur->write_fifo_free -= *size_p; in numaker_usbd_ep_fifo_copy_from_user()
562 if (ep_cur->write_fifo_free == 0) { in numaker_usbd_ep_fifo_copy_from_user()
563 ep_cur->write_fifo_pos = ep_cur->dmabuf_base; in numaker_usbd_ep_fifo_copy_from_user()
570 static void numaker_usbd_ep_fifo_update(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_fifo_update() argument
572 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_fifo_update()
573 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_fifo_update()
575 __ASSERT_NO_MSG(ep_cur->addr_valid); in numaker_usbd_ep_fifo_update()
576 __ASSERT_NO_MSG(ep_cur->dmabuf_valid); in numaker_usbd_ep_fifo_update()
578 if (USB_EP_DIR_IS_OUT(ep_cur->addr)) { in numaker_usbd_ep_fifo_update()
581 ep_cur->read_fifo_pos = ep_cur->dmabuf_base; in numaker_usbd_ep_fifo_update()
583 if (USB_EP_GET_IDX(ep_cur->addr) == 0) { in numaker_usbd_ep_fifo_update()
584 ep_cur->read_fifo_used = ep_cur->mxpld_ctrlout; in numaker_usbd_ep_fifo_update()
586 ep_cur->read_fifo_used = ep_base->MXPLD; in numaker_usbd_ep_fifo_update()
591 ep_cur->write_fifo_pos = ep_cur->dmabuf_base; in numaker_usbd_ep_fifo_update()
592 ep_cur->write_fifo_free = numaker_usbd_ep_fifo_max(ep_cur); in numaker_usbd_ep_fifo_update()
596 static void numaker_usbd_ep_config_dmabuf(struct numaker_usbd_ep *ep_cur, uint32_t dmabuf_base, in numaker_usbd_ep_config_dmabuf() argument
599 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_config_dmabuf()
600 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_config_dmabuf()
604 ep_cur->dmabuf_valid = true; in numaker_usbd_ep_config_dmabuf()
605 ep_cur->dmabuf_base = dmabuf_base; in numaker_usbd_ep_config_dmabuf()
606 ep_cur->dmabuf_size = dmabuf_size; in numaker_usbd_ep_config_dmabuf()
609 static void numaker_usbd_ep_abort(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_abort() argument
611 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_abort()
612 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_abort()
618 ep_cur->nak_clr = false; in numaker_usbd_ep_abort()
622 static void numaker_usbd_ep_config_major(struct numaker_usbd_ep *ep_cur, in numaker_usbd_ep_config_major() argument
625 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_config_major()
626 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_config_major()
628 ep_cur->mps_valid = true; in numaker_usbd_ep_config_major()
629 ep_cur->mps = ep_cfg->ep_mps; in numaker_usbd_ep_config_major()
632 ep_cur->ep_hw_cfg = 0; in numaker_usbd_ep_config_major()
636 ep_cur->ep_hw_cfg |= USBD_CFG_CSTALL; in numaker_usbd_ep_config_major()
640 ep_cur->ep_hw_cfg &= ~USBD_CFG_DSQSYNC_Msk; in numaker_usbd_ep_config_major()
643 ep_cur->ep_hw_cfg |= USBD_CFG_EPMODE_DISABLE; in numaker_usbd_ep_config_major()
647 ep_cur->ep_hw_cfg |= USBD_CFG_TYPE_ISO; in numaker_usbd_ep_config_major()
651 ep_cur->ep_hw_cfg |= in numaker_usbd_ep_config_major()
654 ep_base->CFG = ep_cur->ep_hw_cfg; in numaker_usbd_ep_config_major()
657 static void numaker_usbd_ep_enable(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_enable() argument
659 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_enable()
660 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_enable()
663 numaker_usbd_ep_abort(ep_cur); in numaker_usbd_ep_enable()
664 numaker_usbd_ep_clear_stall_n_data_toggle(ep_cur); in numaker_usbd_ep_enable()
665 numaker_usbd_ep_fifo_reset(ep_cur); in numaker_usbd_ep_enable()
668 ep_cur->ep_hw_cfg &= ~USBD_CFG_STATE_Msk; in numaker_usbd_ep_enable()
669 if (USB_EP_DIR_IS_IN(ep_cur->addr)) { in numaker_usbd_ep_enable()
670 ep_cur->ep_hw_cfg |= USBD_CFG_EPMODE_IN; in numaker_usbd_ep_enable()
672 ep_cur->ep_hw_cfg |= USBD_CFG_EPMODE_OUT; in numaker_usbd_ep_enable()
675 ep_base->CFG = ep_cur->ep_hw_cfg; in numaker_usbd_ep_enable()
680 static void numaker_usbd_ep_disable(struct numaker_usbd_ep *ep_cur) in numaker_usbd_ep_disable() argument
682 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_disable()
683 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_disable()
688 ep_cur->ep_hw_cfg = (ep_cur->ep_hw_cfg & ~USBD_CFG_STATE_Msk) | USBD_CFG_EPMODE_DISABLE; in numaker_usbd_ep_disable()
689 ep_base->CFG = ep_cur->ep_hw_cfg; in numaker_usbd_ep_disable()
693 static void numaker_usbd_ep_trigger(struct numaker_usbd_ep *ep_cur, uint32_t len) in numaker_usbd_ep_trigger() argument
695 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_trigger()
696 USBD_EP_T *ep_base = numaker_usbd_ep_base(dev, ep_cur->ep_hw_idx); in numaker_usbd_ep_trigger()
706 struct numaker_usbd_ep *ep_cur = NULL; in numaker_usbd_ep_mgmt_alloc_ep() local
709 ep_cur = ep_mgmt->ep_pool + ep_mgmt->ep_idx; in numaker_usbd_ep_mgmt_alloc_ep()
712 __ASSERT_NO_MSG(!ep_cur->valid); in numaker_usbd_ep_mgmt_alloc_ep()
715 ep_cur->valid = true; in numaker_usbd_ep_mgmt_alloc_ep()
718 return ep_cur; in numaker_usbd_ep_mgmt_alloc_ep()
757 struct numaker_usbd_ep *ep_cur; in numaker_usbd_ep_mgmt_init() local
763 ep_cur = ep_mgmt->ep_pool; in numaker_usbd_ep_mgmt_init()
767 for (; ep_cur != ep_end; ep_cur++) { in numaker_usbd_ep_mgmt_init()
769 ep_cur->dev = dev; in numaker_usbd_ep_mgmt_init()
772 ep_cur->ep_hw_idx = EP0 + (ep_cur - ep_mgmt->ep_pool); in numaker_usbd_ep_mgmt_init()
786 ep_cur = ep_mgmt->ep_pool + 0; in numaker_usbd_ep_mgmt_init()
787 ep_cur->valid = true; in numaker_usbd_ep_mgmt_init()
788 ep_cur->addr_valid = true; in numaker_usbd_ep_mgmt_init()
789 ep_cur->addr = USB_EP_GET_ADDR(0, USB_EP_DIR_OUT); in numaker_usbd_ep_mgmt_init()
790 numaker_usbd_ep_config_dmabuf(ep_cur, ep_mgmt->dmabuf_pos, in numaker_usbd_ep_mgmt_init()
793 ep_cur->mps_valid = true; in numaker_usbd_ep_mgmt_init()
794 ep_cur->mps = NUMAKER_USBD_DMABUF_SIZE_CTRLOUT; in numaker_usbd_ep_mgmt_init()
797 ep_cur = ep_mgmt->ep_pool + 1; in numaker_usbd_ep_mgmt_init()
798 ep_cur->valid = true; in numaker_usbd_ep_mgmt_init()
799 ep_cur->addr_valid = true; in numaker_usbd_ep_mgmt_init()
800 ep_cur->addr = USB_EP_GET_ADDR(0, USB_EP_DIR_IN); in numaker_usbd_ep_mgmt_init()
801 numaker_usbd_ep_config_dmabuf(ep_cur, ep_mgmt->dmabuf_pos, NUMAKER_USBD_DMABUF_SIZE_CTRLIN); in numaker_usbd_ep_mgmt_init()
803 ep_cur->mps_valid = true; in numaker_usbd_ep_mgmt_init()
804 ep_cur->mps = NUMAKER_USBD_DMABUF_SIZE_CTRLIN; in numaker_usbd_ep_mgmt_init()
814 struct numaker_usbd_ep *ep_cur = ep_mgmt->ep_pool; in numaker_usbd_ep_mgmt_find_ep() local
817 for (; ep_cur != ep_end; ep_cur++) { in numaker_usbd_ep_mgmt_find_ep()
818 if (!ep_cur->valid) { in numaker_usbd_ep_mgmt_find_ep()
822 if (!ep_cur->addr_valid) { in numaker_usbd_ep_mgmt_find_ep()
826 if (ep == ep_cur->addr) { in numaker_usbd_ep_mgmt_find_ep()
827 return ep_cur; in numaker_usbd_ep_mgmt_find_ep()
838 struct numaker_usbd_ep *ep_cur = numaker_usbd_ep_mgmt_find_ep(dev, ep); in numaker_usbd_ep_mgmt_bind_ep() local
840 if (!ep_cur) { in numaker_usbd_ep_mgmt_bind_ep()
841 ep_cur = numaker_usbd_ep_mgmt_alloc_ep(dev); in numaker_usbd_ep_mgmt_bind_ep()
843 if (!ep_cur) { in numaker_usbd_ep_mgmt_bind_ep()
848 ep_cur->addr = ep; in numaker_usbd_ep_mgmt_bind_ep()
849 ep_cur->addr_valid = true; in numaker_usbd_ep_mgmt_bind_ep()
853 __ASSERT_NO_MSG(ep_cur->valid); in numaker_usbd_ep_mgmt_bind_ep()
854 __ASSERT_NO_MSG(ep_cur->addr_valid); in numaker_usbd_ep_mgmt_bind_ep()
855 __ASSERT_NO_MSG(ep_cur->addr == ep); in numaker_usbd_ep_mgmt_bind_ep()
857 return ep_cur; in numaker_usbd_ep_mgmt_bind_ep()
867 struct numaker_usbd_ep *ep_cur = ep_mgmt->ep_pool; in numaker_usbd_bus_reset_bh() local
870 for (; ep_cur != ep_end; ep_cur++) { in numaker_usbd_bus_reset_bh()
872 numaker_usbd_ep_fifo_reset(ep_cur); in numaker_usbd_bus_reset_bh()
875 numaker_usbd_ep_abort(ep_cur); in numaker_usbd_bus_reset_bh()
878 numaker_usbd_ep_clear_stall_n_data_toggle(ep_cur); in numaker_usbd_bus_reset_bh()
885 static void numaker_usbd_ep_bh(struct numaker_usbd_ep *ep_cur, in numaker_usbd_ep_bh() argument
888 const struct device *dev = ep_cur->dev; in numaker_usbd_ep_bh()
894 __ASSERT_NO_MSG(ep_cur->addr == USB_EP_GET_ADDR(0, USB_EP_DIR_OUT)); in numaker_usbd_ep_bh()
896 if (numaker_usbd_ep_fifo_used(ep_cur)) { in numaker_usbd_ep_bh()
901 __ASSERT_NO_MSG(ep_cur->addr == USB_EP_GET_ADDR(0, USB_EP_DIR_OUT)); in numaker_usbd_ep_bh()
902 __ASSERT_NO_MSG((ep_cur + 1)->addr == USB_EP_GET_ADDR(0, USB_EP_DIR_IN)); in numaker_usbd_ep_bh()
905 numaker_usbd_ep_fifo_reset(ep_cur); in numaker_usbd_ep_bh()
906 numaker_usbd_ep_fifo_reset(ep_cur + 1); in numaker_usbd_ep_bh()
909 numaker_usbd_ep_abort(ep_cur); in numaker_usbd_ep_bh()
910 numaker_usbd_ep_abort(ep_cur + 1); in numaker_usbd_ep_bh()
916 __ASSERT_NO_MSG(USB_EP_DIR_IS_OUT(ep_cur->addr)); in numaker_usbd_ep_bh()
919 numaker_usbd_ep_fifo_update(ep_cur); in numaker_usbd_ep_bh()
922 ep_cur->nak_clr = false; in numaker_usbd_ep_bh()
924 __ASSERT_NO_MSG(USB_EP_DIR_IS_IN(ep_cur->addr)); in numaker_usbd_ep_bh()
927 numaker_usbd_ep_fifo_update(ep_cur); in numaker_usbd_ep_bh()
930 ep_cur->nak_clr = false; in numaker_usbd_ep_bh()
974 struct numaker_usbd_ep *ep_cur; in numaker_usbd_msg_cb_ep() local
981 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in numaker_usbd_msg_cb_ep()
983 if (!ep_cur) { in numaker_usbd_msg_cb_ep()
990 numaker_usbd_ep_bh(ep_cur, msg->cb_ep.status_code); in numaker_usbd_msg_cb_ep()
994 if (ep_cur->cb) { in numaker_usbd_msg_cb_ep()
995 ep_cur->cb(ep, msg->cb_ep.status_code); in numaker_usbd_msg_cb_ep()
1352 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_check_cap() local
1388 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep_cfg->ep_addr); in usb_dc_ep_check_cap()
1389 if (!ep_cur) { in usb_dc_ep_check_cap()
1406 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_set_callback() local
1411 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_set_callback()
1413 if (!ep_cur) { in usb_dc_ep_set_callback()
1419 ep_cur->cb = cb; in usb_dc_ep_set_callback()
1434 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_configure() local
1441 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep_cfg->ep_addr); in usb_dc_ep_configure()
1443 if (!ep_cur) { in usb_dc_ep_configure()
1450 if (!ep_cur->dmabuf_valid || ep_cur->dmabuf_size < ep_cfg->ep_mps) { in usb_dc_ep_configure()
1460 numaker_usbd_ep_config_dmabuf(ep_cur, dmabuf_base, dmabuf_size); in usb_dc_ep_configure()
1464 numaker_usbd_ep_config_major(ep_cur, ep_cfg); in usb_dc_ep_configure()
1477 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_set_stall() local
1484 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_set_stall()
1486 if (!ep_cur) { in usb_dc_ep_set_stall()
1493 numaker_usbd_ep_set_stall(ep_cur); in usb_dc_ep_set_stall()
1506 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_clear_stall() local
1513 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_clear_stall()
1515 if (!ep_cur) { in usb_dc_ep_clear_stall()
1522 numaker_usbd_ep_clear_stall_n_data_toggle(ep_cur); in usb_dc_ep_clear_stall()
1535 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_is_stalled() local
1544 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_is_stalled()
1546 if (!ep_cur) { in usb_dc_ep_is_stalled()
1552 *stalled = numaker_usbd_ep_is_stalled(ep_cur); in usb_dc_ep_is_stalled()
1570 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_enable() local
1577 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_enable()
1579 if (!ep_cur) { in usb_dc_ep_enable()
1585 numaker_usbd_ep_enable(ep_cur); in usb_dc_ep_enable()
1610 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_disable() local
1617 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_disable()
1619 if (!ep_cur) { in usb_dc_ep_disable()
1625 numaker_usbd_ep_disable(ep_cur); in usb_dc_ep_disable()
1638 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_flush() local
1645 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_flush()
1647 if (!ep_cur) { in usb_dc_ep_flush()
1653 numaker_usbd_ep_fifo_reset(ep_cur); in usb_dc_ep_flush()
1667 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_write() local
1673 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_write()
1675 if (!ep_cur) { in usb_dc_ep_write()
1688 if (ep_cur->nak_clr) { in usb_dc_ep_write()
1695 if (numaker_usbd_ep_fifo_used(ep_cur)) { in usb_dc_ep_write()
1704 rc = numaker_usbd_ep_fifo_copy_from_user(ep_cur, data_buf, &data_len_act); in usb_dc_ep_write()
1714 numaker_usbd_ep_trigger(ep_cur, data_len_act); in usb_dc_ep_write()
1766 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_read_wait() local
1772 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_read_wait()
1774 if (!ep_cur) { in usb_dc_ep_read_wait()
1805 if (ep_cur->nak_clr) { in usb_dc_ep_read_wait()
1816 rc = numaker_usbd_ep_fifo_copy_to_user(ep_cur, data_buf, &data_len_act); in usb_dc_ep_read_wait()
1831 *read_bytes = numaker_usbd_ep_fifo_used(ep_cur); in usb_dc_ep_read_wait()
1852 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_read_continue() local
1857 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_read_continue()
1859 if (!ep_cur) { in usb_dc_ep_read_continue()
1872 if (ep_cur->nak_clr) { in usb_dc_ep_read_continue()
1878 if (numaker_usbd_ep_fifo_used(ep_cur)) { in usb_dc_ep_read_continue()
1882 __ASSERT_NO_MSG(ep_cur->mps_valid); in usb_dc_ep_read_continue()
1883 numaker_usbd_ep_trigger(ep_cur, ep_cur->mps); in usb_dc_ep_read_continue()
1896 struct numaker_usbd_ep *ep_cur; in usb_dc_ep_mps() local
1902 ep_cur = numaker_usbd_ep_mgmt_bind_ep(dev, ep); in usb_dc_ep_mps()
1904 if (!ep_cur) { in usb_dc_ep_mps()
1910 __ASSERT_NO_MSG(ep_cur->mps_valid); in usb_dc_ep_mps()
1911 ep_mps = ep_cur->mps; in usb_dc_ep_mps()