• Home
  • Raw
  • Download

Lines Matching refs:urb

76 	struct urb *urb;  member
89 struct urb *urb; member
155 dev_dbg(dev, "urb: 0x%p\n", td->urb); in dbg_td()
212 static void c67x00_release_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_release_urb() argument
217 BUG_ON(!urb); in c67x00_release_urb()
221 if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) { in c67x00_release_urb()
233 if (urb == td->urb) in c67x00_release_urb()
234 td->urb = NULL; in c67x00_release_urb()
236 urbp = urb->hcpriv; in c67x00_release_urb()
237 urb->hcpriv = NULL; in c67x00_release_urb()
245 c67x00_ep_data_alloc(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_ep_data_alloc() argument
247 struct usb_host_endpoint *hep = urb->ep; in c67x00_ep_data_alloc()
273 ep_data->dev = usb_get_dev(urb->dev); in c67x00_ep_data_alloc()
281 type = usb_pipetype(urb->pipe); in c67x00_ep_data_alloc()
357 struct urb *urb, gfp_t mem_flags) in c67x00_urb_enqueue() argument
363 int port = get_root_port(urb->dev)-1; in c67x00_urb_enqueue()
380 ret = usb_hcd_link_urb_to_ep(hcd, urb); in c67x00_urb_enqueue()
385 urbp->urb = urb; in c67x00_urb_enqueue()
388 urbp->ep_data = c67x00_ep_data_alloc(c67x00, urb); in c67x00_urb_enqueue()
398 urb->hcpriv = urbp; in c67x00_urb_enqueue()
400 urb->actual_length = 0; /* Nothing received/transmitted yet */ in c67x00_urb_enqueue()
402 switch (usb_pipetype(urb->pipe)) { in c67x00_urb_enqueue()
404 urb->interval = SETUP_STAGE; in c67x00_urb_enqueue()
416 urb->start_frame = urbp->ep_data->next_frame; in c67x00_urb_enqueue()
419 struct urb *last_urb; in c67x00_urb_enqueue()
423 hep_node)->urb; in c67x00_urb_enqueue()
424 urb->start_frame = in c67x00_urb_enqueue()
446 usb_hcd_unlink_urb_from_ep(hcd, urb); in c67x00_urb_enqueue()
455 int c67x00_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) in c67x00_urb_dequeue() argument
462 rc = usb_hcd_check_unlink_urb(hcd, urb, status); in c67x00_urb_dequeue()
466 c67x00_release_urb(c67x00, urb); in c67x00_urb_dequeue()
467 usb_hcd_unlink_urb_from_ep(hcd, urb); in c67x00_urb_dequeue()
470 usb_hcd_giveback_urb(hcd, urb, status); in c67x00_urb_dequeue()
488 c67x00_giveback_urb(struct c67x00_hcd *c67x00, struct urb *urb, int status) in c67x00_giveback_urb() argument
492 if (!urb) in c67x00_giveback_urb()
495 urbp = urb->hcpriv; in c67x00_giveback_urb()
500 c67x00_release_urb(c67x00, urb); in c67x00_giveback_urb()
501 usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb); in c67x00_giveback_urb()
503 usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, status); in c67x00_giveback_urb()
509 static int c67x00_claim_frame_bw(struct c67x00_hcd *c67x00, struct urb *urb, in c67x00_claim_frame_bw() argument
512 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_claim_frame_bw()
532 if (usb_pipein(urb->pipe)) in c67x00_claim_frame_bw()
538 if (usb_pipeisoc(urb->pipe)) in c67x00_claim_frame_bw()
539 bit_time = usb_pipein(urb->pipe) ? 9050 : 7840; in c67x00_claim_frame_bw()
577 static int c67x00_create_td(struct c67x00_hcd *c67x00, struct urb *urb, in c67x00_create_td() argument
582 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_create_td()
587 if (c67x00_claim_frame_bw(c67x00, urb, len, usb_pipeisoc(urb->pipe) in c67x00_create_td()
588 || usb_pipeint(urb->pipe))) in c67x00_create_td()
595 td->pipe = urb->pipe; in c67x00_create_td()
642 td->urb = urb; in c67x00_create_td()
659 static int c67x00_add_data_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_data_urb() argument
668 toggle = usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe), in c67x00_add_data_urb()
669 usb_pipeout(urb->pipe)); in c67x00_add_data_urb()
670 remaining = urb->transfer_buffer_length - urb->actual_length; in c67x00_add_data_urb()
672 maxps = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe)); in c67x00_add_data_urb()
674 need_empty = (urb->transfer_flags & URB_ZERO_PACKET) && in c67x00_add_data_urb()
675 usb_pipeout(urb->pipe) && !(remaining % maxps); in c67x00_add_data_urb()
685 pid = usb_pipeout(urb->pipe) ? USB_PID_OUT : USB_PID_IN; in c67x00_add_data_urb()
686 td_buf = urb->transfer_buffer + urb->transfer_buffer_length - in c67x00_add_data_urb()
688 ret = c67x00_create_td(c67x00, urb, td_buf, len, pid, toggle, in c67x00_add_data_urb()
695 if (usb_pipecontrol(urb->pipe)) in c67x00_add_data_urb()
705 static int c67x00_add_ctrl_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_ctrl_urb() argument
710 switch (urb->interval) { in c67x00_add_ctrl_urb()
713 ret = c67x00_create_td(c67x00, urb, urb->setup_packet, in c67x00_add_ctrl_urb()
717 urb->interval = SETUP_STAGE; in c67x00_add_ctrl_urb()
718 usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), in c67x00_add_ctrl_urb()
719 usb_pipeout(urb->pipe), 1); in c67x00_add_ctrl_urb()
722 if (urb->transfer_buffer_length) { in c67x00_add_ctrl_urb()
723 ret = c67x00_add_data_urb(c67x00, urb); in c67x00_add_ctrl_urb()
729 pid = !usb_pipeout(urb->pipe) ? USB_PID_OUT : USB_PID_IN; in c67x00_add_ctrl_urb()
730 ret = c67x00_create_td(c67x00, urb, NULL, 0, pid, 1, in c67x00_add_ctrl_urb()
743 static int c67x00_add_int_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_int_urb() argument
745 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_add_int_urb()
749 frame_add(urbp->ep_data->next_frame, urb->interval); in c67x00_add_int_urb()
750 return c67x00_add_data_urb(c67x00, urb); in c67x00_add_int_urb()
755 static int c67x00_add_iso_urb(struct c67x00_hcd *c67x00, struct urb *urb) in c67x00_add_iso_urb() argument
757 struct c67x00_urb_priv *urbp = urb->hcpriv; in c67x00_add_iso_urb()
763 BUG_ON(urbp->cnt >= urb->number_of_packets); in c67x00_add_iso_urb()
765 td_buf = urb->transfer_buffer + in c67x00_add_iso_urb()
766 urb->iso_frame_desc[urbp->cnt].offset; in c67x00_add_iso_urb()
767 len = urb->iso_frame_desc[urbp->cnt].length; in c67x00_add_iso_urb()
768 pid = usb_pipeout(urb->pipe) ? USB_PID_OUT : USB_PID_IN; in c67x00_add_iso_urb()
770 ret = c67x00_create_td(c67x00, urb, td_buf, len, pid, 0, in c67x00_add_iso_urb()
775 urb->iso_frame_desc[urbp->cnt].actual_length = 0; in c67x00_add_iso_urb()
776 urb->iso_frame_desc[urbp->cnt].status = ret; in c67x00_add_iso_urb()
777 if (urbp->cnt + 1 == urb->number_of_packets) in c67x00_add_iso_urb()
778 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_add_iso_urb()
782 frame_add(urbp->ep_data->next_frame, urb->interval); in c67x00_add_iso_urb()
791 int (*add)(struct c67x00_hcd *, struct urb *)) in c67x00_fill_from_list() argument
794 struct urb *urb; in c67x00_fill_from_list() local
801 urb = list_entry(ep_data->queue.next, in c67x00_fill_from_list()
803 hep_node)->urb; in c67x00_fill_from_list()
804 add(c67x00, urb); in c67x00_fill_from_list()
874 struct urb *urb = td->urb; in c67x00_end_of_data() local
887 remaining = urb->transfer_buffer_length - urb->actual_length; in c67x00_end_of_data()
888 need_empty = (urb->transfer_flags & URB_ZERO_PACKET) && in c67x00_end_of_data()
889 usb_pipeout(urb->pipe) && !(remaining % maxps); in c67x00_end_of_data()
923 struct urb *urb = td->urb; in c67x00_handle_successful_td() local
925 if (!urb) in c67x00_handle_successful_td()
928 urb->actual_length += td_actual_bytes(td); in c67x00_handle_successful_td()
935 urb->interval = in c67x00_handle_successful_td()
936 urb->transfer_buffer_length ? in c67x00_handle_successful_td()
939 urb->actual_length = 0; in c67x00_handle_successful_td()
944 urb->interval = STATUS_STAGE; in c67x00_handle_successful_td()
950 urb->interval = 0; in c67x00_handle_successful_td()
951 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_handle_successful_td()
960 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_handle_successful_td()
968 struct urb *urb = td->urb; in c67x00_handle_isoc() local
972 if (!urb) in c67x00_handle_isoc()
975 urbp = urb->hcpriv; in c67x00_handle_isoc()
979 urb->error_count++; in c67x00_handle_isoc()
981 urb->iso_frame_desc[cnt].actual_length = td_actual_bytes(td); in c67x00_handle_isoc()
982 urb->iso_frame_desc[cnt].status = c67x00_td_to_error(c67x00, td); in c67x00_handle_isoc()
983 if (cnt + 1 == urb->number_of_packets) /* Last packet */ in c67x00_handle_isoc()
984 c67x00_giveback_urb(c67x00, urb, 0); in c67x00_handle_isoc()
996 struct urb *urb; in c67x00_check_td_list() local
1003 urb = td->urb; /* urb can be NULL! */ in c67x00_check_td_list()
1018 c67x00_giveback_urb(c67x00, urb, in c67x00_check_td_list()
1033 c67x00_giveback_urb(c67x00, urb, -EOVERFLOW); in c67x00_check_td_list()