Lines Matching defs:ep

168 	struct isp116x_ep *ep;
176 for (ep = isp116x->atl_active; ep; ep = ep->active) {
177 ptd = &ep->ptd;
179 dump_ptd_out_data(ptd, ep->data);
186 if (ep->active || (isp116x->atl_last_dir != PTD_DIR_IN)) {
187 write_ptddata_to_fifo(isp116x, ep->data, ep->length);
188 buflen -= ALIGN(ep->length, 4);
200 struct isp116x_ep *ep;
208 for (ep = isp116x->atl_active; ep; ep = ep->active) {
209 ptd = &ep->ptd;
216 if (ep->active || (isp116x->atl_last_dir == PTD_DIR_IN)) {
217 read_ptddata_from_fifo(isp116x, ep->data, ep->length);
218 buflen -= ALIGN(ep->length, 4);
221 dump_ptd_in_data(ptd, ep->data);
233 struct isp116x_ep *ep;
238 for (ep = isp116x->atl_active; ep; ep = ep->active) {
241 BUG_ON(list_empty(&ep->hep->urb_list));
242 urb = container_of(ep->hep->urb_list.next,
244 ptd = &ep->ptd;
245 len = ep->length;
246 ep->data = (unsigned char *)urb->transfer_buffer
249 switch (ep->nextpid) {
251 toggle = usb_gettoggle(urb->dev, ep->epnum, 0);
255 toggle = usb_gettoggle(urb->dev, ep->epnum, 1);
260 ep->data = urb->setup_packet;
270 ERR("%s %d: ep->nextpid %d\n", __func__, __LINE__,
271 ep->nextpid);
276 ptd->mps = PTD_MPS(ep->maxpacket)
278 | PTD_EP(ep->epnum);
281 if (!ep->active) {
294 static void finish_request(struct isp116x *isp116x, struct isp116x_ep *ep,
300 ep->error_count = 0;
303 ep->nextpid = USB_PID_SETUP;
313 if (!list_empty(&ep->hep->urb_list))
317 if (!list_empty(&ep->schedule)) {
318 list_del_init(&ep->schedule);
323 DBG("deschedule qh%d/%p branch %d\n", ep->period, ep, ep->branch);
324 for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) {
328 while (*prev && ((temp = *prev) != ep))
331 *prev = ep->next;
332 isp116x->load[i] -= ep->load;
334 ep->branch = PERIODIC_SIZE;
336 ep->load / ep->period;
350 struct isp116x_ep *ep;
358 for (ep = isp116x->atl_active; ep; ep = ep->active) {
359 BUG_ON(list_empty(&ep->hep->urb_list));
361 container_of(ep->hep->urb_list.next, struct urb, urb_list);
363 ptd = &ep->ptd;
380 ep->error_count = 1;
381 usb_settoggle(udev, ep->epnum,
382 ep->nextpid == USB_PID_OUT,
391 && (++ep->error_count >= 3 || cc == TD_CC_STALL
394 if (ep->nextpid == USB_PID_ACK)
395 ep->nextpid = 0;
408 if (ep->error_count
410 ep->error_count = 0;
414 if (ep->nextpid == USB_PID_OUT)
415 usb_settoggle(udev, ep->epnum, 1, PTD_GET_TOGGLE(ptd)
416 ^ (ep->error_count > 0));
417 else if (ep->nextpid == USB_PID_IN)
418 usb_settoggle(udev, ep->epnum, 0, PTD_GET_TOGGLE(ptd)
419 ^ (ep->error_count > 0));
421 switch (ep->nextpid) {
433 && ep->nextpid == USB_PID_OUT
434 && !(PTD_GET_COUNT(ptd) % ep->maxpacket)) {
441 ep->nextpid = USB_PID_ACK;
450 ep->nextpid = USB_PID_ACK;
453 ep->nextpid = USB_PID_OUT;
456 ep->nextpid = USB_PID_IN;
464 ep->nextpid = 0;
472 finish_request(isp116x, ep, urb, status);
482 struct isp116x_ep *last_ep = NULL, *ep;
517 list_for_each_entry(ep, &isp116x->async, schedule) {
518 urb = container_of(ep->hep->urb_list.next,
524 if (ep->nextpid == USB_PID_SETUP) {
526 } else if (ep->nextpid == USB_PID_ACK) {
542 len -= len % ep->maxpacket;
555 ep->active = NULL;
556 ep->length = len;
558 last_ep->active = ep;
560 isp116x->atl_active = ep;
561 last_ep = ep;
691 struct usb_host_endpoint *hep = urb->ep;
692 struct isp116x_ep *ep = NULL;
706 ep = kzalloc(sizeof *ep, mem_flags);
707 if (!ep)
713 kfree(ep);
719 kfree(ep);
724 ep = hep->hcpriv;
726 INIT_LIST_HEAD(&ep->schedule);
727 ep->udev = udev;
728 ep->epnum = epnum;
729 ep->maxpacket = usb_maxpacket(udev, urb->pipe);
733 ep->nextpid = USB_PID_SETUP;
735 ep->nextpid = USB_PID_OUT;
737 ep->nextpid = USB_PID_IN;
755 ep->period = urb->interval >> 1;
756 ep->branch = PERIODIC_SIZE;
757 ep->load = usb_calc_bus_time(udev->speed,
763 hep->hcpriv = ep;
764 ep->hep = hep;
771 if (list_empty(&ep->schedule))
772 list_add_tail(&ep->schedule, &isp116x->async);
775 urb->interval = ep->period;
776 ep->length = min_t(u32, ep->maxpacket,
780 if (ep->branch < PERIODIC_SIZE)
783 ep->branch = ret = balance(isp116x, ep->period, ep->load);
789 + ep->branch;
794 DBG("schedule qh%d/%p branch %d\n", ep->period, ep, ep->branch);
795 for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) {
799 while (here && ep != here) {
800 if (ep->period > here->period)
805 if (ep != here) {
806 ep->next = here;
807 *prev = ep;
809 isp116x->load[i] += ep->load;
811 hcd->self.bandwidth_allocated += ep->load / ep->period;
841 struct isp116x_ep *ep, *ep_act;
851 ep = hep->hcpriv;
852 WARN_ON(hep != ep->hep);
855 if (ep->hep->urb_list.next == &urb->urb_list)
859 if (ep_act == ep) {
867 finish_request(isp116x, ep, urb, status);
877 struct isp116x_ep *ep = hep->hcpriv;
879 if (!ep)
886 WARNING("ep %p not empty?\n", ep);
888 kfree(ep);