/Zephyr-latest/drivers/usb/udc/ |
D | udc_ambiq.c | 252 static int udc_ambiq_ep_enqueue(const struct device *dev, struct udc_ep_config *ep_cfg, in udc_ambiq_ep_enqueue() argument 257 .ep = ep_cfg->addr, in udc_ambiq_ep_enqueue() 261 LOG_DBG("%p enqueue %x %p", dev, ep_cfg->addr, buf); in udc_ambiq_ep_enqueue() 262 udc_buf_put(ep_cfg, buf); in udc_ambiq_ep_enqueue() 263 if (ep_cfg->addr == USB_CONTROL_EP_IN && buf->len == 0 && priv->ctrl_pending_in_ack) { in udc_ambiq_ep_enqueue() 269 if (!ep_cfg->stat.halted) { in udc_ambiq_ep_enqueue() 276 static int udc_ambiq_ep_dequeue(const struct device *dev, struct udc_ep_config *ep_cfg) in udc_ambiq_ep_dequeue() argument 284 buf = udc_buf_get_all(dev, ep_cfg->addr); in udc_ambiq_ep_dequeue() 289 udc_ep_set_busy(dev, ep_cfg->addr, false); in udc_ambiq_ep_dequeue() 290 am_hal_usb_ep_state_reset(priv->usb_handle, ep_cfg->addr); in udc_ambiq_ep_dequeue() [all …]
|
D | udc_smartbond.c | 277 const struct udc_ep_config *const ep_cfg = &ep_state->config; in fill_tx_fifo() local 278 const uint16_t mps = udc_mps_ep_size(ep_cfg); in fill_tx_fifo() 279 const uint8_t ep_idx = USB_EP_GET_IDX(ep_cfg->addr); in fill_tx_fifo() 303 if (ep_idx == 0 || ep_cfg->mps <= EP_FIFO_SIZE) { in fill_tx_fifo() 326 struct udc_ep_config *const ep_cfg = &ep_state->config; in try_allocate_dma() local 327 const uint8_t ep = ep_cfg->addr; in try_allocate_dma() 360 struct udc_ep_config *const ep_cfg = &ep_state->config; in start_rx_packet() local 362 const uint8_t ep = ep_cfg->addr; in start_rx_packet() 366 const uint16_t mps = udc_mps_ep_size(ep_cfg); in start_rx_packet() 414 struct udc_ep_config *const ep_cfg = &ep_state->config; in start_tx_packet() local [all …]
|
D | udc_numaker.c | 230 struct udc_ep_config *ep_cfg; in numaker_usbd_ep_sync_udc_halt() local 233 ep_cfg = udc_get_ep_cfg(dev, ep_cur->addr); in numaker_usbd_ep_sync_udc_halt() 234 ep_cfg->stat.halted = stalled; in numaker_usbd_ep_sync_udc_halt() 521 struct udc_ep_config *const ep_cfg) in numaker_usbd_ep_config_major() argument 527 ep_cur->mps = ep_cfg->mps; in numaker_usbd_ep_config_major() 533 if ((ep_cfg->attributes & USB_EP_TRANSFER_TYPE_MASK) == USB_EP_TYPE_CONTROL) { in numaker_usbd_ep_config_major() 544 if ((ep_cfg->attributes & USB_EP_TRANSFER_TYPE_MASK) == USB_EP_TYPE_ISO) { in numaker_usbd_ep_config_major() 550 (USB_EP_GET_IDX(ep_cfg->addr) << USBD_CFG_EPNUM_Pos) & USBD_CFG_EPNUM_Msk; in numaker_usbd_ep_config_major() 858 struct udc_ep_config *ep_cfg; in numaker_usbd_ctrl_feed_dout() local 861 ep_cfg = udc_get_ep_cfg(dev, USB_CONTROL_EP_OUT); in numaker_usbd_ctrl_feed_dout() [all …]
|
D | udc_kinetis.c | 469 struct udc_ep_config *ep_cfg; in xfer_work_handler() local 474 ep_cfg = udc_get_ep_cfg(ev->dev, ev->ep); in xfer_work_handler() 475 if (unlikely(ep_cfg == NULL)) { in xfer_work_handler() 493 err = usbfsotg_ep_clear_halt(ev->dev, ep_cfg); in xfer_work_handler() 505 if (usbfsotg_xfer_next(ev->dev, ep_cfg) == 0) { in xfer_work_handler() 529 struct udc_ep_config *ep_cfg = udc_get_ep_cfg(dev, USB_CONTROL_EP_IN); in set_control_in_pid_data1() local 532 ep_cfg->stat.data1 = true; in set_control_in_pid_data1() 543 struct udc_ep_config *ep_cfg; in isr_handle_xfer_done() local 549 ep_cfg = udc_get_ep_cfg(dev, ep); in isr_handle_xfer_done() 550 bd = usbfsotg_get_ebd(dev, ep_cfg, false); in isr_handle_xfer_done() [all …]
|
D | udc_common.c | 83 struct udc_ep_config *ep_cfg; in udc_ep_is_busy() local 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() 88 return ep_cfg->stat.busy; in udc_ep_is_busy() 93 struct udc_ep_config *ep_cfg; in udc_ep_set_busy() local 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() 97 ep_cfg->stat.busy = busy; in udc_ep_set_busy() 120 struct udc_ep_config *ep_cfg; in udc_buf_get() local 122 ep_cfg = udc_get_ep_cfg(dev, ep); in udc_buf_get() [all …]
|
D | udc_virtual.c | 79 struct udc_ep_config *ep_cfg = udc_get_ep_cfg(dev, USB_CONTROL_EP_OUT); in vrt_ctrl_feed_dout() local 87 udc_buf_put(ep_cfg, buf); in vrt_ctrl_feed_dout() 162 struct udc_ep_config *ep_cfg; in vrt_handle_out() local 169 ep_cfg = udc_get_ep_cfg(dev, ep); in vrt_handle_out() 170 if (ep_cfg->stat.halted) { in vrt_handle_out() 186 if (net_buf_tailroom(buf) == 0 || pkt->length < udc_mps_ep_size(ep_cfg)) { in vrt_handle_out() 229 struct udc_ep_config *ep_cfg; in vrt_handle_in() local 236 ep_cfg = udc_get_ep_cfg(dev, ep); in vrt_handle_in() 237 if (ep_cfg->stat.halted) { in vrt_handle_in() 249 pkt->length, buf->len, udc_mps_ep_size(ep_cfg)); in vrt_handle_in() [all …]
|
D | udc_rpi_pico.c | 266 struct udc_ep_config *ep_cfg = udc_get_ep_cfg(dev, USB_CONTROL_EP_OUT); in rpi_pico_ctrl_feed_dout() local 274 udc_buf_put(ep_cfg, buf); in rpi_pico_ctrl_feed_dout() 276 return rpi_pico_prep_rx(dev, buf, ep_cfg); in rpi_pico_ctrl_feed_dout() 439 struct udc_ep_config *ep_cfg; in rpi_pico_thread_handler() local 443 ep_cfg = udc_get_ep_cfg(dev, evt.ep); in rpi_pico_thread_handler() 454 LOG_DBG("DOUT event ep 0x%02x", ep_cfg->addr); in rpi_pico_thread_handler() 455 rpi_pico_handle_evt_dout(dev, ep_cfg); in rpi_pico_thread_handler() 459 rpi_pico_handle_evt_din(dev, ep_cfg); in rpi_pico_thread_handler() 463 if (ep_cfg->addr != USB_CONTROL_EP_OUT && !udc_ep_is_busy(dev, ep_cfg->addr)) { in rpi_pico_thread_handler() 464 rpi_pico_handle_xfer_next(dev, ep_cfg); in rpi_pico_thread_handler() [all …]
|
D | udc_dwc2.c | 681 struct udc_ep_config *ep_cfg = udc_get_ep_cfg(dev, USB_CONTROL_EP_OUT); in dwc2_ctrl_feed_dout() local 689 udc_buf_put(ep_cfg, buf); in dwc2_ctrl_feed_dout() 690 dwc2_prep_rx(dev, buf, ep_cfg); in dwc2_ctrl_feed_dout() 2308 struct udc_ep_config *ep_cfg; in dwc2_handle_rxflvl() local 2327 ep_cfg = udc_get_ep_cfg(dev, ep); in dwc2_handle_rxflvl() 2329 buf = udc_buf_peek(dev, ep_cfg->addr); in dwc2_handle_rxflvl() 2351 struct udc_ep_config *ep_cfg; in dwc2_handle_in_xfercompl() local 2354 ep_cfg = udc_get_ep_cfg(dev, ep_idx | USB_EP_DIR_IN); in dwc2_handle_in_xfercompl() 2355 buf = udc_buf_peek(dev, ep_cfg->addr); in dwc2_handle_in_xfercompl() 2362 if (buf->len && dwc2_tx_fifo_write(dev, ep_cfg, buf) == 0) { in dwc2_handle_in_xfercompl() [all …]
|
D | udc_nrf.c | 503 struct udc_ep_config *ep_cfg; in udc_sof_check_iso_out() local 505 ep_cfg = udc_get_ep_cfg(dev, iso_out_addr); in udc_sof_check_iso_out() 506 if (ep_cfg == NULL) { in udc_sof_check_iso_out() 510 if (ep_cfg->stat.enabled && !k_fifo_is_empty(&ep_cfg->fifo)) { in udc_sof_check_iso_out()
|
D | udc_stm32.c | 640 struct udc_ep_config *ep_cfg) in udc_stm32_ep_enable() argument 647 LOG_DBG("Enable ep 0x%02x", ep_cfg->addr); in udc_stm32_ep_enable() 649 switch (ep_cfg->attributes & USB_EP_TRANSFER_TYPE_MASK) { in udc_stm32_ep_enable() 666 ret = udc_stm32_ep_mem_config(dev, ep_cfg, true); in udc_stm32_ep_enable() 671 status = HAL_PCD_EP_Open(&priv->pcd, ep_cfg->addr, in udc_stm32_ep_enable() 672 udc_mps_ep_size(ep_cfg), ep_type); in udc_stm32_ep_enable() 675 ep_cfg->addr, (int)status); in udc_stm32_ep_enable()
|
D | udc_common.h | 133 void udc_buf_put(struct udc_ep_config *const ep_cfg,
|
D | udc_it82xx2.c | 759 struct udc_ep_config *ep_cfg = udc_get_ep_cfg(dev, ep); in it82xx2_xfer_in_data() local 773 len = MIN(buf->len, udc_mps_ep_size(ep_cfg)); in it82xx2_xfer_in_data() 972 struct udc_ep_config *ep_cfg; in work_handler_in() local 991 ep_cfg = udc_get_ep_cfg(dev, ep); in work_handler_in() 993 net_buf_pull(buf, MIN(buf->len, udc_mps_ep_size(ep_cfg))); in work_handler_in() 1104 struct udc_ep_config *ep_cfg; in work_handler_out() local 1133 ep_cfg = udc_get_ep_cfg(dev, ep); in work_handler_out() 1134 if (len > udc_mps_ep_size(ep_cfg)) { in work_handler_out() 1143 if (net_buf_tailroom(buf) && len == udc_mps_ep_size(ep_cfg)) { in work_handler_out()
|
/Zephyr-latest/subsys/usb/device/ |
D | usb_descriptor.c | 265 struct usb_dc_ep_cfg_data ep_cfg; in usb_validate_ep_cfg_data() local 267 ep_cfg.ep_type = (ep_descr->bmAttributes & in usb_validate_ep_cfg_data() 269 ep_cfg.ep_mps = sys_le16_to_cpu(ep_descr->wMaxPacketSize); in usb_validate_ep_cfg_data() 270 ep_cfg.ep_addr = ep_descr->bEndpointAddress; in usb_validate_ep_cfg_data() 271 if (ep_cfg.ep_addr & USB_EP_DIR_IN) { in usb_validate_ep_cfg_data() 276 ep_cfg.ep_addr = (USB_EP_DIR_IN | idx); in usb_validate_ep_cfg_data() 282 ep_cfg.ep_addr = idx; in usb_validate_ep_cfg_data() 284 if (!usb_dc_ep_check_cap(&ep_cfg)) { in usb_validate_ep_cfg_data() 287 ep_cfg.ep_addr); in usb_validate_ep_cfg_data() 288 ep_descr->bEndpointAddress = ep_cfg.ep_addr; in usb_validate_ep_cfg_data() [all …]
|
D | usb_device.c | 560 struct usb_dc_ep_cfg_data ep_cfg; in set_endpoint() local 564 ep_cfg.ep_addr = ep_desc->bEndpointAddress; in set_endpoint() 565 ep_cfg.ep_mps = sys_le16_to_cpu(ep_desc->wMaxPacketSize); in set_endpoint() 566 ep_cfg.ep_type = ep_desc->bmAttributes & USB_EP_TRANSFER_TYPE_MASK; in set_endpoint() 569 ep_cfg.ep_addr, ep_cfg.ep_type, ep_cfg.ep_mps); in set_endpoint() 581 ret = usb_dc_ep_configure(&ep_cfg); in set_endpoint() 583 LOG_WRN("Endpoint 0x%02x already configured", ep_cfg.ep_addr); in set_endpoint() 585 LOG_ERR("Failed to configure endpoint 0x%02x", ep_cfg.ep_addr); in set_endpoint() 591 ret = usb_dc_ep_enable(ep_cfg.ep_addr); in set_endpoint() 593 LOG_WRN("Endpoint 0x%02x already enabled", ep_cfg.ep_addr); in set_endpoint() [all …]
|
/Zephyr-latest/subsys/usb/device/class/ |
D | loopback.c | 87 static struct usb_ep_cfg_data ep_cfg[] = { variable 107 loopback_in_cb(ep_cfg[LOOPBACK_IN_EP_IDX].ep_addr, 0); in loopback_status_cb() 115 if (*param == ep_cfg[LOOPBACK_IN_EP_IDX].ep_addr) { in loopback_status_cb() 116 loopback_in_cb(ep_cfg[LOOPBACK_IN_EP_IDX].ep_addr, 0); in loopback_status_cb() 179 .num_endpoints = ARRAY_SIZE(ep_cfg), 180 .endpoint = ep_cfg,
|
/Zephyr-latest/drivers/usb/device/ |
D | usb_dc_stm32.c | 764 int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data * const ep_cfg) in usb_dc_ep_configure() argument 766 uint8_t ep = ep_cfg->ep_addr; in usb_dc_ep_configure() 774 ep_cfg->ep_addr, ep_state->ep_mps, ep_cfg->ep_mps, in usb_dc_ep_configure() 775 ep_cfg->ep_type); in usb_dc_ep_configure() 777 if (ep_cfg->ep_mps > ep_state->ep_pma_buf_len) { in usb_dc_ep_configure() 778 if (ep_cfg->ep_type == USB_DC_EP_ISOCHRONOUS) { in usb_dc_ep_configure() 780 (usb_dc_stm32_state.pma_offset + ep_cfg->ep_mps*2)) { in usb_dc_ep_configure() 784 (usb_dc_stm32_state.pma_offset + ep_cfg->ep_mps)) { in usb_dc_ep_configure() 788 if (ep_cfg->ep_type == USB_DC_EP_ISOCHRONOUS) { in usb_dc_ep_configure() 791 ((usb_dc_stm32_state.pma_offset + ep_cfg->ep_mps) << 16)); in usb_dc_ep_configure() [all …]
|
D | usb_dc_numaker.c | 623 const struct usb_dc_ep_cfg_data *const ep_cfg) in numaker_usbd_ep_config_major() argument 629 ep_cur->mps = ep_cfg->ep_mps; in numaker_usbd_ep_config_major() 635 if (ep_cfg->ep_type == USB_DC_EP_CONTROL) { in numaker_usbd_ep_config_major() 646 if (ep_cfg->ep_type == USB_DC_EP_ISOCHRONOUS) { in numaker_usbd_ep_config_major() 652 (USB_EP_GET_IDX(ep_cfg->ep_addr) << USBD_CFG_EPNUM_Pos) & USBD_CFG_EPNUM_Msk; in numaker_usbd_ep_config_major() 1347 int usb_dc_ep_check_cap(const struct usb_dc_ep_cfg_data *const ep_cfg) in usb_dc_ep_check_cap() argument 1357 if ((ep_cfg->ep_type == USB_DC_EP_CONTROL) && USB_EP_GET_IDX(ep_cfg->ep_addr) != 0) { in usb_dc_ep_check_cap() 1367 if (config->disallow_iso_inout_same && ep_cfg->ep_type != USB_DC_EP_CONTROL) { in usb_dc_ep_check_cap() 1369 if (USB_EP_DIR_IS_OUT(ep_cfg->ep_addr) && USB_EP_GET_IDX(ep_cfg->ep_addr) >= 8) { in usb_dc_ep_check_cap() 1371 ep_cfg->ep_addr); in usb_dc_ep_check_cap() [all …]
|
D | usb_dc_nrfx.c | 1379 int usb_dc_ep_check_cap(const struct usb_dc_ep_cfg_data *const ep_cfg) in usb_dc_ep_check_cap() argument 1381 uint8_t ep_idx = NRF_USBD_EP_NR_GET(ep_cfg->ep_addr); in usb_dc_ep_check_cap() 1383 LOG_DBG("ep 0x%02x, mps %d, type %d", ep_cfg->ep_addr, ep_cfg->ep_mps, in usb_dc_ep_check_cap() 1384 ep_cfg->ep_type); in usb_dc_ep_check_cap() 1386 if ((ep_cfg->ep_type == USB_DC_EP_CONTROL) && ep_idx) { in usb_dc_ep_check_cap() 1391 if (!NRF_USBD_EP_VALIDATE(ep_cfg->ep_addr)) { in usb_dc_ep_check_cap() 1396 if ((ep_cfg->ep_type == USB_DC_EP_ISOCHRONOUS) && in usb_dc_ep_check_cap() 1397 (!NRF_USBD_EPISO_CHECK(ep_cfg->ep_addr))) { in usb_dc_ep_check_cap() 1402 if ((ep_cfg->ep_type != USB_DC_EP_ISOCHRONOUS) && in usb_dc_ep_check_cap() 1403 (NRF_USBD_EPISO_CHECK(ep_cfg->ep_addr))) { in usb_dc_ep_check_cap() [all …]
|
D | usb_dc_rpi_pico.c | 607 int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const ep_cfg) in usb_dc_ep_configure() argument 609 uint8_t ep = ep_cfg->ep_addr; in usb_dc_ep_configure() 617 ep_cfg->ep_addr, ep_state->mps, in usb_dc_ep_configure() 618 ep_cfg->ep_mps, ep_cfg->ep_type); in usb_dc_ep_configure() 620 ep_state->mps = ep_cfg->ep_mps; in usb_dc_ep_configure() 621 ep_state->type = ep_cfg->ep_type; in usb_dc_ep_configure()
|
D | usb_dc_kinetis.c | 855 struct usb_dc_ep_cfg_data ep_cfg; in reenable_control_endpoints() local 858 ep_cfg.ep_addr = USB_CONTROL_EP_OUT; in reenable_control_endpoints() 859 ep_cfg.ep_mps = USB_CONTROL_EP_MPS; in reenable_control_endpoints() 860 ep_cfg.ep_type = USB_DC_EP_CONTROL; in reenable_control_endpoints() 861 usb_dc_ep_configure(&ep_cfg); in reenable_control_endpoints() 862 ep_cfg.ep_addr = USB_CONTROL_EP_IN; in reenable_control_endpoints() 863 usb_dc_ep_configure(&ep_cfg); in reenable_control_endpoints()
|
D | usb_dc_smartbond.c | 1435 int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data *const ep_cfg) in usb_dc_ep_configure() argument 1437 struct smartbond_ep_state *ep_state = usb_dc_get_ep_state(ep_cfg->ep_addr); in usb_dc_ep_configure() 1438 uint8_t ep_idx = USB_EP_GET_IDX(ep_cfg->ep_addr); in usb_dc_ep_configure() 1439 uint8_t ep_dir = USB_EP_GET_DIR(ep_cfg->ep_addr); in usb_dc_ep_configure() 1446 LOG_DBG("%02x", ep_cfg->ep_addr); in usb_dc_ep_configure() 1448 ep_state->iso = ep_cfg->ep_type == USB_DC_EP_ISOCHRONOUS; in usb_dc_ep_configure() 1451 if (ep_cfg->ep_type == USB_DC_EP_CONTROL) { in usb_dc_ep_configure() 1454 ep_state->mps = ep_cfg->ep_mps; in usb_dc_ep_configure() 1460 if (ep_cfg->ep_mps > ep_out_buf_size[ep_idx]) { in usb_dc_ep_configure()
|
D | usb_dc_dw.c | 969 int usb_dc_ep_configure(const struct usb_dc_ep_cfg_data * const ep_cfg) in usb_dc_ep_configure() argument 973 if (!ep_cfg) { in usb_dc_ep_configure() 977 ep = ep_cfg->ep_addr; in usb_dc_ep_configure() 984 usb_dw_ep_set(ep, ep_cfg->ep_mps, ep_cfg->ep_type); in usb_dc_ep_configure()
|
/Zephyr-latest/subsys/tracing/ |
D | tracing_backend_usb.c | 119 static struct usb_ep_cfg_data ep_cfg[] = { variable 139 .num_endpoints = ARRAY_SIZE(ep_cfg), 140 .endpoint = ep_cfg,
|
/Zephyr-latest/samples/subsys/ipc/ipc_service/icmsg/src/ |
D | main.c | 123 static struct ipc_ept_cfg ep_cfg = { variable 151 ret = ipc_service_register_endpoint(ipc0_instance, &ep, &ep_cfg); in main() 202 ret = ipc_service_register_endpoint(ipc0_instance, &ep, &ep_cfg); in main()
|
/Zephyr-latest/samples/subsys/ipc/ipc_service/icmsg/remote/src/ |
D | main.c | 119 static struct ipc_ept_cfg ep_cfg = { variable 142 ret = ipc_service_register_endpoint(ipc0_instance, &ep, &ep_cfg); in main()
|