Lines Matching refs:urb
84 struct urb *urb, int is_out,
194 struct urb *urb = next_urb(qh); in musb_start_urb() local
195 void *buf = urb->transfer_buffer; in musb_start_urb()
198 unsigned pipe = urb->pipe; in musb_start_urb()
212 buf = urb->setup_packet; in musb_start_urb()
219 offset = urb->iso_frame_desc[0].offset; in musb_start_urb()
220 len = urb->iso_frame_desc[0].length; in musb_start_urb()
225 buf = urb->transfer_buffer + urb->actual_length; in musb_start_urb()
226 len = urb->transfer_buffer_length - urb->actual_length; in musb_start_urb()
230 qh, urb, address, qh->epnum, in musb_start_urb()
244 musb_ep_program(musb, epnum, urb, !is_in, buf, offset, len); in musb_start_urb()
262 if ((urb->transfer_flags & URB_ISO_ASAP) in musb_start_urb()
263 || (frame >= urb->start_frame)) { in musb_start_urb()
271 qh->frame = urb->start_frame; in musb_start_urb()
294 static void musb_giveback(struct musb *musb, struct urb *urb, int status) in musb_giveback() argument
300 urb, urb->complete, status, in musb_giveback()
301 usb_pipedevice(urb->pipe), in musb_giveback()
302 usb_pipeendpoint(urb->pipe), in musb_giveback()
303 usb_pipein(urb->pipe) ? "in" : "out", in musb_giveback()
304 urb->actual_length, urb->transfer_buffer_length in musb_giveback()
307 usb_hcd_unlink_urb_from_ep(musb_to_hcd(musb), urb); in musb_giveback()
309 usb_hcd_giveback_urb(musb_to_hcd(musb), urb, status); in musb_giveback()
315 struct urb *urb) in musb_save_toggle() argument
330 usb_settoggle(urb->dev, qh->epnum, !is_in, csr ? 1 : 0); in musb_save_toggle()
340 static void musb_advance_schedule(struct musb *musb, struct urb *urb, in musb_advance_schedule() argument
348 status = (urb->status == -EINPROGRESS) ? 0 : urb->status; in musb_advance_schedule()
354 musb_save_toggle(qh, is_in, urb); in musb_advance_schedule()
358 if (status == 0 && urb->error_count) in musb_advance_schedule()
365 musb_giveback(musb, urb, status); in musb_advance_schedule()
450 musb_host_packet_rx(struct musb *musb, struct urb *urb, u8 epnum, u8 iso_err) in musb_host_packet_rx() argument
461 int pipe = urb->pipe; in musb_host_packet_rx()
462 void *buffer = urb->transfer_buffer; in musb_host_packet_rx()
467 urb->transfer_buffer, qh->offset, in musb_host_packet_rx()
468 urb->transfer_buffer_length); in musb_host_packet_rx()
478 urb->error_count++; in musb_host_packet_rx()
481 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_packet_rx()
487 urb->error_count++; in musb_host_packet_rx()
493 urb->actual_length += length; in musb_host_packet_rx()
499 done = (++qh->iso_idx >= urb->number_of_packets); in musb_host_packet_rx()
504 length = urb->transfer_buffer_length - qh->offset; in musb_host_packet_rx()
506 if (urb->status == -EINPROGRESS) in musb_host_packet_rx()
507 urb->status = -EOVERFLOW; in musb_host_packet_rx()
512 urb->actual_length += length; in musb_host_packet_rx()
516 done = (urb->actual_length == urb->transfer_buffer_length) in musb_host_packet_rx()
518 || (urb->status != -EINPROGRESS); in musb_host_packet_rx()
520 && (urb->status == -EINPROGRESS) in musb_host_packet_rx()
521 && (urb->transfer_flags & URB_SHORT_NOT_OK) in musb_host_packet_rx()
522 && (urb->actual_length in musb_host_packet_rx()
523 < urb->transfer_buffer_length)) in musb_host_packet_rx()
524 urb->status = -EREMOTEIO; in musb_host_packet_rx()
619 struct urb *urb, u32 offset, u32 length) in musb_tx_dma_program() argument
655 mode = (urb->transfer_flags & URB_ZERO_PACKET) ? 1 : 0; in musb_tx_dma_program()
667 urb->transfer_dma + offset, length)) { in musb_tx_dma_program()
684 struct urb *urb, int is_out, in musb_ep_program() argument
699 epnum, urb, urb->dev->speed, in musb_ep_program()
755 if (usb_gettoggle(urb->dev, qh->epnum, 1)) in musb_ep_program()
809 hw_ep, qh, urb, offset, len)) in musb_ep_program()
829 if (usb_gettoggle(urb->dev, qh->epnum, 0)) in musb_ep_program()
866 packet_sz, !(urb->transfer_flags & in musb_ep_program()
868 urb->transfer_dma + offset, in musb_ep_program()
889 static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb) in musb_h_ep0_continue() argument
900 fifo_dest = urb->transfer_buffer + urb->actual_length; in musb_h_ep0_continue()
901 fifo_count = min_t(size_t, len, urb->transfer_buffer_length - in musb_h_ep0_continue()
902 urb->actual_length); in musb_h_ep0_continue()
904 urb->status = -EOVERFLOW; in musb_h_ep0_continue()
908 urb->actual_length += fifo_count; in musb_h_ep0_continue()
913 } else if (urb->actual_length < in musb_h_ep0_continue()
914 urb->transfer_buffer_length) in musb_h_ep0_continue()
918 request = (struct usb_ctrlrequest *) urb->setup_packet; in musb_h_ep0_continue()
936 urb->transfer_buffer_length - in musb_h_ep0_continue()
937 urb->actual_length); in musb_h_ep0_continue()
939 fifo_dest = (u8 *) (urb->transfer_buffer in musb_h_ep0_continue()
940 + urb->actual_length); in musb_h_ep0_continue()
947 urb->actual_length += fifo_count; in musb_h_ep0_continue()
967 struct urb *urb; in musb_h_ep0_irq() local
978 urb = next_urb(qh); in musb_h_ep0_irq()
987 csr, qh, len, urb, musb->ep0_stage); in musb_h_ep0_irq()
1022 if (urb) in musb_h_ep0_irq()
1023 urb->status = status; in musb_h_ep0_irq()
1042 if (unlikely(!urb)) { in musb_h_ep0_irq()
1053 if (musb_h_ep0_continue(musb, len, urb)) { in musb_h_ep0_irq()
1059 if (usb_pipeout(urb->pipe) in musb_h_ep0_irq()
1060 || !urb->transfer_buffer_length) in musb_h_ep0_irq()
1080 musb_advance_schedule(musb, urb, hw_ep, 1); in musb_h_ep0_irq()
1113 struct urb *urb = next_urb(qh); in musb_host_tx() local
1123 if (!urb) { in musb_host_tx()
1128 pipe = urb->pipe; in musb_host_tx()
1269 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_tx()
1272 if (++qh->iso_idx >= urb->number_of_packets) { in musb_host_tx()
1280 } else if (dma && urb->transfer_buffer_length == qh->offset) { in musb_host_tx()
1286 else if (qh->offset == urb->transfer_buffer_length in musb_host_tx()
1287 && !(urb->transfer_flags in musb_host_tx()
1292 length = urb->transfer_buffer_length - offset; in musb_host_tx()
1301 if (urb->status != -EINPROGRESS) { in musb_host_tx()
1304 status = urb->status; in musb_host_tx()
1309 urb->status = status; in musb_host_tx()
1310 urb->actual_length = qh->offset; in musb_host_tx()
1311 musb_advance_schedule(musb, urb, hw_ep, USB_DIR_OUT); in musb_host_tx()
1314 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, in musb_host_tx()
1335 usb_hcd_unmap_urb_for_dma(musb_to_hcd(musb), urb); in musb_host_tx()
1336 musb_write_fifo(hw_ep, length, urb->transfer_buffer + offset); in musb_host_tx()
1390 struct urb *urb; in musb_bulk_rx_nak_timeout() local
1407 urb = next_urb(cur_qh); in musb_bulk_rx_nak_timeout()
1411 urb->actual_length += dma->actual_len; in musb_bulk_rx_nak_timeout()
1414 musb_save_toggle(cur_qh, 1, urb); in musb_bulk_rx_nak_timeout()
1434 struct urb *urb; in musb_host_rx() local
1449 urb = next_urb(qh); in musb_host_rx()
1457 if (unlikely(!urb)) { in musb_host_rx()
1468 pipe = urb->pipe; in musb_host_rx()
1471 epnum, rx_csr, urb->actual_length, in musb_host_rx()
1501 if (usb_pipebulk(urb->pipe) in musb_host_rx()
1587 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_rx()
1596 if (++qh->iso_idx >= urb->number_of_packets) in musb_host_rx()
1603 done = (urb->actual_length + xfer_len >= in musb_host_rx()
1604 urb->transfer_buffer_length in musb_host_rx()
1622 } else if (urb->status == -EINPROGRESS) { in musb_host_rx()
1650 urb->transfer_dma in musb_host_rx()
1651 + urb->actual_length, in musb_host_rx()
1653 urb->transfer_buffer_length); in musb_host_rx()
1661 d = urb->iso_frame_desc + qh->iso_idx; in musb_host_rx()
1665 urb->error_count++; in musb_host_rx()
1670 urb->error_count++; in musb_host_rx()
1679 buf = urb->transfer_dma + d->offset; in musb_host_rx()
1682 buf = urb->transfer_dma + in musb_host_rx()
1683 urb->actual_length; in musb_host_rx()
1691 if ((urb->transfer_flags & in musb_host_rx()
1693 && (urb->transfer_buffer_length - in musb_host_rx()
1694 urb->actual_length) in musb_host_rx()
1701 length = urb->transfer_buffer_length; in musb_host_rx()
1761 usb_hcd_unmap_urb_for_dma(musb_to_hcd(musb), urb); in musb_host_rx()
1762 done = musb_host_packet_rx(musb, urb, in musb_host_rx()
1769 urb->actual_length += xfer_len; in musb_host_rx()
1772 if (urb->status == -EINPROGRESS) in musb_host_rx()
1773 urb->status = status; in musb_host_rx()
1774 musb_advance_schedule(musb, urb, hw_ep, USB_DIR_IN); in musb_host_rx()
1795 struct urb *urb = next_urb(qh); in musb_schedule() local
1848 toggle = usb_gettoggle(urb->dev, qh->epnum, !is_in); in musb_schedule()
1916 struct urb *urb, argument
1921 struct usb_host_endpoint *hep = urb->ep;
1933 ret = usb_hcd_link_urb_to_ep(hcd, urb);
1936 urb->hcpriv = qh;
1959 usb_hcd_unlink_urb_from_ep(hcd, urb);
1965 qh->dev = urb->dev;
1981 ok = (usb_pipein(urb->pipe) && musb->hb_iso_rx)
1982 || (usb_pipeout(urb->pipe) && musb->hb_iso_tx);
1993 qh->addr_reg = (u8) usb_pipedevice(urb->pipe);
1997 switch (urb->dev->speed) {
2016 if (urb->dev->speed <= USB_SPEED_FULL) {
2047 struct usb_device *parent = urb->dev->parent;
2049 struct usb_device *parent = usb_dev_get_parent(urb->dev);
2061 if (urb->dev->tt) {
2062 qh->h_port_reg = (u8) urb->dev->ttport;
2063 if (urb->dev->tt->hub)
2065 (u8) urb->dev->tt->hub->devnum;
2066 if (urb->dev->tt->multi)
2070 if (tt_needed(musb, urb->dev)) {
2073 usb_find_usb2_hub_address_port(urb->dev,
2100 urb->hcpriv = qh;
2110 usb_hcd_unlink_urb_from_ep(hcd, urb);
2122 static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh) argument
2129 int is_in = usb_pipein(urb->pipe);
2144 urb, status);
2145 urb->actual_length += dma->actual_len;
2176 musb_advance_schedule(ep->musb, urb, ep, is_in);
2186 struct urb *urb, argument
2192 int is_in = usb_pipein(urb->pipe);
2195 dev_dbg(musb->controller, "urb=%p, dev%d ep%d%s\n", urb,
2196 usb_pipedevice(urb->pipe),
2197 usb_pipeendpoint(urb->pipe),
2201 ret = usb_hcd_check_unlink_urb(hcd, urb, status);
2205 qh = urb->hcpriv;
2222 || urb->urb_list.prev != &qh->hep->urb_list
2227 musb_giveback(musb, urb, 0);
2239 ret = musb_cleanup_urb(urb, qh);
2254 struct urb *urb; local
2267 urb = next_urb(qh);
2270 if (!urb->unlinked)
2271 urb->status = -ESHUTDOWN;
2274 musb_cleanup_urb(urb, qh);
2280 urb = next_urb(qh);
2281 urb->status = -ESHUTDOWN;
2282 musb_advance_schedule(musb, urb, qh->hw_ep, is_in);