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
516 list_for_each_entry(ep, &isp116x->async, schedule) { in start_atl_transfers()
517 urb = container_of(ep->hep->urb_list.next, in start_atl_transfers()
523 if (ep->nextpid == USB_PID_SETUP) { in start_atl_transfers()
525 } else if (ep->nextpid == USB_PID_ACK) { in start_atl_transfers()
541 len -= len % ep->maxpacket; in start_atl_transfers()
554 ep->active = NULL; in start_atl_transfers()
555 ep->length = len; in start_atl_transfers()
557 last_ep->active = ep; in start_atl_transfers()
559 isp116x->atl_active = ep; in start_atl_transfers()
560 last_ep = ep; in start_atl_transfers()
690 struct usb_host_endpoint *hep = urb->ep; in isp116x_urb_enqueue()
691 struct isp116x_ep *ep = NULL; in isp116x_urb_enqueue() local
705 ep = kzalloc(sizeof *ep, mem_flags); in isp116x_urb_enqueue()
706 if (!ep) in isp116x_urb_enqueue()
712 kfree(ep); in isp116x_urb_enqueue()
718 kfree(ep); in isp116x_urb_enqueue()
723 ep = hep->hcpriv; in isp116x_urb_enqueue()
725 INIT_LIST_HEAD(&ep->schedule); in isp116x_urb_enqueue()
726 ep->udev = udev; in isp116x_urb_enqueue()
727 ep->epnum = epnum; in isp116x_urb_enqueue()
728 ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out); in isp116x_urb_enqueue()
732 ep->nextpid = USB_PID_SETUP; in isp116x_urb_enqueue()
734 ep->nextpid = USB_PID_OUT; in isp116x_urb_enqueue()
736 ep->nextpid = USB_PID_IN; in isp116x_urb_enqueue()
754 ep->period = urb->interval >> 1; in isp116x_urb_enqueue()
755 ep->branch = PERIODIC_SIZE; in isp116x_urb_enqueue()
756 ep->load = usb_calc_bus_time(udev->speed, in isp116x_urb_enqueue()
763 hep->hcpriv = ep; in isp116x_urb_enqueue()
764 ep->hep = hep; in isp116x_urb_enqueue()
771 if (list_empty(&ep->schedule)) in isp116x_urb_enqueue()
772 list_add_tail(&ep->schedule, &isp116x->async); in isp116x_urb_enqueue()
775 urb->interval = ep->period; in isp116x_urb_enqueue()
776 ep->length = min_t(u32, ep->maxpacket, in isp116x_urb_enqueue()
780 if (ep->branch < PERIODIC_SIZE) in isp116x_urb_enqueue()
783 ep->branch = ret = balance(isp116x, ep->period, ep->load); in isp116x_urb_enqueue()
789 + ep->branch; in isp116x_urb_enqueue()
794 DBG("schedule qh%d/%p branch %d\n", ep->period, ep, ep->branch); in isp116x_urb_enqueue()
795 for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) { in isp116x_urb_enqueue()
799 while (here && ep != here) { in isp116x_urb_enqueue()
800 if (ep->period > here->period) in isp116x_urb_enqueue()
805 if (ep != here) { in isp116x_urb_enqueue()
806 ep->next = here; in isp116x_urb_enqueue()
807 *prev = ep; in isp116x_urb_enqueue()
809 isp116x->load[i] += ep->load; in isp116x_urb_enqueue()
811 hcd->self.bandwidth_allocated += ep->load / ep->period; in isp116x_urb_enqueue()
841 struct isp116x_ep *ep, *ep_act; in isp116x_urb_dequeue() local
851 ep = hep->hcpriv; in isp116x_urb_dequeue()
852 WARN_ON(hep != ep->hep); in isp116x_urb_dequeue()
855 if (ep->hep->urb_list.next == &urb->urb_list) in isp116x_urb_dequeue()
859 if (ep_act == ep) { in isp116x_urb_dequeue()
867 finish_request(isp116x, ep, urb, status); in isp116x_urb_dequeue()
877 struct isp116x_ep *ep = hep->hcpriv; in isp116x_endpoint_disable() local
879 if (!ep) in isp116x_endpoint_disable()
886 WARNING("ep %p not empty?\n", ep); in isp116x_endpoint_disable()
888 kfree(ep); in isp116x_endpoint_disable()