| /kernel/linux/linux-6.6/drivers/usb/gadget/udc/aspeed-vhub/ |
| D | ep0.c | 5 * ep0.c - Endpoint 0 handling 31 struct usb_request *req = &ep->ep0.req.req; in ast_vhub_reply() 36 if (WARN_ON(!ep->ep0.dir_in)) in ast_vhub_reply() 92 memcpy_fromio(&crq, ep->ep0.setup, sizeof(crq)); in ast_vhub_ep0_handle_setup() 100 ep->ep0.state); in ast_vhub_ep0_handle_setup() 112 if (ep->ep0.state != ep0_state_token && in ast_vhub_ep0_handle_setup() 113 ep->ep0.state != ep0_state_stall) { in ast_vhub_ep0_handle_setup() 118 /* Calculate next state for EP0 */ in ast_vhub_ep0_handle_setup() 119 ep->ep0.state = ep0_state_data; in ast_vhub_ep0_handle_setup() 120 ep->ep0.dir_in = !!(crq.bRequestType & USB_DIR_IN); in ast_vhub_ep0_handle_setup() [all …]
|
| D | vhub.h | 93 /* HUB EP0 control */ 136 * matching corresponding vHub EP0 control bits 215 #define AST_VHUB_EP0_MAX_PACKET 64 /* EP0's max packet size */ 243 * mode (or ep0), any >= 0 value means "last packet" 255 /* Current state of an EP0 */ 264 * An endpoint, either generic, ep0, actual gadget EP 265 * or internal use vhub EP0. vhub EP1 doesn't have an 274 /* EP index in the device, 0 means this is an EP0 */ 277 /* Dev pointer or NULL for vHub EP0 */ 284 * DMA buffer for EP0, fallback DMA buffer for misaligned [all …]
|
| D | core.c | 50 * If this isn't an internal EP0 request, call the core in ast_vhub_done() 139 /* Handle top-level vHub EP0 interrupts */ in ast_vhub_irq() 144 ast_vhub_ep0_handle_ack(&vhub->ep0, true); in ast_vhub_irq() 146 ast_vhub_ep0_handle_ack(&vhub->ep0, false); in ast_vhub_irq() 148 ast_vhub_ep0_handle_setup(&vhub->ep0); in ast_vhub_irq() 225 /* Default settings for EP0, enable HW hub EP1 */ in ast_vhub_init_hw() 232 /* Configure EP0 DMA buffer */ in ast_vhub_init_hw() 233 writel(vhub->ep0.buf_dma, vhub->regs + AST_VHUB_EP0_DATA); in ast_vhub_init_hw() 382 dev_err(&pdev->dev, "Failed to allocate EP0 DMA buffers\n"); in ast_vhub_probe() 386 UDCVDBG(vhub, "EP0 DMA buffers @%p (DMA 0x%08x)\n", in ast_vhub_probe() [all …]
|
| D | dev.c | 38 ast_vhub_ep0_handle_ack(&d->ep0, true); in ast_vhub_dev_irq() 40 ast_vhub_ep0_handle_ack(&d->ep0, false); in ast_vhub_dev_irq() 42 ast_vhub_ep0_handle_setup(&d->ep0); in ast_vhub_dev_irq() 52 /* Cleanup EP0 state */ in ast_vhub_dev_enable() 55 /* Enable device and its EP0 interrupts */ in ast_vhub_dev_enable() 70 /* Set EP0 DMA buffer address */ in ast_vhub_dev_enable() 71 writel(d->ep0.buf_dma, d->regs + AST_VHUB_DEV_EP0_DATA); in ast_vhub_dev_enable() 177 return ast_vhub_simple_reply(&d->ep0, st0, 0); in ast_vhub_dev_status() 202 return ast_vhub_simple_reply(&d->ep0, st0, 0); in ast_vhub_ep_status() 391 /* Only EP0 can be a control endpoint */ in ast_vhub_udc_match_ep() [all …]
|
| /kernel/linux/linux-5.10/drivers/usb/gadget/udc/aspeed-vhub/ |
| D | ep0.c | 5 * ep0.c - Endpoint 0 handling 37 struct usb_request *req = &ep->ep0.req.req; in ast_vhub_reply() 42 if (WARN_ON(!ep->ep0.dir_in)) in ast_vhub_reply() 98 memcpy_fromio(&crq, ep->ep0.setup, sizeof(crq)); in ast_vhub_ep0_handle_setup() 106 ep->ep0.state); in ast_vhub_ep0_handle_setup() 118 if (ep->ep0.state != ep0_state_token && in ast_vhub_ep0_handle_setup() 119 ep->ep0.state != ep0_state_stall) { in ast_vhub_ep0_handle_setup() 124 /* Calculate next state for EP0 */ in ast_vhub_ep0_handle_setup() 125 ep->ep0.state = ep0_state_data; in ast_vhub_ep0_handle_setup() 126 ep->ep0.dir_in = !!(crq.bRequestType & USB_DIR_IN); in ast_vhub_ep0_handle_setup() [all …]
|
| D | vhub.h | 93 /* HUB EP0 control */ 136 * matching corresponding vHub EP0 control bits 215 #define AST_VHUB_EP0_MAX_PACKET 64 /* EP0's max packet size */ 243 * mode (or ep0), any >= 0 value means "last packet" 255 /* Current state of an EP0 */ 264 * An endpoint, either generic, ep0, actual gadget EP 265 * or internal use vhub EP0. vhub EP1 doesn't have an 274 /* EP index in the device, 0 means this is an EP0 */ 277 /* Dev pointer or NULL for vHub EP0 */ 284 * DMA buffer for EP0, fallback DMA buffer for misaligned [all …]
|
| D | core.c | 56 * If this isn't an internal EP0 request, call the core in ast_vhub_done() 145 /* Handle top-level vHub EP0 interrupts */ in ast_vhub_irq() 150 ast_vhub_ep0_handle_ack(&vhub->ep0, true); in ast_vhub_irq() 152 ast_vhub_ep0_handle_ack(&vhub->ep0, false); in ast_vhub_irq() 154 ast_vhub_ep0_handle_setup(&vhub->ep0); in ast_vhub_irq() 231 /* Default settings for EP0, enable HW hub EP1 */ in ast_vhub_init_hw() 238 /* Configure EP0 DMA buffer */ in ast_vhub_init_hw() 239 writel(vhub->ep0.buf_dma, vhub->regs + AST_VHUB_EP0_DATA); in ast_vhub_init_hw() 391 dev_err(&pdev->dev, "Failed to allocate EP0 DMA buffers\n"); in ast_vhub_probe() 395 UDCVDBG(vhub, "EP0 DMA buffers @%p (DMA 0x%08x)\n", in ast_vhub_probe() [all …]
|
| D | dev.c | 44 ast_vhub_ep0_handle_ack(&d->ep0, true); in ast_vhub_dev_irq() 46 ast_vhub_ep0_handle_ack(&d->ep0, false); in ast_vhub_dev_irq() 48 ast_vhub_ep0_handle_setup(&d->ep0); in ast_vhub_dev_irq() 58 /* Cleanup EP0 state */ in ast_vhub_dev_enable() 61 /* Enable device and its EP0 interrupts */ in ast_vhub_dev_enable() 76 /* Set EP0 DMA buffer address */ in ast_vhub_dev_enable() 77 writel(d->ep0.buf_dma, d->regs + AST_VHUB_DEV_EP0_DATA); in ast_vhub_dev_enable() 172 return ast_vhub_simple_reply(&d->ep0, st0, 0); in ast_vhub_dev_status() 197 return ast_vhub_simple_reply(&d->ep0, st0, 0); in ast_vhub_ep_status() 386 /* Only EP0 can be a control endpoint */ in ast_vhub_udc_match_ep() [all …]
|
| /kernel/linux/linux-6.6/drivers/usb/gadget/udc/ |
| D | renesas_usbf.c | 75 /* EP0 registers offsets from Base + USBF_BASE_EP0 (EP0 regs area) */ 313 /* for EP0 control messages */ 344 /* ep0: buf @0x0000 64 bytes, fixed 32 words */ 345 [0] = USBF_EP_INFO("ep0-ctrl", 547 static void usbf_ep0_send_null(struct usbf_ep *ep0, bool is_data1) in usbf_ep0_send_null() argument 555 usbf_ep_reg_bitset(ep0, USBF_REG_EP0_CONTROL, set); in usbf_ep0_send_null() 558 static int usbf_ep0_pio_in(struct usbf_ep *ep0, struct usbf_req *req) in usbf_ep0_pio_in() argument 571 dev_dbg(ep0->udc->dev, "ep0 send null\n"); in usbf_ep0_pio_in() 572 usbf_ep0_send_null(ep0, false); in usbf_ep0_pio_in() 576 if ((req->req.actual % ep0->ep.maxpacket) == 0) { in usbf_ep0_pio_in() [all …]
|
| D | udc-xilinx.c | 28 #define XUSB_EP0_CONFIG_OFFSET 0x0000 /* EP0 Config Reg Offset */ 202 static const char ep0name[] = "ep0"; 261 struct xusb_ep *ep0 = &udc->ep[XUSB_EP_NUMBER_ZERO]; in xudc_wrstatus() local 264 epcfgreg = udc->read_fn(udc->addr + ep0->offset)| in xudc_wrstatus() 266 udc->write_fn(udc->addr, ep0->offset, epcfgreg); in xudc_wrstatus() 267 udc->write_fn(udc->addr, ep0->offset + XUSB_EP_BUF0COUNT_OFFSET, 0); in xudc_wrstatus() 996 * @ep0: pointer to the xusb endpoint 0 structure. 1001 static int __xudc_ep0_queue(struct xusb_ep *ep0, struct xusb_req *req) in __xudc_ep0_queue() argument 1003 struct xusb_udc *udc = ep0->udc; in __xudc_ep0_queue() 1011 if (!list_empty(&ep0->queue)) { in __xudc_ep0_queue() [all …]
|
| /kernel/linux/linux-5.10/tools/usb/ffs-aio-example/simple/device_app/ |
| D | aio_simple.c | 164 static void handle_ep0(int ep0, bool *ready) in handle_ep0() argument 170 pfds[0].fd = ep0; in handle_ep0() 176 ret = read(ep0, &event, sizeof(event)); in handle_ep0() 178 perror("unable to read event from ep0"); in handle_ep0() 185 write(ep0, NULL, 0); in handle_ep0() 187 read(ep0, NULL, 0); in handle_ep0() 209 int ep0; in main() local 234 sprintf(ep_path, "%s/ep0", argv[1]); in main() 235 ep0 = open(ep_path, O_RDWR); in main() 236 if (ep0 < 0) { in main() [all …]
|
| /kernel/linux/linux-6.6/tools/usb/ffs-aio-example/simple/device_app/ |
| D | aio_simple.c | 182 static void handle_ep0(int ep0, bool *ready) in handle_ep0() argument 188 pfds[0].fd = ep0; in handle_ep0() 194 ret = read(ep0, &event, sizeof(event)); in handle_ep0() 196 perror("unable to read event from ep0"); in handle_ep0() 203 write(ep0, NULL, 0); in handle_ep0() 205 read(ep0, NULL, 0); in handle_ep0() 227 int ep0; in main() local 252 sprintf(ep_path, "%s/ep0", argv[1]); in main() 253 ep0 = open(ep_path, O_RDWR); in main() 254 if (ep0 < 0) { in main() [all …]
|
| /kernel/linux/linux-6.6/tools/usb/ffs-aio-example/multibuff/device_app/ |
| D | aio_multibuff.c | 176 static void handle_ep0(int ep0, bool *ready) in handle_ep0() argument 181 ret = read(ep0, &event, sizeof(event)); in handle_ep0() 183 perror("unable to read event from ep0"); in handle_ep0() 190 write(ep0, NULL, 0); in handle_ep0() 192 read(ep0, NULL, 0); in handle_ep0() 240 int ep0, ep1; in main() local 263 sprintf(ep_path, "%s/ep0", argv[1]); in main() 264 ep0 = open(ep_path, O_RDWR); in main() 265 if (ep0 < 0) { in main() 266 perror("unable to open ep0"); in main() [all …]
|
| /kernel/linux/linux-5.10/tools/usb/ffs-aio-example/multibuff/device_app/ |
| D | aio_multibuff.c | 176 static void handle_ep0(int ep0, bool *ready) in handle_ep0() argument 181 ret = read(ep0, &event, sizeof(event)); in handle_ep0() 183 perror("unable to read event from ep0"); in handle_ep0() 190 write(ep0, NULL, 0); in handle_ep0() 192 read(ep0, NULL, 0); in handle_ep0() 240 int ep0, ep1; in main() local 263 sprintf(ep_path, "%s/ep0", argv[1]); in main() 264 ep0 = open(ep_path, O_RDWR); in main() 265 if (ep0 < 0) { in main() 266 perror("unable to open ep0"); in main() [all …]
|
| /kernel/linux/linux-6.6/drivers/usb/gadget/function/ |
| D | u_fs.h | 96 * are refused. All epfiles, except ep0, are deleted so there 102 * ep0 is opened again. In the second case functionfs state will 120 * In this state no open(2), read(2) or write(2) (both on ep0 122 * unlinked and all closed so this is not a problem; ep0 is 123 * also closed but ep0 file exists and so open(2) on ep0 must 134 * there. The next read/write on ep0 will handle the 141 * setup. If this state is set read/write on ep0 return 178 /* how many files are opened (EP0 and others) */ 181 /* EP0 state */ 187 * happens only in ep0 read which is P: mutex [all …]
|
| D | u_generic.h | 145 * are refused. All epfiles, except ep0, are deleted so there 151 * ep0 is opened again. In the second case functionfs state will 169 * In this state no open(2), read(2) or write(2) (both on ep0 171 * unlinked and all closed so this is not a problem; ep0 is 172 * also closed but ep0 file exists and so open(2) on ep0 must 183 * there. The next read/write on ep0 will handle the 190 * setup. If this state is set read/write on ep0 return 229 /* how many files are opened (EP0 and others) */ 232 /* EP0 state */ 238 * happens only in ep0 read which is P: mutex [all …]
|
| /kernel/linux/linux-5.10/drivers/usb/gadget/function/ |
| D | u_fs.h | 98 * are refused. All epfiles, except ep0, are deleted so there 104 * ep0 is opened again. In the second case functionfs state will 122 * In this state no open(2), read(2) or write(2) (both on ep0 124 * unlinked and all closed so this is not a problem; ep0 is 125 * also closed but ep0 file exists and so open(2) on ep0 must 136 * there. The next read/write on ep0 will handle the 143 * setup. If this state is set read/write on ep0 return 180 /* how many files are opened (EP0 and others) */ 183 /* EP0 state */ 189 * happens only in ep0 read which is P: mutex [all …]
|
| D | u_generic.h | 145 * are refused. All epfiles, except ep0, are deleted so there 151 * ep0 is opened again. In the second case functionfs state will 169 * In this state no open(2), read(2) or write(2) (both on ep0 171 * unlinked and all closed so this is not a problem; ep0 is 172 * also closed but ep0 file exists and so open(2) on ep0 must 183 * there. The next read/write on ep0 will handle the 190 * setup. If this state is set read/write on ep0 return 229 /* how many files are opened (EP0 and others) */ 232 /* EP0 state */ 238 * happens only in ep0 read which is P: mutex [all …]
|
| /kernel/linux/linux-5.10/drivers/usb/mtu3/ |
| D | mtu3_gadget_ep0.c | 3 * mtu3_gadget_ep0.c - MediaTek USB3 DRD peripheral driver ep0 handling 17 /* ep0 is always mtu3->in_eps[0] */ 18 #define next_ep0_request(mtu) next_request((mtu)->ep0) 59 mtu3_req_complete(mtu->ep0, req, 0); in ep0_req_giveback() 123 * because the length of test packet is less than max packet of HS ep0, in ep0_load_test_packet() 126 ep0_write_fifo(mtu->ep0, mtu3_test_packet, sizeof(mtu3_test_packet)); in ep0_load_test_packet() 152 dev_dbg(mtu->dev, "ep0: %s STALL, ep0_state: %s\n", in ep0_stall_set() 196 mtu->ep0_req.mep = mtu->ep0; in ep0_set_sel() 200 ret = ep0_queue(mtu->ep0, &mtu->ep0_req); in ep0_set_sel() 263 mtu->ep0_req.mep = mtu->ep0; in ep0_get_status() [all …]
|
| /kernel/linux/linux-6.6/drivers/usb/mtu3/ |
| D | mtu3_gadget_ep0.c | 3 * mtu3_gadget_ep0.c - MediaTek USB3 DRD peripheral driver ep0 handling 17 /* ep0 is always mtu3->in_eps[0] */ 18 #define next_ep0_request(mtu) next_request((mtu)->ep0) 59 mtu3_req_complete(mtu->ep0, req, 0); in ep0_req_giveback() 123 * because the length of test packet is less than max packet of HS ep0, in ep0_load_test_packet() 126 ep0_write_fifo(mtu->ep0, mtu3_test_packet, sizeof(mtu3_test_packet)); in ep0_load_test_packet() 152 dev_dbg(mtu->dev, "ep0: %s STALL, ep0_state: %s\n", in ep0_stall_set() 196 mtu->ep0_req.mep = mtu->ep0; in ep0_set_sel() 200 ret = ep0_queue(mtu->ep0, &mtu->ep0_req); in ep0_set_sel() 265 mtu->ep0_req.mep = mtu->ep0; in ep0_get_status() [all …]
|
| /kernel/linux/linux-6.6/include/uapi/linux/usb/ |
| D | gadgetfs.h | 5 * Other than ep0 operations, most things are done by read() and write() 8 * i/o requests. When ep0 is configured, the device can enumerate; 10 * ep0 require ioctl() operations. 28 * Events are delivered on the ep0 file descriptor, when the user mode driver
|
| /kernel/linux/linux-5.10/include/uapi/linux/usb/ |
| D | gadgetfs.h | 5 * Other than ep0 operations, most things are done by read() and write() 8 * i/o requests. When ep0 is configured, the device can enumerate; 10 * ep0 require ioctl() operations. 28 * Events are delivered on the ep0 file descriptor, when the user mode driver
|
| /kernel/linux/linux-5.10/drivers/usb/gadget/udc/ |
| D | udc-xilinx.c | 29 #define XUSB_EP0_CONFIG_OFFSET 0x0000 /* EP0 Config Reg Offset */ 201 static const char ep0name[] = "ep0"; 260 struct xusb_ep *ep0 = &udc->ep[XUSB_EP_NUMBER_ZERO]; in xudc_wrstatus() local 263 epcfgreg = udc->read_fn(udc->addr + ep0->offset)| in xudc_wrstatus() 265 udc->write_fn(udc->addr, ep0->offset, epcfgreg); in xudc_wrstatus() 266 udc->write_fn(udc->addr, ep0->offset + XUSB_EP_BUF0COUNT_OFFSET, 0); in xudc_wrstatus() 995 * @ep0: pointer to the xusb endpoint 0 structure. 1000 static int __xudc_ep0_queue(struct xusb_ep *ep0, struct xusb_req *req) in __xudc_ep0_queue() argument 1002 struct xusb_udc *udc = ep0->udc; in __xudc_ep0_queue() 1010 if (!list_empty(&ep0->queue)) { in __xudc_ep0_queue() [all …]
|
| /kernel/linux/linux-6.6/drivers/usb/gadget/legacy/ |
| D | inode.c | 45 * are two types of files. One type is for the device, implementing ep0. 83 /* /dev/gadget/$CHIP represents ep0 and the whole device */ 89 * ep0/device i/o modes and binding to the controller. Driver 95 /* From then on, ep0 fd is in either of two basic modes: 104 /* UNBOUND means the driver closed ep0, so the device won't be 125 /* drivers reading ep0 MUST handle control requests (SETUP) 148 /* except this scratch i/o buffer for ep0 */ 237 * at the end of ep0 configuration, or after unbind. 840 /* EP0 IMPLEMENTATION can be partly in userspace. 893 DBG (dev, "ep0 request busy!\n"); in setup_req() [all …]
|
| /kernel/linux/linux-5.10/drivers/usb/gadget/legacy/ |
| D | inode.c | 45 * are two types of files. One type is for the device, implementing ep0. 83 /* /dev/gadget/$CHIP represents ep0 and the whole device */ 89 * ep0/device i/o modes and binding to the controller. Driver 95 /* From then on, ep0 fd is in either of two basic modes: 104 /* UNBOUND means the driver closed ep0, so the device won't be 125 /* drivers reading ep0 MUST handle control requests (SETUP) 148 /* except this scratch i/o buffer for ep0 */ 237 * at the end of ep0 configuration, or after unbind. 842 /* EP0 IMPLEMENTATION can be partly in userspace. 895 DBG (dev, "ep0 request busy!\n"); in setup_req() [all …]
|