Lines Matching full:ep0

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()
163 writel(VHUB_EP0_CTRL_STALL, ep->ep0.ctlstat); in ast_vhub_ep0_handle_setup()
164 ep->ep0.state = ep0_state_stall; in ast_vhub_ep0_handle_setup()
165 ep->ep0.dir_in = false; in ast_vhub_ep0_handle_setup()
170 writel(VHUB_EP0_TX_BUFF_RDY, ep->ep0.ctlstat); in ast_vhub_ep0_handle_setup()
171 ep->ep0.state = ep0_state_status; in ast_vhub_ep0_handle_setup()
172 ep->ep0.dir_in = false; in ast_vhub_ep0_handle_setup()
192 ep->ep0.state = ep0_state_status; in ast_vhub_ep0_do_send()
193 writel(VHUB_EP0_RX_BUFF_RDY, ep->ep0.ctlstat); in ast_vhub_ep0_do_send()
222 writel(reg, ep->ep0.ctlstat); in ast_vhub_ep0_do_send()
223 writel(reg | VHUB_EP0_TX_BUFF_RDY, ep->ep0.ctlstat); in ast_vhub_ep0_do_send()
232 writel(VHUB_EP0_RX_BUFF_RDY, ep->ep0.ctlstat); in ast_vhub_ep0_rx_prime()
266 ep->ep0.state = ep0_state_status; in ast_vhub_ep0_do_receive()
267 writel(VHUB_EP0_TX_BUFF_RDY, ep->ep0.ctlstat); in ast_vhub_ep0_do_receive()
281 /* Read EP0 status */ in ast_vhub_ep0_handle_ack()
282 stat = readl(ep->ep0.ctlstat); in ast_vhub_ep0_handle_ack()
288 stat, ep->ep0.state, ep->ep0.dir_in, in_ack, req); in ast_vhub_ep0_handle_ack()
290 switch(ep->ep0.state) { in ast_vhub_ep0_handle_ack()
302 if ((ep->ep0.dir_in && (stat & VHUB_EP0_TX_BUFF_RDY)) || in ast_vhub_ep0_handle_ack()
303 (!ep->ep0.dir_in && (stat & VHUB_EP0_RX_BUFF_RDY)) || in ast_vhub_ep0_handle_ack()
304 (ep->ep0.dir_in != in_ack)) { in ast_vhub_ep0_handle_ack()
320 if (ep->ep0.dir_in) in ast_vhub_ep0_handle_ack()
337 if (ep->ep0.dir_in == in_ack) { in ast_vhub_ep0_handle_ack()
353 writel(VHUB_EP0_CTRL_STALL, ep->ep0.ctlstat); in ast_vhub_ep0_handle_ack()
354 ep->ep0.state = ep0_state_stall; in ast_vhub_ep0_handle_ack()
356 ep->ep0.state = ep0_state_token; in ast_vhub_ep0_handle_ack()
370 dev_warn(dev, "Bogus EP0 request ! u_req=%p\n", u_req); in ast_vhub_ep0_queue()
395 u_req->short_not_ok, ep->ep0.dir_in); in ast_vhub_ep0_queue()
405 /* EP0 can only support a single request at a time */ in ast_vhub_ep0_queue()
407 ep->ep0.state == ep0_state_token || in ast_vhub_ep0_queue()
408 ep->ep0.state == ep0_state_stall) { in ast_vhub_ep0_queue()
409 dev_warn(dev, "EP0: Request in wrong state\n"); in ast_vhub_ep0_queue()
410 EPVDBG(ep, "EP0: list_empty=%d state=%d\n", in ast_vhub_ep0_queue()
411 list_empty(&ep->queue), ep->ep0.state); in ast_vhub_ep0_queue()
419 if (ep->ep0.dir_in) { in ast_vhub_ep0_queue()
425 ep->ep0.state = ep0_state_status; in ast_vhub_ep0_queue()
426 writel(VHUB_EP0_TX_BUFF_RDY, ep->ep0.ctlstat); in ast_vhub_ep0_queue()
462 writel(VHUB_EP0_CTRL_STALL, ep->ep0.ctlstat); in ast_vhub_ep0_dequeue()
463 ep->ep0.state = ep0_state_status; in ast_vhub_ep0_dequeue()
464 ep->ep0.dir_in = false; in ast_vhub_ep0_dequeue()
481 struct ast_vhub_ep *ep = &dev->ep0; in ast_vhub_reset_ep0()
484 ep->ep0.state = ep0_state_token; in ast_vhub_reset_ep0()
496 ep->ep.name = "ep0"; in ast_vhub_init_ep0()
502 ep->ep0.state = ep0_state_token; in ast_vhub_init_ep0()
503 INIT_LIST_HEAD(&ep->ep0.req.queue); in ast_vhub_init_ep0()
504 ep->ep0.req.internal = true; in ast_vhub_init_ep0()
508 ep->ep0.ctlstat = dev->regs + AST_VHUB_DEV_EP0_CTRL; in ast_vhub_init_ep0()
509 ep->ep0.setup = vhub->regs + in ast_vhub_init_ep0()
516 ep->ep0.ctlstat = vhub->regs + AST_VHUB_EP0_CTRL; in ast_vhub_init_ep0()
517 ep->ep0.setup = vhub->regs + AST_VHUB_SETUP0; in ast_vhub_init_ep0()