Lines Matching full:ep

60 #define USB_EP_LUT_IDX(ep) (USB_EP_DIR_IS_IN(ep) ? (ep & BIT_MASK(4)) + 16 : \  argument
61 ep & BIT_MASK(4))
74 struct udc_ep_config *udc_get_ep_cfg(const struct device *dev, const uint8_t ep) in udc_get_ep_cfg() argument
78 return data->ep_lut[USB_EP_LUT_IDX(ep)]; in udc_get_ep_cfg()
81 bool udc_ep_is_busy(const struct device *dev, const uint8_t ep) in udc_ep_is_busy() argument
85 ep_cfg = udc_get_ep_cfg(dev, ep); in udc_ep_is_busy()
86 __ASSERT(ep_cfg != NULL, "ep 0x%02x is not available", ep); in udc_ep_is_busy()
91 void udc_ep_set_busy(const struct device *dev, const uint8_t ep, const bool busy) in udc_ep_set_busy() argument
95 ep_cfg = udc_get_ep_cfg(dev, ep); in udc_ep_set_busy()
96 __ASSERT(ep_cfg != NULL, "ep 0x%02x is not available", ep); in udc_ep_set_busy()
118 struct net_buf *udc_buf_get(const struct device *dev, const uint8_t ep) in udc_buf_get() argument
122 ep_cfg = udc_get_ep_cfg(dev, ep); in udc_buf_get()
130 struct net_buf *udc_buf_get_all(const struct device *dev, const uint8_t ep) in udc_buf_get_all() argument
135 ep_cfg = udc_get_ep_cfg(dev, ep); in udc_buf_get_all()
145 LOG_DBG("ep 0x%02x dequeue %p", ep, buf); in udc_buf_get_all()
157 struct net_buf *udc_buf_peek(const struct device *dev, const uint8_t ep) in udc_buf_peek() argument
161 ep_cfg = udc_get_ep_cfg(dev, ep); in udc_buf_peek()
240 const uint8_t ep, in ep_check_config() argument
245 bool dir_is_in = USB_EP_DIR_IS_IN(ep); in ep_check_config()
246 bool dir_is_out = USB_EP_DIR_IS_OUT(ep); in ep_check_config()
332 const uint8_t ep, in udc_ep_try_config() argument
341 cfg = udc_get_ep_cfg(dev, ep); in udc_ep_try_config()
348 ret = ep_check_config(dev, cfg, ep, attributes, *mps, interval); in udc_ep_try_config()
359 const uint8_t ep, in udc_ep_enable_internal() argument
368 cfg = udc_get_ep_cfg(dev, ep); in udc_ep_enable_internal()
374 LOG_ERR("ep 0x%02x already enabled", cfg->addr); in udc_ep_enable_internal()
378 if (!ep_check_config(dev, cfg, ep, attributes, mps, interval)) { in udc_ep_enable_internal()
397 const uint8_t ep, in udc_ep_enable() argument
405 if (ep == USB_CONTROL_EP_OUT || ep == USB_CONTROL_EP_IN) { in udc_ep_enable()
416 ret = udc_ep_enable_internal(dev, ep, attributes, mps, interval); in udc_ep_enable()
424 int udc_ep_disable_internal(const struct device *dev, const uint8_t ep) in udc_ep_disable_internal() argument
430 cfg = udc_get_ep_cfg(dev, ep); in udc_ep_disable_internal()
436 LOG_ERR("ep 0x%02x already disabled", cfg->addr); in udc_ep_disable_internal()
446 int udc_ep_disable(const struct device *dev, const uint8_t ep) in udc_ep_disable() argument
451 if (ep == USB_CONTROL_EP_OUT || ep == USB_CONTROL_EP_IN) { in udc_ep_disable()
462 ret = udc_ep_disable_internal(dev, ep); in udc_ep_disable()
470 int udc_ep_set_halt(const struct device *dev, const uint8_t ep) in udc_ep_set_halt() argument
483 cfg = udc_get_ep_cfg(dev, ep); in udc_ep_set_halt()
507 int udc_ep_clear_halt(const struct device *dev, const uint8_t ep) in udc_ep_clear_halt() argument
520 cfg = udc_get_ep_cfg(dev, ep); in udc_ep_clear_halt()
557 LOG_DBG("ep 0x%02x queue is empty", cfg->addr); in udc_debug_ep_enqueue()
561 LOG_DBG("[de]queue ep 0x%02x:", cfg->addr); in udc_debug_ep_enqueue()
584 if (bi->ep == USB_CONTROL_EP_OUT) { in udc_ep_enqueue()
589 cfg = udc_get_ep_cfg(dev, bi->ep); in udc_ep_enqueue()
600 LOG_DBG("Queue ep 0x%02x %p len %u", cfg->addr, buf, in udc_ep_enqueue()
612 int udc_ep_dequeue(const struct device *dev, const uint8_t ep) in udc_ep_dequeue() argument
625 cfg = udc_get_ep_cfg(dev, ep); in udc_ep_dequeue()
632 LOG_INF("ep 0x%02x is not halted|disabled", cfg->addr); in udc_ep_dequeue()
652 const uint8_t ep, in udc_ep_buf_alloc() argument
668 bi->ep = ep; in udc_ep_buf_alloc()
669 LOG_DBG("Allocate net_buf, ep 0x%02x, size %zd", ep, size); in udc_ep_buf_alloc()
678 const uint8_t ep, in udc_ctrl_alloc() argument
682 return udc_ep_buf_alloc(dev, ep, size); in udc_ctrl_alloc()
843 const uint8_t ep, in udc_ctrl_alloc_stage() argument
848 buf = udc_ctrl_alloc(dev, ep, size); in udc_ctrl_alloc_stage()
862 const uint8_t ep) in udc_ctrl_alloc_data() argument
868 buf = udc_ctrl_alloc_stage(dev, setup, ep, size); in udc_ctrl_alloc_data()
879 const uint8_t ep) in udc_ctrl_alloc_status() argument
881 size_t size = (ep == USB_CONTROL_EP_OUT) ? 64 : 0; in udc_ctrl_alloc_status()
885 buf = udc_ctrl_alloc_stage(dev, parent, ep, size); in udc_ctrl_alloc_status()
1007 __ASSERT(USB_EP_GET_IDX(bi->ep) == 0, in udc_ctrl_update_stage()
1008 "0x%02x is not a control endpoint", bi->ep); in udc_ctrl_update_stage()
1010 if (bi->setup && bi->ep == USB_CONTROL_EP_OUT) { in udc_ctrl_update_stage()
1048 } else if (bi->ep == USB_CONTROL_EP_OUT) { in udc_ctrl_update_stage()
1074 } else { /* if (bi->ep == USB_CONTROL_EP_IN) */ in udc_ctrl_update_stage()