Lines Matching refs:hci

47 static inline int hcs_urb_queue (hci_t * hci, struct urb * urb)  in hcs_urb_queue()  argument
68 hc_flush_data_cache (hci, urb->setup_packet, 8); in hcs_urb_queue()
70 hc_flush_data_cache (hci, urb->transfer_buffer, in hcs_urb_queue()
73 qu_queue_urb (hci, urb); in hcs_urb_queue()
91 static int hcs_return_urb (hci_t * hci, struct urb * urb, int resub_ok) in hcs_return_urb() argument
115 hcs_urb_queue (hci, urb); in hcs_return_urb()
138 hci_t *hci; in hci_submit_urb() local
152 hci = (hci_t *) urb->dev->bus->hcpriv; in hci_submit_urb()
156 if (usb_pipedevice (pipe) == hci->rh.devnum) { in hci_submit_urb()
166 ret = hcs_urb_queue (hci, urb); in hci_submit_urb()
192 hci_t *hci; in hci_unlink_urb() local
204 hci = (hci_t *) urb->dev->bus->hcpriv; in hci_unlink_urb()
207 if (usb_pipedevice (urb->pipe) == hci->rh.devnum) { in hci_unlink_urb()
224 list_add (&urb->urb_list, &hci->del_list); in hci_unlink_urb()
230 add_wait_queue (&hci->waitq, &wait); in hci_unlink_urb()
237 list_add (&urb->urb_list, &hci->del_list); in hci_unlink_urb()
248 remove_wait_queue (&hci->waitq, &wait); in hci_unlink_urb()
334 hci_t *hci = usb_dev->bus->hcpriv; in hci_get_current_frame_number() local
336 hci->frame_number); in hci_get_current_frame_number()
338 return (hci->frame_number); in hci_get_current_frame_number()
463 static inline void qu_queue_active_urb (hci_t * hci, struct urb * urb, epd_t * ed) in qu_queue_active_urb() argument
469 list_add (&urb->urb_list, &hci->ctrl_list); in qu_queue_active_urb()
474 list_add (&urb->urb_list, &hci->bulk_list); in qu_queue_active_urb()
486 urb->start_frame = hci->frame_number; in qu_queue_active_urb()
487 list_add (&urb->urb_list, &hci->intr_list); in qu_queue_active_urb()
491 list_add (&urb->urb_list, &hci->iso_list); in qu_queue_active_urb()
517 static int qu_queue_urb (hci_t * hci, struct urb * urb) in qu_queue_urb() argument
535 qu_queue_active_urb (hci, urb, ed); in qu_queue_urb()
536 if (++hci->active_urbs == 1) in qu_queue_urb()
537 hc_start_int (hci); in qu_queue_urb()
555 static struct urb *qu_next_urb (hci_t * hci, struct urb * urb, int resub_ok) in qu_next_urb() argument
570 if (!--hci->active_urbs) in qu_next_urb()
571 hc_stop_int (hci); in qu_next_urb()
578 qu_queue_active_urb (hci, urb, ed); in qu_next_urb()
598 static struct urb *qu_return_urb (hci_t * hci, struct urb * urb, int resub_ok) in qu_return_urb() argument
603 next_urb = qu_next_urb (hci, urb, resub_ok); in qu_return_urb()
604 hcs_return_urb (hci, urb, resub_ok); in qu_return_urb()
623 static int sh_scan_iso_urb_list (hci_t * hci, struct list_head *list_lh,
630 hci->td_array->len = 0;
637 if (!sh_add_packet (hci, urb)) {
643 urb = qu_return_urb (hci, urb, 1);
645 urb = qu_next_urb (hci, urb, 1);
668 static int sh_scan_urb_list (hci_t * hci, struct list_head *list_lh) in sh_scan_urb_list() argument
684 || (((hci->frame_number - urb->start_frame) in sh_scan_urb_list()
687 urb->start_frame, hci->frame_number, urb->interval, in sh_scan_urb_list()
689 if (!sh_add_packet (hci, urb)) { in sh_scan_urb_list()
693 urb->start_frame, hci->frame_number, in sh_scan_urb_list()
695 urb->start_frame = hci->frame_number; in sh_scan_urb_list()
716 static int sh_schedule_trans (hci_t * hci, int isSOF) in sh_schedule_trans() argument
721 if (hci == NULL) { in sh_schedule_trans()
725 if (hci->td_array == NULL) { in sh_schedule_trans()
730 if (hci->td_array->len != 0) { in sh_schedule_trans()
732 hci->td_array->len); in sh_schedule_trans()
738 if (hci->td_array->len == 0 && !list_empty (&hci->intr_list)) { in sh_schedule_trans()
739 units_left = sh_scan_urb_list (hci, &hci->intr_list); in sh_schedule_trans()
745 if (hci->td_array->len == 0 && !list_empty (&hci->ctrl_list) && units_left > 0) { in sh_schedule_trans()
746 units_left = sh_scan_urb_list (hci, &hci->ctrl_list); in sh_schedule_trans()
752 if (hci->td_array->len == 0 && !list_empty (&hci->bulk_list) && units_left > 0) { in sh_schedule_trans()
753 sh_scan_urb_list (hci, &hci->bulk_list); in sh_schedule_trans()
758 lh = hci->bulk_list.next; in sh_schedule_trans()
759 list_del (&hci->bulk_list); in sh_schedule_trans()
760 list_add (&hci->bulk_list, lh); in sh_schedule_trans()
777 static int sh_add_packet (hci_t * hci, struct urb * urb) in sh_add_packet() argument
801 i = hci->frame_number - urb->start_frame; in sh_add_packet()
824 if (!hci->last_packet_nak) { in sh_add_packet()
829 hci->nakCnt = 0; in sh_add_packet()
858 hc_add_trans (hci, len, data, toggle, maxps, slow, endpoint, in sh_add_packet()
864 maxps, len, ret, data, hci->hp.units_left); in sh_add_packet()
867 hci->td_array->td[hci->td_array->len].urb = urb; in sh_add_packet()
868 hci->td_array->td[hci->td_array->len].len = ret; in sh_add_packet()
869 hci->td_array->td[hci->td_array->len].iso_index = i; in sh_add_packet()
870 hci->td_array->len++; in sh_add_packet()
871 hci->active_trans = 1; in sh_add_packet()
914 static int sh_done_list (hci_t * hci, int *isExcessNak) in sh_done_list() argument
935 hci->td_array->len); in sh_done_list()
937 debugLen = hci->td_array->len; in sh_done_list()
940 hci->td_array->len); in sh_done_list()
942 for (trans = 0; ret && trans < hci->td_array->len && trans < MAX_TRANS; in sh_done_list()
944 urb = hci->td_array->td[trans].urb; in sh_done_list()
958 len = hci->td_array->td[trans].len; in sh_done_list()
962 iso_index = hci->td_array->td[trans].iso_index; in sh_done_list()
976 ret = hc_parse_trans (hci, &actbytes, data, &cc, &toggle, len, in sh_done_list()
1025 if (hci->nakCnt < 0x10000) { in sh_done_list()
1026 hci->nakCnt++; in sh_done_list()
1027 hci->last_packet_nak = 1; in sh_done_list()
1034 hci->nakCnt = 0; in sh_done_list()
1037 hci->nakCnt = 0; in sh_done_list()
1038 hci->last_packet_nak = 0; in sh_done_list()
1061 hci->td_array->len = 0; in sh_done_list()
1062 qu_return_urb (hci, urb, 1); in sh_done_list()
1080 if (debugLen != hci->td_array->len) { in sh_done_list()
1083 debugLen, hci->td_array->len); in sh_done_list()
1086 hci->td_array->len = 0; in sh_done_list()