/Zephyr-latest/drivers/usb/device/ |
D | usb_dc_sam0.c | 4 * SPDX-License-Identifier: Apache-2.0 32 /* The endpoint size stored in USB.PCKSIZE.SIZE */ 77 static void usb_sam0_ep_isr(uint8_t ep) in usb_sam0_ep_isr() argument 80 UsbDevice *regs = ®S->DEVICE; in usb_sam0_ep_isr() 81 UsbDeviceEndpoint *endpoint = ®s->DeviceEndpoint[ep]; in usb_sam0_ep_isr() 82 uint32_t intflag = endpoint->EPINTFLAG.reg; in usb_sam0_ep_isr() 84 endpoint->EPINTFLAG.reg = intflag; in usb_sam0_ep_isr() 88 data->ep_cb[0][ep](ep, USB_DC_EP_SETUP); in usb_sam0_ep_isr() 92 /* Out (to device) data received */ in usb_sam0_ep_isr() 93 data->ep_cb[0][ep](ep, USB_DC_EP_DATA_OUT); in usb_sam0_ep_isr() [all …]
|
D | usb_dc_native_posix.c | 4 * SPDX-License-Identifier: Apache-2.0 58 uint8_t buf[64]; member 72 static uint8_t usbip_ep_is_valid(uint8_t ep) in usbip_ep_is_valid() argument 74 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usbip_ep_is_valid() 76 /* Check if ep is valid */ in usbip_ep_is_valid() 77 if ((USB_EP_DIR_IS_OUT(ep)) && in usbip_ep_is_valid() 80 } else if ((USB_EP_DIR_IS_IN(ep)) && in usbip_ep_is_valid() 88 static uint8_t usbip_ep_is_enabled(uint8_t ep) in usbip_ep_is_enabled() argument 90 uint8_t ep_idx = USB_EP_GET_IDX(ep); in usbip_ep_is_enabled() 92 LOG_DBG("ep %x", ep); in usbip_ep_is_enabled() [all …]
|
D | usb_dc_nrfx.c | 5 * SPDX-License-Identifier: Apache-2.0 25 #include <zephyr/dt-bindings/regulator/nrf5x.h> 78 * @param max_sz Max packet size supported by endpoint. 115 * @param buf Endpoint buffer 128 struct nrf_usbd_ep_buf buf; member 138 * @param ep Endpoint control block pointer 142 struct nrf_usbd_ep_ctx *ep; member 192 /** Number of OUT Endpoints configured (including control) */ 199 /** Number of ISO OUT Endpoints */ 212 * Max buffers size possible: 1536 Bytes (8 EP * 64B + 1 ISO * 1024B) [all …]
|
/Zephyr-latest/drivers/usb/udc/ |
D | udc_common.c | 2 * Copyright (c) 2021-2022 Nordic Semiconductor ASA 4 * SPDX-License-Identifier: Apache-2.0 24 static inline uint8_t *udc_pool_data_alloc(struct net_buf *const buf, in udc_pool_data_alloc() argument 25 size_t *const size, k_timeout_t timeout) in udc_pool_data_alloc() argument 27 struct net_buf_pool *const buf_pool = net_buf_pool_get(buf->pool_id); in udc_pool_data_alloc() 28 struct k_heap *const pool = buf_pool->alloc->alloc_data; in udc_pool_data_alloc() 31 *size = ROUND_UP(*size, UDC_BUF_GRANULARITY); in udc_pool_data_alloc() 32 b = k_heap_aligned_alloc(pool, UDC_BUF_ALIGN, *size, timeout); in udc_pool_data_alloc() 34 *size = 0; in udc_pool_data_alloc() 41 static inline void udc_pool_data_unref(struct net_buf *buf, uint8_t *const data) in udc_pool_data_unref() argument [all …]
|
D | udc_numaker.c | 4 * SPDX-License-Identifier: Apache-2.0 40 /* Reserve DMA buffer for Setup/CTRL OUT/CTRL IN, required to be 8-byte aligned */ 48 /* OUT transaction for specific EP completed */ 50 /* IN transaction for specific EP completed */ 52 /* Re-activate queued transfer for specific EP */ 68 uint8_t ep; member 69 } out; member 71 uint8_t ep; member 74 uint8_t ep; member 79 /* EP H/W context */ [all …]
|
D | udc_nrf.c | 4 * SPDX-License-Identifier: Apache-2.0 23 #include <zephyr/dt-bindings/regulator/nrf5x.h> 34 * There is no real advantage to change control endpoint size 53 uint8_t ep; member 90 /* Allow data chunk on EP0 OUT */ in udc_nrf_clear_control_out() 93 LOG_INF("Allow data OUT"); in udc_nrf_clear_control_out() 97 static void udc_event_xfer_in_next(const struct device *dev, const uint8_t ep) in udc_event_xfer_in_next() argument 99 struct net_buf *buf; in udc_event_xfer_in_next() local 101 if (udc_ep_is_busy(dev, ep)) { in udc_event_xfer_in_next() 105 buf = udc_buf_peek(dev, ep); in udc_event_xfer_in_next() [all …]
|
D | udc_common.h | 2 * Copyright (c) 2021-2022 Nordic Semiconductor ASA 4 * SPDX-License-Identifier: Apache-2.0 35 struct udc_data *data = dev->data; in udc_get_private() 37 return data->priv; in udc_get_private() 54 * @param[in] ep Endpoint address 59 const uint8_t ep); 65 * @param[in] ep Endpoint address 69 bool udc_ep_is_busy(const struct device *dev, const uint8_t ep); 75 * @param[in] ep Endpoint address 78 void udc_ep_set_busy(const struct device *dev, const uint8_t ep, [all …]
|
D | udc_smartbond.c | 4 * SPDX-License-Identifier: Apache-2.0 30 /* Size of hardware RX and TX FIFO. */ 39 #define REG_GET_BIT(reg, field) (USB->reg & USB_##reg##_##field##_Msk) 40 #define REG_SET_BIT(reg, field) (USB->reg |= USB_##reg##_##field##_Msk) 41 #define REG_CLR_BIT(reg, field) (USB->reg &= ~USB_##reg##_##field##_Msk) 43 (USB->reg = (USB->reg & ~USB_##reg##_##field##_Msk) | (val << USB_##reg##_##field##_Pos)) 69 * Those two following states are added to allow going out of sleep mode 91 struct net_buf *buf; member 92 /** Packet size sent or received so far. It is used to modify transferred field 93 * after ACK is received or when filling ISO endpoint with size larger then [all …]
|
D | udc_stm32.c | 4 * SPDX-License-Identifier: Apache-2.0 78 const struct device *dev = priv->dev; in HAL_PCD_ResetCallback() 79 const struct udc_stm32_config *cfg = dev->config; in HAL_PCD_ResetCallback() 80 struct udc_ep_config *ep; in HAL_PCD_ResetCallback() local 82 /* Re-Enable control endpoints */ in HAL_PCD_ResetCallback() 83 ep = udc_get_ep_cfg(dev, USB_CONTROL_EP_OUT); in HAL_PCD_ResetCallback() 84 if (ep && ep->stat.enabled) { in HAL_PCD_ResetCallback() 85 HAL_PCD_EP_Open(&priv->pcd, USB_CONTROL_EP_OUT, cfg->ep0_mps, in HAL_PCD_ResetCallback() 89 ep = udc_get_ep_cfg(dev, USB_CONTROL_EP_IN); in HAL_PCD_ResetCallback() 90 if (ep && ep->stat.enabled) { in HAL_PCD_ResetCallback() [all …]
|
D | udc_kinetis.c | 5 * SPDX-License-Identifier: Apache-2.0 43 * There is no real advantage to change control endpoint size 95 /* Trigger next transfer, must not be used for control OUT */ 99 /* OUT transaction for specific endpoint is finished */ 112 uint8_t ep; member 122 * Buffer pointers and busy flags used only for control OUT 137 const struct usbfsotg_config *config = dev->config; in usbfsotg_get_ebd() 140 bd_idx = USB_EP_GET_IDX(cfg->addr) * 4U + (cfg->stat.odd ^ opposite); in usbfsotg_get_ebd() 141 if (USB_EP_DIR_IS_IN(cfg->addr)) { in usbfsotg_get_ebd() 145 return &config->bdt[bd_idx]; in usbfsotg_get_ebd() [all …]
|
D | udc_ambiq.c | 4 * SPDX-License-Identifier: Apache-2.0 28 /* OUT transaction completed */ 39 uint8_t ep; member 76 static int udc_ambiq_rx(const struct device *dev, uint8_t ep, struct net_buf *buf); 81 struct net_buf *buf; in usbd_ctrl_feed_dout() local 83 buf = udc_ctrl_alloc(dev, USB_CONTROL_EP_OUT, length); in usbd_ctrl_feed_dout() 84 if (buf == NULL) { in usbd_ctrl_feed_dout() 85 return -ENOMEM; in usbd_ctrl_feed_dout() 88 k_fifo_put(&cfg->fifo, buf); in usbd_ctrl_feed_dout() 90 udc_ambiq_rx(dev, cfg->addr, buf); in usbd_ctrl_feed_dout() [all …]
|
D | udc_renesas_ra.c | 4 * SPDX-License-Identifier: Apache-2.0 45 uint8_t ep; member 55 const struct device *dev = p_args->p_context; in udc_renesas_ra_event_handler() 58 switch (p_args->event.event_id) { in udc_renesas_ra_event_handler() 85 evt.hal_evt = p_args->event; in udc_renesas_ra_event_handler() 97 static void udc_event_xfer_next(const struct device *dev, const uint8_t ep) in udc_event_xfer_next() argument 100 struct net_buf *buf; in udc_event_xfer_next() local 102 if (udc_ep_is_busy(dev, ep)) { in udc_event_xfer_next() 106 buf = udc_buf_peek(dev, ep); in udc_event_xfer_next() 107 if (buf != NULL) { in udc_event_xfer_next() [all …]
|
D | udc_dwc2.c | 4 * SPDX-License-Identifier: Apache-2.0 28 /* Trigger next transfer, must not be used for control OUT */ 44 /* Minimum RX FIFO size in 32-bit words considering the largest used OUT packet 45 * of 512 bytes. The value must be adjusted according to the number of OUT 49 /* Default Rx FIFO size in 32-bit words calculated to support High-Speed with: 51 * * Global OUT NAK: 1 location 53 * Driver adds 2 locations for each OUT endpoint to this value. 57 /* TX FIFO0 depth in 32-bit words (used by control IN endpoint) 105 /* Transfer triggers (IN on bits 0-15, OUT on bits 16-31) */ 107 /* Finished transactions (IN on bits 0-15, OUT on bits 16-31) */ [all …]
|
D | udc_mcux_ehci.c | 4 * SPDX-License-Identifier: Apache-2.0 29 * There is no real advantage to change control endpoint size 80 const struct udc_mcux_config *config = dev->config; in udc_mcux_control() 81 const usb_device_controller_interface_struct_t *mcux_if = config->mcux_if; in udc_mcux_control() 85 status = mcux_if->deviceControl(priv->mcux_device.controllerHandle, in udc_mcux_control() 89 return -ENOMEM; in udc_mcux_control() 95 /* If ep is busy, return busy. Otherwise feed the buf to controller */ 98 struct net_buf *const buf) in udc_mcux_ep_feed() argument 100 const struct udc_mcux_config *config = dev->config; in udc_mcux_ep_feed() 101 const usb_device_controller_interface_struct_t *mcux_if = config->mcux_if; in udc_mcux_ep_feed() [all …]
|
D | udc_it82xx2.c | 4 * SPDX-License-Identifier: Apache-2.0 15 #include <zephyr/dt-bindings/interrupt-controller/it8xxx2-wuc.h> 42 /* The related definitions of the register EP STATUS: 51 /* The bit definitions of the register EP RX/TX FIFO Control: 76 #define DC_CONNECT_TO_HOST BIT(6) /* internal pull-up */ 104 uint8_t ep; member 127 /* shared OUT FIFO state */ 159 * EP mapping because when (ep_idx % SHARED_FIFO_NUM) is 3, it actually means the EP0. 167 const struct usb_it82xx2_config *config = dev->config; in it82xx2_get_ext_ctrl() 168 struct usb_it82xx2_regs *const usb_regs = config->base; in it82xx2_get_ext_ctrl() [all …]
|
D | udc_mcux_ip3511.c | 4 * SPDX-License-Identifier: Apache-2.0 29 * There is no real advantage to change control endpoint size 80 const struct udc_mcux_config *config = dev->config; in udc_mcux_control() 81 const usb_device_controller_interface_struct_t *mcux_if = config->mcux_if; in udc_mcux_control() 85 status = mcux_if->deviceControl(priv->mcux_device.controllerHandle, in udc_mcux_control() 89 return -ENOMEM; in udc_mcux_control() 95 /* If ep is busy, return busy. Otherwise feed the buf to controller */ 98 struct net_buf *const buf) in udc_mcux_ep_feed() argument 100 const struct udc_mcux_config *config = dev->config; in udc_mcux_ep_feed() 101 const usb_device_controller_interface_struct_t *mcux_if = config->mcux_if; in udc_mcux_ep_feed() [all …]
|
/Zephyr-latest/dts/bindings/usb/ |
D | renesas,smartbond-usbd.yaml | 2 # SPDX-License-Identifier: Apache-2.0 6 compatible: "renesas,smartbond-usbd" 8 include: usb-ep.yaml 11 dma-min-transfer-size: 14 Minimum transfer size required to engage DMA. 16 ep-out-buf-size: 20 Buffer size for OUT end points 0-3. 22 fifo-read-threshold: 25 RX FIFO is 64 bytes. When endpoint size is greater then 64, 40 iso-out-mps: [all …]
|
/Zephyr-latest/samples/subsys/usb/webusb-next/src/ |
D | sfunc.c | 4 * SPDX-License-Identifier: Apache-2.0 46 struct sfunc_desc *desc = data->desc; in sfunc_get_bulk_out() 49 return desc->if0_hs_out_ep.bEndpointAddress; in sfunc_get_bulk_out() 52 return desc->if0_out_ep.bEndpointAddress; in sfunc_get_bulk_out() 59 struct sfunc_desc *desc = data->desc; in sfunc_get_bulk_in() 62 return desc->if0_hs_in_ep.bEndpointAddress; in sfunc_get_bulk_in() 65 return desc->if0_in_ep.bEndpointAddress; in sfunc_get_bulk_in() 69 struct net_buf *buf, int err) in sfunc_request_handler() argument 75 bi = (struct udc_buf_info *)net_buf_user_data(buf); in sfunc_request_handler() 76 LOG_INF("Transfer finished %p -> ep 0x%02x, len %u, err %d", in sfunc_request_handler() [all …]
|
/Zephyr-latest/include/zephyr/drivers/usb/ |
D | udc.h | 2 * Copyright (c) 2021-2022 Nordic Semiconductor ASA 4 * SPDX-License-Identifier: Apache-2.0 22 * @brief Maximum packet size of control endpoint supported by the controller. 41 /** Controller performs status OUT stage automatically */ 47 /** Maximum packet size for control endpoint */ 69 /** Maximum packet size of the endpoint buffer */ 79 /** High-Bandwidth (interrupt or iso) capable endpoint */ 83 /** OUT transfer capable endpoint */ 84 uint32_t out : 1; member 121 /** Maximum packet size */ [all …]
|
/Zephyr-latest/subsys/usb/device_next/class/ |
D | usbd_uac2.c | 2 * Copyright (c) 2023-2024 Nordic Semiconductor ASA 4 * SPDX-License-Identifier: Apache-2.0 33 /* Net buf is used mostly with external data. The main reason behind external 37 * requires 6 bytes) and feedback endpoint (4 bytes on High-Speed, 3 bytes on 38 * Full-Speed). Because the total number of endpoints is really small (typically 40 * the USB specification itself is 30 non-control endpoints). Therefore, the 51 /* A.14 Audio Class-Specific Request Codes */ 60 #define CONTROL_ATTRIBUTE(setup) (setup->bRequest) 61 #define CONTROL_ENTITY_ID(setup) ((setup->wIndex & 0xFF00) >> 8) 62 #define CONTROL_SELECTOR(setup) ((setup->wValue & 0xFF00) >> 8) [all …]
|
D | usbd_msc.c | 4 * SPDX-License-Identifier: Apache-2.0 63 /* Can be 64 if device is not High-Speed capable */ 72 /* NULL to request Bulk-Only Mass Storage Reset 75 struct net_buf *buf; member 130 static struct net_buf *msc_buf_alloc(const uint8_t ep) in msc_buf_alloc() argument 132 struct net_buf *buf = NULL; in msc_buf_alloc() local 135 buf = net_buf_alloc(&msc_ep_pool, K_NO_WAIT); in msc_buf_alloc() 136 if (!buf) { in msc_buf_alloc() 140 bi = udc_get_buf_info(buf); in msc_buf_alloc() 141 bi->ep = ep; in msc_buf_alloc() [all …]
|
D | bt_hci.c | 5 * SPDX-License-Identifier: Apache-2.0 10 * - HCI commands through control endpoint (host-to-device only) 11 * - HCI events through interrupt IN endpoint 12 * - ACL data through one bulk IN and one bulk OUT endpoints 18 * - Remote wakeup before IN transfer is not yet supported. 19 * - H4 transport layer is not yet supported 31 #include <zephyr/bluetooth/buf.h> 71 * with maximum packet size of high speed bulk endpoint. 130 struct usbd_bt_hci_desc *desc = data->desc; in bt_hci_get_int_in() 132 return desc->if0_int_ep.bEndpointAddress; in bt_hci_get_int_in() [all …]
|
D | usbd_cdc_ecm.c | 5 * SPDX-License-Identifier: Apache-2.0 97 struct usbd_cdc_ecm_desc *desc = data->desc; in cdc_ecm_get_ctrl_if() 99 return desc->if0.bInterfaceNumber; in cdc_ecm_get_ctrl_if() 106 struct cdc_ecm_eth_data *data = dev->data; in cdc_ecm_get_int_in() 107 struct usbd_cdc_ecm_desc *desc = data->desc; in cdc_ecm_get_int_in() 110 return desc->if0_hs_int_ep.bEndpointAddress; in cdc_ecm_get_int_in() 113 return desc->if0_int_ep.bEndpointAddress; in cdc_ecm_get_int_in() 120 struct cdc_ecm_eth_data *data = dev->data; in cdc_ecm_get_bulk_in() 121 struct usbd_cdc_ecm_desc *desc = data->desc; in cdc_ecm_get_bulk_in() 124 return desc->if1_1_hs_in_ep.bEndpointAddress; in cdc_ecm_get_bulk_in() [all …]
|
/Zephyr-latest/subsys/bluetooth/audio/ |
D | ascs.c | 6 * Copyright (c) 2022-2023 Nordic Semiconductor ASA 9 * SPDX-License-Identifier: Apache-2.0 69 #define ASE_ID(_ase) ase->ep.status.id 79 struct bt_bap_ep ep; member 94 /* Minimum state size when in the codec configured state */ 96 /* Minimum state size when in the QoS configured state */ 99 /* Calculate the size requirement of the ASE BUF, based on the maximum possible 100 * size of the Codec Configured state or the QoS Configured state, as either 112 (BT_ATT_BUF_SIZE - NTF_HEADER_SIZE) >= ASE_BUF_SIZE || 113 DIV_ROUND_UP(ASE_BUF_SIZE, (BT_ATT_BUF_SIZE - NTF_HEADER_SIZE)) <= [all …]
|
/Zephyr-latest/subsys/usb/device/class/ |
D | msc.c | 6 * Copyright (c) 2010-2011 mbed.org, MIT License 24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 52 /* MSC Request Codes for Bulk-Only Transport */ 62 /* MSC Bulk-Only Command Block Wrapper (CBW) */ 81 /* MSC Bulk-Only Command Status Wrapper (CSW) */ 108 /* max USB packet size */ 112 #define DISK_THREAD_PRIO -5 152 /* Second Endpoint OUT */ 175 * Align for cases where the underlying disk access requires word-aligned 187 static void mass_storage_bulk_out(uint8_t ep, [all …]
|