• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/usb/host/

Lines Matching refs:ehci

19 /* this file is part of ehci-hcd.c */
33 * an ongoing challenge. That's in "ehci-sched.c".
46 qtd_fill(struct ehci_hcd *ehci, struct ehci_qtd *qtd, dma_addr_t buf,
53 qtd->hw_buf[0] = cpu_to_hc32(ehci, (u32)addr);
54 qtd->hw_buf_hi[0] = cpu_to_hc32(ehci, (u32)(addr >> 32));
65 qtd->hw_buf[i] = cpu_to_hc32(ehci, (u32)addr);
66 qtd->hw_buf_hi[i] = cpu_to_hc32(ehci,
79 qtd->hw_token = cpu_to_hc32(ehci, (count << 16) | token);
88 qh_update (struct ehci_hcd *ehci, struct ehci_qh *qh, struct ehci_qtd *qtd)
95 hw->hw_qtd_next = QTD_NEXT(ehci, qtd->qtd_dma);
96 hw->hw_alt_next = EHCI_LIST_END(ehci);
103 if (!(hw->hw_info1 & cpu_to_hc32(ehci, 1 << 14))) {
106 is_out = !(qtd->hw_token & cpu_to_hc32(ehci, 1 << 8));
107 epnum = (hc32_to_cpup(ehci, &hw->hw_info1) >> 8) & 0x0f;
109 hw->hw_token &= ~cpu_to_hc32(ehci, QTD_TOGGLE);
116 hw->hw_token &= cpu_to_hc32(ehci, QTD_TOGGLE | QTD_STS_PING);
124 qh_refresh (struct ehci_hcd *ehci, struct ehci_qh *qh)
134 if (cpu_to_hc32(ehci, qtd->qtd_dma) == qh->hw->hw_current)
139 qh_update (ehci, qh, qtd);
144 static void qh_link_async(struct ehci_hcd *ehci, struct ehci_qh *qh);
149 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
153 spin_lock_irqsave(&ehci->lock, flags);
157 qh_link_async(ehci, qh);
158 spin_unlock_irqrestore(&ehci->lock, flags);
161 static void ehci_clear_tt_buffer(struct ehci_hcd *ehci, struct ehci_qh *qh,
179 if (!ehci_is_TDI(ehci)
181 ehci_to_hcd(ehci)->self.root_hub) {
194 struct ehci_hcd *ehci,
235 ehci_dbg(ehci, "devpath %s ep%d%s 3strikes\n",
244 ehci_vdbg (ehci,
256 ehci_urb_done(struct ehci_hcd *ehci, struct urb *urb, int status)
257 __releases(ehci->lock)
258 __acquires(ehci->lock)
264 if ((qh->hw->hw_info2 & cpu_to_hc32(ehci, QH_SMASK)) != 0) {
267 ehci_to_hcd(ehci)->self.bandwidth_int_reqs--;
273 COUNT(ehci->stats.unlink);
278 COUNT(ehci->stats.complete);
282 ehci_dbg (ehci,
292 usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
293 spin_unlock (&ehci->lock);
294 usb_hcd_giveback_urb(ehci_to_hcd(ehci), urb, status);
295 spin_lock (&ehci->lock);
298 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh);
299 static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh);
301 static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh);
309 qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
317 const __le32 halt = HALT_BIT(ehci);
358 ehci_urb_done(ehci, last->urb, last_status);
362 ehci_qtd_free (ehci, last);
372 token = hc32_to_cpu(ehci, qtd->hw_token);
390 ehci_dbg(ehci,
402 qtd->hw_token = cpu_to_hc32(ehci,
405 hw->hw_token = cpu_to_hc32(ehci,
422 & EHCI_LIST_END(ehci))) {
429 && HC_IS_RUNNING (ehci_to_hcd(ehci)->state))) {
437 if (!HC_IS_RUNNING(ehci_to_hcd(ehci)->state))
448 && cpu_to_hc32(ehci, qtd->qtd_dma)
450 token = hc32_to_cpu(ehci, hw->hw_token);
456 ehci_clear_tt_buffer(ehci, qh, urb, token);
478 last_status = qtd_copy_status(ehci, urb,
482 & EHCI_LIST_END(ehci)))
500 ehci_clear_tt_buffer(ehci, qh, urb,
524 ehci_urb_done(ehci, last->urb, last_status);
526 ehci_qtd_free (ehci, last);
551 if (stopped != 0 || hw->hw_qtd_next == EHCI_LIST_END(ehci)) {
554 qh_refresh(ehci, qh);
591 struct ehci_hcd *ehci,
602 ehci_qtd_free (ehci, qtd);
611 struct ehci_hcd *ehci,
627 qtd = ehci_qtd_alloc (ehci, flags);
641 qtd_fill(ehci, qtd, urb->setup_dma,
648 qtd = ehci_qtd_alloc (ehci, flags);
652 qtd_prev->hw_next = QTD_NEXT(ehci, qtd->qtd_dma);
692 this_qtd_len = qtd_fill(ehci, qtd, buf, this_sg_len, token,
704 qtd->hw_alt_next = ehci->async->hw->hw_alt_next;
719 qtd = ehci_qtd_alloc (ehci, flags);
723 qtd_prev->hw_next = QTD_NEXT(ehci, qtd->qtd_dma);
734 qtd->hw_alt_next = EHCI_LIST_END(ehci);
754 qtd = ehci_qtd_alloc (ehci, flags);
758 qtd_prev->hw_next = QTD_NEXT(ehci, qtd->qtd_dma);
762 qtd_fill(ehci, qtd, 0, 0, token, 0);
768 qtd->hw_token |= cpu_to_hc32(ehci, QTD_IOC);
772 qtd_list_free (ehci, urb, head);
795 struct ehci_hcd *ehci,
799 struct ehci_qh *qh = ehci_qh_alloc (ehci, flags);
823 ehci_dbg(ehci, "bogus qh maxpacket %d\n", max_packet(maxp));
852 } else if (qh->period > ehci->periodic_size) {
853 qh->period = ehci->periodic_size;
876 if (qh->period > ehci->periodic_size) {
877 qh->period = ehci->periodic_size;
907 if (ehci_has_fsl_portno_bug(ehci))
915 if (tt && tt->hub != ehci_to_hcd(ehci)->self.root_hub)
956 hw->hw_info1 = cpu_to_hc32(ehci, info1);
957 hw->hw_info2 = cpu_to_hc32(ehci, info2);
959 qh_refresh (ehci, qh);
967 static void qh_link_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
969 __hc32 dma = QH_NEXT(ehci, qh->qh_dma);
979 head = ehci->async;
980 timer_action_done (ehci, TIMER_ASYNC_OFF);
982 u32 cmd = ehci_readl(ehci, &ehci->regs->command);
986 (void)handshake(ehci, &ehci->regs->status,
989 ehci_writel(ehci, cmd, &ehci->regs->command);
990 ehci_to_hcd(ehci)->state = HC_STATE_RUNNING;
996 qh_refresh(ehci, qh);
1021 struct ehci_hcd *ehci,
1029 __hc32 qh_addr_mask = cpu_to_hc32(ehci, 0x7f);
1033 /* can't sleep here, we have ehci->lock... */
1034 qh = qh_make (ehci, urb, GFP_ATOMIC);
1068 qtd->hw_token = HALT_BIT(ehci);
1080 ehci_qtd_init(ehci, qtd, qtd->qtd_dma);
1087 qtd->hw_next = QTD_NEXT(ehci, dma);
1103 struct ehci_hcd *ehci,
1118 ehci_dbg (ehci,
1126 spin_lock_irqsave (&ehci->lock, flags);
1127 if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
1131 rc = usb_hcd_link_urb_to_ep(ehci_to_hcd(ehci), urb);
1135 qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv);
1137 usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
1146 qh_link_async(ehci, qh);
1148 spin_unlock_irqrestore (&ehci->lock, flags);
1150 qtd_list_free (ehci, urb, qtd_list);
1158 static void end_unlink_async (struct ehci_hcd *ehci)
1160 struct ehci_qh *qh = ehci->reclaim;
1163 iaa_watchdog_done(ehci);
1172 ehci->reclaim = next;
1175 qh_completions (ehci, qh);
1178 && HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
1179 qh_link_async (ehci, qh);
1184 if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state)
1185 && ehci->async->qh_next.qh == NULL)
1186 timer_action (ehci, TIMER_ASYNC_OFF);
1191 ehci->reclaim = NULL;
1192 start_unlink_async (ehci, next);
1197 /* caller must own ehci->lock */
1199 static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1201 int cmd = ehci_readl(ehci, &ehci->regs->command);
1205 assert_spin_locked(&ehci->lock);
1206 if (ehci->reclaim
1214 if (unlikely (qh == ehci->async)) {
1216 if (ehci_to_hcd(ehci)->state != HC_STATE_HALT
1217 && !ehci->reclaim) {
1219 ehci_writel(ehci, cmd & ~CMD_ASE,
1220 &ehci->regs->command);
1223 timer_action_done (ehci, TIMER_ASYNC_OFF);
1229 ehci->reclaim = qh = qh_get (qh);
1231 prev = ehci->async;
1240 if (unlikely(!HC_IS_RUNNING(ehci_to_hcd(ehci)->state))) {
1244 end_unlink_async (ehci);
1249 ehci_writel(ehci, cmd, &ehci->regs->command);
1250 (void)ehci_readl(ehci, &ehci->regs->command);
1251 iaa_watchdog_start(ehci);
1256 static void scan_async (struct ehci_hcd *ehci)
1261 ehci->stamp = ehci_readl(ehci, &ehci->regs->frame_index);
1262 timer_action_done (ehci, TIMER_ASYNC_SHRINK);
1264 qh = ehci->async->qh_next.qh;
1269 && qh->stamp != ehci->stamp) {
1278 qh->stamp = ehci->stamp;
1279 temp = qh_completions (ehci, qh);
1281 unlink_async(ehci, qh);
1296 if (!ehci->reclaim
1297 && ((ehci->stamp - qh->stamp) & 0x1fff)
1299 start_unlink_async(ehci, qh);
1308 timer_action (ehci, TIMER_ASYNC_SHRINK);