Lines Matching refs:ep
167 struct isp116x_ep *ep; in pack_fifo() local
175 for (ep = isp116x->atl_active; ep; ep = ep->active) { in pack_fifo()
176 ptd = &ep->ptd; in pack_fifo()
178 dump_ptd_out_data(ptd, ep->data); in pack_fifo()
185 if (ep->active || (isp116x->atl_last_dir != PTD_DIR_IN)) { in pack_fifo()
186 write_ptddata_to_fifo(isp116x, ep->data, ep->length); in pack_fifo()
187 buflen -= ALIGN(ep->length, 4); in pack_fifo()
199 struct isp116x_ep *ep; in unpack_fifo() local
207 for (ep = isp116x->atl_active; ep; ep = ep->active) { in unpack_fifo()
208 ptd = &ep->ptd; in unpack_fifo()
215 if (ep->active || (isp116x->atl_last_dir == PTD_DIR_IN)) { in unpack_fifo()
216 read_ptddata_from_fifo(isp116x, ep->data, ep->length); in unpack_fifo()
217 buflen -= ALIGN(ep->length, 4); in unpack_fifo()
220 dump_ptd_in_data(ptd, ep->data); in unpack_fifo()
232 struct isp116x_ep *ep; in preproc_atl_queue() local
237 for (ep = isp116x->atl_active; ep; ep = ep->active) { in preproc_atl_queue()
240 BUG_ON(list_empty(&ep->hep->urb_list)); in preproc_atl_queue()
241 urb = container_of(ep->hep->urb_list.next, in preproc_atl_queue()
243 ptd = &ep->ptd; in preproc_atl_queue()
244 len = ep->length; in preproc_atl_queue()
245 ep->data = (unsigned char *)urb->transfer_buffer in preproc_atl_queue()
248 switch (ep->nextpid) { in preproc_atl_queue()
250 toggle = usb_gettoggle(urb->dev, ep->epnum, 0); in preproc_atl_queue()
254 toggle = usb_gettoggle(urb->dev, ep->epnum, 1); in preproc_atl_queue()
259 ep->data = urb->setup_packet; in preproc_atl_queue()
270 ep->nextpid); in preproc_atl_queue()
275 ptd->mps = PTD_MPS(ep->maxpacket) in preproc_atl_queue()
277 | PTD_EP(ep->epnum); in preproc_atl_queue()
280 if (!ep->active) { in preproc_atl_queue()
293 static void finish_request(struct isp116x *isp116x, struct isp116x_ep *ep, in finish_request() argument
299 ep->error_count = 0; in finish_request()
302 ep->nextpid = USB_PID_SETUP; in finish_request()
312 if (!list_empty(&ep->hep->urb_list)) in finish_request()
316 if (!list_empty(&ep->schedule)) { in finish_request()
317 list_del_init(&ep->schedule); in finish_request()
322 DBG("deschedule qh%d/%p branch %d\n", ep->period, ep, ep->branch); in finish_request()
323 for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) { in finish_request()
327 while (*prev && ((temp = *prev) != ep)) in finish_request()
330 *prev = ep->next; in finish_request()
331 isp116x->load[i] -= ep->load; in finish_request()
333 ep->branch = PERIODIC_SIZE; in finish_request()
335 ep->load / ep->period; in finish_request()
349 struct isp116x_ep *ep; in postproc_atl_queue() local
357 for (ep = isp116x->atl_active; ep; ep = ep->active) { in postproc_atl_queue()
358 BUG_ON(list_empty(&ep->hep->urb_list)); in postproc_atl_queue()
360 container_of(ep->hep->urb_list.next, struct urb, urb_list); in postproc_atl_queue()
362 ptd = &ep->ptd; in postproc_atl_queue()
379 ep->error_count = 1; in postproc_atl_queue()
380 usb_settoggle(udev, ep->epnum, in postproc_atl_queue()
381 ep->nextpid == USB_PID_OUT, in postproc_atl_queue()
390 && (++ep->error_count >= 3 || cc == TD_CC_STALL in postproc_atl_queue()
393 if (ep->nextpid == USB_PID_ACK) in postproc_atl_queue()
394 ep->nextpid = 0; in postproc_atl_queue()
407 if (ep->error_count in postproc_atl_queue()
409 ep->error_count = 0; in postproc_atl_queue()
413 if (ep->nextpid == USB_PID_OUT) in postproc_atl_queue()
414 usb_settoggle(udev, ep->epnum, 1, PTD_GET_TOGGLE(ptd) in postproc_atl_queue()
415 ^ (ep->error_count > 0)); in postproc_atl_queue()
416 else if (ep->nextpid == USB_PID_IN) in postproc_atl_queue()
417 usb_settoggle(udev, ep->epnum, 0, PTD_GET_TOGGLE(ptd) in postproc_atl_queue()
418 ^ (ep->error_count > 0)); in postproc_atl_queue()
420 switch (ep->nextpid) { in postproc_atl_queue()
432 && ep->nextpid == USB_PID_OUT in postproc_atl_queue()
433 && !(PTD_GET_COUNT(ptd) % ep->maxpacket)) { in postproc_atl_queue()
440 ep->nextpid = USB_PID_ACK; in postproc_atl_queue()
449 ep->nextpid = USB_PID_ACK; in postproc_atl_queue()
452 ep->nextpid = USB_PID_OUT; in postproc_atl_queue()
455 ep->nextpid = USB_PID_IN; in postproc_atl_queue()
463 ep->nextpid = 0; in postproc_atl_queue()
471 finish_request(isp116x, ep, urb, status); in postproc_atl_queue()
481 struct isp116x_ep *last_ep = NULL, *ep; in start_atl_transfers() local
515 list_for_each_entry(ep, &isp116x->async, schedule) { in start_atl_transfers()
516 urb = container_of(ep->hep->urb_list.next, in start_atl_transfers()
522 if (ep->nextpid == USB_PID_SETUP) { in start_atl_transfers()
524 } else if (ep->nextpid == USB_PID_ACK) { in start_atl_transfers()
540 len -= len % ep->maxpacket; in start_atl_transfers()
553 ep->active = NULL; in start_atl_transfers()
554 ep->length = len; in start_atl_transfers()
556 last_ep->active = ep; in start_atl_transfers()
558 isp116x->atl_active = ep; in start_atl_transfers()
559 last_ep = ep; in start_atl_transfers()
689 struct usb_host_endpoint *hep = urb->ep; in isp116x_urb_enqueue()
690 struct isp116x_ep *ep = NULL; in isp116x_urb_enqueue() local
704 ep = kzalloc(sizeof *ep, mem_flags); in isp116x_urb_enqueue()
705 if (!ep) in isp116x_urb_enqueue()
711 kfree(ep); in isp116x_urb_enqueue()
717 kfree(ep); in isp116x_urb_enqueue()
722 ep = hep->hcpriv; in isp116x_urb_enqueue()
724 INIT_LIST_HEAD(&ep->schedule); in isp116x_urb_enqueue()
725 ep->udev = udev; in isp116x_urb_enqueue()
726 ep->epnum = epnum; in isp116x_urb_enqueue()
727 ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out); in isp116x_urb_enqueue()
731 ep->nextpid = USB_PID_SETUP; in isp116x_urb_enqueue()
733 ep->nextpid = USB_PID_OUT; in isp116x_urb_enqueue()
735 ep->nextpid = USB_PID_IN; in isp116x_urb_enqueue()
753 ep->period = urb->interval >> 1; in isp116x_urb_enqueue()
754 ep->branch = PERIODIC_SIZE; in isp116x_urb_enqueue()
755 ep->load = usb_calc_bus_time(udev->speed, in isp116x_urb_enqueue()
762 hep->hcpriv = ep; in isp116x_urb_enqueue()
763 ep->hep = hep; in isp116x_urb_enqueue()
770 if (list_empty(&ep->schedule)) in isp116x_urb_enqueue()
771 list_add_tail(&ep->schedule, &isp116x->async); in isp116x_urb_enqueue()
774 urb->interval = ep->period; in isp116x_urb_enqueue()
775 ep->length = min_t(u32, ep->maxpacket, in isp116x_urb_enqueue()
779 if (ep->branch < PERIODIC_SIZE) in isp116x_urb_enqueue()
782 ep->branch = ret = balance(isp116x, ep->period, ep->load); in isp116x_urb_enqueue()
788 + ep->branch; in isp116x_urb_enqueue()
793 DBG("schedule qh%d/%p branch %d\n", ep->period, ep, ep->branch); in isp116x_urb_enqueue()
794 for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) { in isp116x_urb_enqueue()
798 while (here && ep != here) { in isp116x_urb_enqueue()
799 if (ep->period > here->period) in isp116x_urb_enqueue()
804 if (ep != here) { in isp116x_urb_enqueue()
805 ep->next = here; in isp116x_urb_enqueue()
806 *prev = ep; in isp116x_urb_enqueue()
808 isp116x->load[i] += ep->load; in isp116x_urb_enqueue()
810 hcd->self.bandwidth_allocated += ep->load / ep->period; in isp116x_urb_enqueue()
840 struct isp116x_ep *ep, *ep_act; in isp116x_urb_dequeue() local
850 ep = hep->hcpriv; in isp116x_urb_dequeue()
851 WARN_ON(hep != ep->hep); in isp116x_urb_dequeue()
854 if (ep->hep->urb_list.next == &urb->urb_list) in isp116x_urb_dequeue()
858 if (ep_act == ep) { in isp116x_urb_dequeue()
866 finish_request(isp116x, ep, urb, status); in isp116x_urb_dequeue()
876 struct isp116x_ep *ep = hep->hcpriv; in isp116x_endpoint_disable() local
878 if (!ep) in isp116x_endpoint_disable()
885 WARNING("ep %p not empty?\n", ep); in isp116x_endpoint_disable()
887 kfree(ep); in isp116x_endpoint_disable()