• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/usb/host/

Lines Matching defs:ehci

20 /* this file is part of ehci-hcd.c */
62 /* caller must hold ehci->lock */
63 static void periodic_unlink (struct ehci_hcd *ehci, unsigned frame, void *ptr)
65 union ehci_shadow *prev_p = &ehci->pshadow [frame];
66 __le32 *hw_p = &ehci->periodic [frame];
88 periodic_usecs (struct ehci_hcd *ehci, unsigned frame, unsigned uframe)
90 __le32 *hw_p = &ehci->periodic [frame];
91 union ehci_shadow *q = &ehci->pshadow [frame];
112 ehci_dbg (ehci, "ignoring FSTN cost ...\n");
146 ehci_err (ehci, "uframe %d sched overrun: %d usecs\n",
176 static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __le32 mask)
180 ehci_err(ehci, "invalid empty smask!\n");
214 struct ehci_hcd *ehci,
220 __le32 *hw_p = &ehci->periodic [frame];
221 union ehci_shadow *q = &ehci->pshadow [frame];
234 uf = tt_start_uframe(ehci, q->qh->hw_info2);
242 uf = tt_start_uframe(ehci, q->sitd->hw_uframe);
250 ehci_dbg(ehci,
260 ehci_err(ehci, "frame %d tt sched overrun: %d usecs\n",
286 struct ehci_hcd *ehci,
297 for (; frame < ehci->periodic_size; frame += period) {
300 periodic_tt_usecs (ehci, dev, frame, tt_usecs);
302 ehci_vdbg(ehci, "tt frame %d check %d usecs start uframe %d in"
309 ehci_vdbg(ehci, "frame %d uframe %d fully scheduled\n",
324 ehci_vdbg(ehci,
338 ehci_vdbg(ehci,
355 struct ehci_hcd *ehci,
369 for (; frame < ehci->periodic_size; frame += period) {
373 here = ehci->pshadow [frame];
374 type = Q_NEXT_TYPE (ehci->periodic [frame]);
409 ehci_dbg (ehci,
427 static int enable_periodic (struct ehci_hcd *ehci)
435 status = handshake(ehci, &ehci->regs->status, STS_PSS, 0, 9 * 125);
437 ehci_to_hcd(ehci)->state = HC_STATE_HALT;
441 cmd = ehci_readl(ehci, &ehci->regs->command) | CMD_PSE;
442 ehci_writel(ehci, cmd, &ehci->regs->command);
444 ehci_to_hcd(ehci)->state = HC_STATE_RUNNING;
447 ehci->next_uframe = ehci_readl(ehci, &ehci->regs->frame_index)
448 % (ehci->periodic_size << 3);
452 static int disable_periodic (struct ehci_hcd *ehci)
460 status = handshake(ehci, &ehci->regs->status, STS_PSS, STS_PSS, 9 * 125);
462 ehci_to_hcd(ehci)->state = HC_STATE_HALT;
466 cmd = ehci_readl(ehci, &ehci->regs->command) & ~CMD_PSE;
467 ehci_writel(ehci, cmd, &ehci->regs->command);
470 ehci->next_uframe = -1;
480 * no FSTN support (yet; ehci 0.96+)
482 static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
496 for (i = qh->start; i < ehci->periodic_size; i += period) {
497 union ehci_shadow *prev = &ehci->pshadow [i];
498 __le32 *hw_p = &ehci->periodic [i];
536 ehci_to_hcd(ehci)->self.bandwidth_allocated += qh->period
541 if (!ehci->periodic_sched++)
542 return enable_periodic (ehci);
547 static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
562 for (i = qh->start; i < ehci->periodic_size; i += period)
563 periodic_unlink (ehci, i, qh);
566 ehci_to_hcd(ehci)->self.bandwidth_allocated -= qh->period
582 ehci->periodic_sched--;
583 if (!ehci->periodic_sched)
584 (void) disable_periodic (ehci);
587 static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
591 qh_unlink_periodic (ehci, qh);
614 struct ehci_hcd *ehci,
640 claimed = periodic_usecs (ehci, frame, uframe);
644 } while ((frame += 1) < ehci->periodic_size);
649 claimed = periodic_usecs (ehci, frame, uframe);
652 } while ((frame += period) < ehci->periodic_size);
660 struct ehci_hcd *ehci,
673 if (!check_period (ehci, frame, uframe, qh->period, qh->usecs))
682 if (tt_available (ehci, qh->period, qh->dev, frame, uframe,
688 if (!check_period (ehci, frame, i,
710 if (tt_no_collision (ehci, qh->period, qh->dev, frame, mask)) {
711 if (!check_period (ehci, frame, uframe + qh->gap_uf + 1,
714 if (!check_period (ehci, frame, uframe + qh->gap_uf,
727 static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
734 qh_refresh(ehci, qh);
741 status = check_intr_schedule (ehci, frame, --uframe,
758 status = check_intr_schedule (ehci,
769 status = check_intr_schedule (ehci, 0, 0, qh, &c_mask);
782 ehci_dbg (ehci, "reused qh %p schedule\n", qh);
785 status = qh_link_periodic (ehci, qh);
791 struct ehci_hcd *ehci,
806 spin_lock_irqsave (&ehci->lock, flags);
809 &ehci_to_hcd(ehci)->flags))) {
816 qh = qh_append_tds (ehci, urb, &empty, epnum, &ep->hcpriv);
822 if ((status = qh_schedule (ehci, qh)) != 0)
827 qh = qh_append_tds (ehci, urb, qtd_list, epnum, &ep->hcpriv);
831 ehci_to_hcd(ehci)->self.bandwidth_int_reqs++;
834 spin_unlock_irqrestore (&ehci->lock, flags);
836 qtd_list_free (ehci, urb, qtd_list);
862 struct ehci_hcd *ehci,
916 if (!ehci_is_TDI(ehci)
918 ehci_to_hcd(ehci)->self.root_hub))
956 iso_stream_put(struct ehci_hcd *ehci, struct ehci_iso_stream *stream)
980 dma_pool_free (ehci->itd_pool, itd,
987 dma_pool_free (ehci->sitd_pool, sitd,
997 ehci_info (ehci, "ep%d%s-iso rescheduled "
1018 iso_stream_find (struct ehci_hcd *ehci, struct urb *urb)
1031 spin_lock_irqsave (&ehci->lock, flags);
1040 iso_stream_init(ehci, stream, urb->dev, urb->pipe,
1046 ehci_dbg (ehci, "dev %s ep%d%s, not iso??\n",
1055 spin_unlock_irqrestore (&ehci->lock, flags);
1126 // caller must hold ehci->lock!
1134 struct ehci_hcd *ehci,
1158 spin_lock_irqsave (&ehci->lock, flags);
1175 spin_unlock_irqrestore (&ehci->lock, flags);
1176 itd = dma_pool_alloc (ehci->itd_pool, mem_flags,
1178 spin_lock_irqsave (&ehci->lock, flags);
1183 spin_unlock_irqrestore (&ehci->lock, flags);
1190 spin_unlock_irqrestore (&ehci->lock, flags);
1202 struct ehci_hcd *ehci,
1212 if (periodic_usecs (ehci, uframe >> 3, uframe & 0x7)
1224 struct ehci_hcd *ehci,
1257 if (!tt_available (ehci, period_uframes << 3,
1264 if (!tt_no_collision (ehci, period_uframes << 3,
1272 if (periodic_usecs (ehci, frame, uf) > max_used)
1285 if (periodic_usecs (ehci, frame, uf)
1304 * Also avoid queue depths of less than ehci's worst irq latency (affected
1314 struct ehci_hcd *ehci,
1321 unsigned mod = ehci->periodic_size << 3;
1325 ehci_dbg (ehci, "iso request %p too long\n", urb);
1331 ehci_dbg (ehci, "request %p would overflow (%d+%d>%d)\n",
1337 now = ehci_readl(ehci, &ehci->regs->frame_index) % mod;
1357 * this is bigger than ehci->i_thresh allows; scheduling itself
1378 enough_space = itd_slot_ok (ehci, mod, start,
1383 enough_space = sitd_slot_ok (ehci, mod, stream,
1395 ehci_dbg (ehci, "iso %ssched full %p (now %d max %d)\n",
1463 itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd)
1466 itd->itd_next = ehci->pshadow [frame];
1467 itd->hw_next = ehci->periodic [frame];
1468 ehci->pshadow [frame].itd = itd;
1471 ehci->periodic [frame] = cpu_to_le32 (itd->itd_dma) | Q_TYPE_ITD;
1477 struct ehci_hcd *ehci,
1491 ehci_to_hcd(ehci)->self.bandwidth_allocated
1493 ehci_vdbg (ehci,
1501 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
1533 itd_link (ehci, frame % ehci->periodic_size, itd);
1543 timer_action (ehci, TIMER_IO_WATCHDOG);
1544 if (unlikely (!ehci->periodic_sched++))
1545 return enable_periodic (ehci);
1553 struct ehci_hcd *ehci,
1600 iso_stream_put (ehci, stream);
1613 ehci_urb_done (ehci, urb);
1617 ehci->periodic_sched--;
1618 if (unlikely (!ehci->periodic_sched))
1619 (void) disable_periodic (ehci);
1620 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
1623 ehci_to_hcd(ehci)->self.bandwidth_allocated
1625 ehci_vdbg (ehci,
1630 iso_stream_put (ehci, stream);
1637 static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,
1645 stream = iso_stream_find (ehci, urb);
1647 ehci_dbg (ehci, "can't get iso stream\n");
1651 ehci_dbg (ehci, "can't change iso interval %d --> %d\n",
1657 ehci_dbg (ehci,
1668 status = itd_urb_transaction (stream, ehci, urb, mem_flags);
1670 ehci_dbg (ehci, "can't init itds\n");
1675 spin_lock_irqsave (&ehci->lock, flags);
1677 &ehci_to_hcd(ehci)->flags)))
1680 status = iso_stream_schedule (ehci, urb, stream);
1682 itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
1683 spin_unlock_irqrestore (&ehci->lock, flags);
1687 iso_stream_put (ehci, stream);
1751 struct ehci_hcd *ehci,
1769 spin_lock_irqsave (&ehci->lock, flags);
1791 spin_unlock_irqrestore (&ehci->lock, flags);
1792 sitd = dma_pool_alloc (ehci->sitd_pool, mem_flags,
1794 spin_lock_irqsave (&ehci->lock, flags);
1799 spin_unlock_irqrestore (&ehci->lock, flags);
1811 spin_unlock_irqrestore (&ehci->lock, flags);
1846 sitd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_sitd *sitd)
1849 sitd->sitd_next = ehci->pshadow [frame];
1850 sitd->hw_next = ehci->periodic [frame];
1851 ehci->pshadow [frame].sitd = sitd;
1854 ehci->periodic [frame] = cpu_to_le32 (sitd->sitd_dma) | Q_TYPE_SITD;
1860 struct ehci_hcd *ehci,
1875 ehci_to_hcd(ehci)->self.bandwidth_allocated
1877 ehci_vdbg (ehci,
1881 (next_uframe >> 3) % ehci->periodic_size,
1885 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
1904 sitd_link (ehci, (next_uframe >> 3) % ehci->periodic_size,
1916 timer_action (ehci, TIMER_IO_WATCHDOG);
1917 if (!ehci->periodic_sched++)
1918 return enable_periodic (ehci);
1929 struct ehci_hcd *ehci,
1964 iso_stream_put (ehci, stream);
1977 ehci_urb_done (ehci, urb);
1981 ehci->periodic_sched--;
1982 if (!ehci->periodic_sched)
1983 (void) disable_periodic (ehci);
1984 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
1987 ehci_to_hcd(ehci)->self.bandwidth_allocated
1989 ehci_vdbg (ehci,
1994 iso_stream_put (ehci, stream);
2000 static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,
2008 stream = iso_stream_find (ehci, urb);
2010 ehci_dbg (ehci, "can't get iso stream\n");
2014 ehci_dbg (ehci, "can't change iso interval %d --> %d\n",
2020 ehci_dbg (ehci,
2029 status = sitd_urb_transaction (stream, ehci, urb, mem_flags);
2031 ehci_dbg (ehci, "can't init sitds\n");
2036 spin_lock_irqsave (&ehci->lock, flags);
2038 &ehci_to_hcd(ehci)->flags)))
2041 status = iso_stream_schedule (ehci, urb, stream);
2043 sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream);
2044 spin_unlock_irqrestore (&ehci->lock, flags);
2048 iso_stream_put (ehci, stream);
2055 sitd_submit (struct ehci_hcd *ehci, struct urb *urb, gfp_t mem_flags)
2057 ehci_dbg (ehci, "split iso support is disabled\n");
2063 struct ehci_hcd *ehci,
2066 ehci_err (ehci, "sitd_complete %p?\n", sitd);
2075 scan_periodic (struct ehci_hcd *ehci)
2080 mod = ehci->periodic_size << 3;
2087 now_uframe = ehci->next_uframe;
2088 if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
2089 clock = ehci_readl(ehci, &ehci->regs->frame_index);
2111 q_p = &ehci->pshadow [frame];
2112 hw_p = &ehci->periodic [frame];
2122 live = HC_IS_RUNNING (ehci_to_hcd(ehci)->state);
2129 modified = qh_completions (ehci, temp.qh);
2131 intr_deschedule (ehci, temp.qh);
2167 modified = itd_complete (ehci, q.itd);
2183 modified = sitd_complete (ehci, q.sitd);
2209 if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
2211 ehci->next_uframe = now_uframe;
2212 now = ehci_readl(ehci, &ehci->regs->frame_index) % mod;