• Home
  • Raw
  • Download

Lines Matching refs:urb

62 	struct urb *urb;  member
75 struct urb *urb; member
141 dev_dbg(dev, "urb: 0x%p\n", td->urb); in dbg_td()
198 static void c67x00_release_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_release_urb() argument
203 BUG_ON(!urb); in c67x00_release_urb()
207 if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) { in c67x00_release_urb()
219 if (urb == td->urb) in c67x00_release_urb()
220 td->urb = NULL; in c67x00_release_urb()
222 urbp = urb->hcpriv; in c67x00_release_urb()
223 urb->hcpriv = NULL; in c67x00_release_urb()
231 c67x00_ep_data_alloc(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_ep_data_alloc() argument
233 struct usb_host_endpoint *hep = urb->ep; in c67x00_ep_data_alloc()
259 ep_data->dev = usb_get_dev(urb->dev); in c67x00_ep_data_alloc()
267 type = usb_pipetype(urb->pipe); in c67x00_ep_data_alloc()
343 struct urb *urb, gfp_t mem_flags) in c67x00_urb_enqueue() argument
349 int port = get_root_port(urb->dev)-1; in c67x00_urb_enqueue()
366 ret = usb_hcd_link_urb_to_ep(hcd, urb); in c67x00_urb_enqueue()
371 urbp->urb = urb; in c67x00_urb_enqueue()
374 urbp->ep_data = c67x00_ep_data_alloc(c67x00, urb); in c67x00_urb_enqueue()
384 urb->hcpriv = urbp; in c67x00_urb_enqueue()
386 urb->actual_length = 0; /* Nothing received/transmitted yet */ in c67x00_urb_enqueue()
388 switch (usb_pipetype(urb->pipe)) { in c67x00_urb_enqueue()
390 urb->interval = SETUP_STAGE; in c67x00_urb_enqueue()
402 urb->start_frame = urbp->ep_data->next_frame; in c67x00_urb_enqueue()
405 struct urb *last_urb; in c67x00_urb_enqueue()
409 hep_node)->urb; in c67x00_urb_enqueue()
410 urb->start_frame = in c67x00_urb_enqueue()
432 usb_hcd_unlink_urb_from_ep(hcd, urb); in c67x00_urb_enqueue()
441 int c67x00_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) in c67x00_urb_dequeue() argument
448 rc = usb_hcd_check_unlink_urb(hcd, urb, status); in c67x00_urb_dequeue()
452 c67x00_release_urb(c67x00, urb); in c67x00_urb_dequeue()
453 usb_hcd_unlink_urb_from_ep(hcd, urb); in c67x00_urb_dequeue()
456 usb_hcd_giveback_urb(hcd, urb, status); in c67x00_urb_dequeue()
474 c67x00_giveback_urb(struct c67x00_hcd *c67x00, struct urb *urb, int status) in c67x00_giveback_urb() argument
478 if (!urb) in c67x00_giveback_urb()
481 urbp = urb->hcpriv; in c67x00_giveback_urb()
486 c67x00_release_urb(c67x00, urb); in c67x00_giveback_urb()
487 usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb); in c67x00_giveback_urb()
489 usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, status); in c67x00_giveback_urb()
495 static int c67x00_claim_frame_bw(struct c67x00_hcd *c67x00, struct urb *urb, in c67x00_claim_frame_bw() argument
498 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_claim_frame_bw()
518 if (usb_pipein(urb->pipe)) in c67x00_claim_frame_bw()
524 if (usb_pipeisoc(urb->pipe)) in c67x00_claim_frame_bw()
525 bit_time = usb_pipein(urb->pipe) ? 9050 : 7840; in c67x00_claim_frame_bw()
563 static int c67x00_create_td(struct c67x00_hcd *c67x00, struct urb *urb, in c67x00_create_td() argument
568 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_create_td()
573 if (c67x00_claim_frame_bw(c67x00, urb, len, usb_pipeisoc(urb->pipe) in c67x00_create_td()
574 || usb_pipeint(urb->pipe))) in c67x00_create_td()
581 td->pipe = urb->pipe; in c67x00_create_td()
628 td->urb = urb; in c67x00_create_td()
645 static int c67x00_add_data_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_data_urb() argument
654 toggle = usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe), in c67x00_add_data_urb()
655 usb_pipeout(urb->pipe)); in c67x00_add_data_urb()
656 remaining = urb->transfer_buffer_length - urb->actual_length; in c67x00_add_data_urb()
658 maxps = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe)); in c67x00_add_data_urb()
660 need_empty = (urb->transfer_flags & URB_ZERO_PACKET) && in c67x00_add_data_urb()
661 usb_pipeout(urb->pipe) && !(remaining % maxps); in c67x00_add_data_urb()
671 pid = usb_pipeout(urb->pipe) ? USB_PID_OUT : USB_PID_IN; in c67x00_add_data_urb()
672 td_buf = urb->transfer_buffer + urb->transfer_buffer_length - in c67x00_add_data_urb()
674 ret = c67x00_create_td(c67x00, urb, td_buf, len, pid, toggle, in c67x00_add_data_urb()
681 if (usb_pipecontrol(urb->pipe)) in c67x00_add_data_urb()
691 static int c67x00_add_ctrl_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_ctrl_urb() argument
696 switch (urb->interval) { in c67x00_add_ctrl_urb()
699 ret = c67x00_create_td(c67x00, urb, urb->setup_packet, in c67x00_add_ctrl_urb()
703 urb->interval = SETUP_STAGE; in c67x00_add_ctrl_urb()
704 usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), in c67x00_add_ctrl_urb()
705 usb_pipeout(urb->pipe), 1); in c67x00_add_ctrl_urb()
708 if (urb->transfer_buffer_length) { in c67x00_add_ctrl_urb()
709 ret = c67x00_add_data_urb(c67x00, urb); in c67x00_add_ctrl_urb()
716 pid = !usb_pipeout(urb->pipe) ? USB_PID_OUT : USB_PID_IN; in c67x00_add_ctrl_urb()
717 ret = c67x00_create_td(c67x00, urb, NULL, 0, pid, 1, in c67x00_add_ctrl_urb()
730 static int c67x00_add_int_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_int_urb() argument
732 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_add_int_urb()
736 frame_add(urbp->ep_data->next_frame, urb->interval); in c67x00_add_int_urb()
737 return c67x00_add_data_urb(c67x00, urb); in c67x00_add_int_urb()
742 static int c67x00_add_iso_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_iso_urb() argument
744 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_add_iso_urb()
750 BUG_ON(urbp->cnt >= urb->number_of_packets); in c67x00_add_iso_urb()
752 td_buf = urb->transfer_buffer + in c67x00_add_iso_urb()
753 urb->iso_frame_desc[urbp->cnt].offset; in c67x00_add_iso_urb()
754 len = urb->iso_frame_desc[urbp->cnt].length; in c67x00_add_iso_urb()
755 pid = usb_pipeout(urb->pipe) ? USB_PID_OUT : USB_PID_IN; in c67x00_add_iso_urb()
757 ret = c67x00_create_td(c67x00, urb, td_buf, len, pid, 0, in c67x00_add_iso_urb()
762 urb->iso_frame_desc[urbp->cnt].actual_length = 0; in c67x00_add_iso_urb()
763 urb->iso_frame_desc[urbp->cnt].status = ret; in c67x00_add_iso_urb()
764 if (urbp->cnt + 1 == urb->number_of_packets) in c67x00_add_iso_urb()
765 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_add_iso_urb()
769 frame_add(urbp->ep_data->next_frame, urb->interval); in c67x00_add_iso_urb()
778 int (*add)(struct c67x00_hcd *, struct urb *)) in c67x00_fill_from_list() argument
781 struct urb *urb; in c67x00_fill_from_list() local
788 urb = list_entry(ep_data->queue.next, in c67x00_fill_from_list()
790 hep_node)->urb; in c67x00_fill_from_list()
791 add(c67x00, urb); in c67x00_fill_from_list()
861 struct urb *urb = td->urb; in c67x00_end_of_data() local
874 remaining = urb->transfer_buffer_length - urb->actual_length; in c67x00_end_of_data()
875 need_empty = (urb->transfer_flags & URB_ZERO_PACKET) && in c67x00_end_of_data()
876 usb_pipeout(urb->pipe) && !(remaining % maxps); in c67x00_end_of_data()
910 struct urb *urb = td->urb; in c67x00_handle_successful_td() local
912 if (!urb) in c67x00_handle_successful_td()
915 urb->actual_length += td_actual_bytes(td); in c67x00_handle_successful_td()
922 urb->interval = in c67x00_handle_successful_td()
923 urb->transfer_buffer_length ? in c67x00_handle_successful_td()
926 urb->actual_length = 0; in c67x00_handle_successful_td()
931 urb->interval = STATUS_STAGE; in c67x00_handle_successful_td()
937 urb->interval = 0; in c67x00_handle_successful_td()
938 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_handle_successful_td()
947 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_handle_successful_td()
955 struct urb *urb = td->urb; in c67x00_handle_isoc() local
958 if (!urb) in c67x00_handle_isoc()
964 urb->error_count++; in c67x00_handle_isoc()
966 urb->iso_frame_desc[cnt].actual_length = td_actual_bytes(td); in c67x00_handle_isoc()
967 urb->iso_frame_desc[cnt].status = c67x00_td_to_error(c67x00, td); in c67x00_handle_isoc()
968 if (cnt + 1 == urb->number_of_packets) /* Last packet */ in c67x00_handle_isoc()
969 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_handle_isoc()
981 struct urb *urb; in c67x00_check_td_list() local
988 urb = td->urb; /* urb can be NULL! */ in c67x00_check_td_list()
1003 c67x00_giveback_urb(c67x00, urb, in c67x00_check_td_list()
1018 c67x00_giveback_urb(c67x00, urb, -EOVERFLOW); in c67x00_check_td_list()