• 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 */
21 #define ehci_dbg(ehci, fmt, args...) \
22 dev_dbg (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
23 #define ehci_err(ehci, fmt, args...) \
24 dev_err (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
25 #define ehci_info(ehci, fmt, args...) \
26 dev_info (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
27 #define ehci_warn(ehci, fmt, args...) \
28 dev_warn (ehci_to_hcd(ehci)->self.controller , fmt , ## args )
35 # define ehci_vdbg(ehci, fmt, args...) do { } while (0)
44 static void dbg_hcs_params (struct ehci_hcd *ehci, char *label)
46 u32 params = ehci_readl(ehci, &ehci->caps->hcs_params);
48 ehci_dbg (ehci,
66 byte = readb (&ehci->caps->portroute[(i>>1)]);
71 ehci_dbg (ehci, "%s portroute %s\n",
77 static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {}
87 static void dbg_hcc_params (struct ehci_hcd *ehci, char *label)
89 u32 params = ehci_readl(ehci, &ehci->caps->hcc_params);
92 ehci_dbg (ehci,
99 ehci_dbg (ehci,
116 static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {}
123 dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
125 ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
126 hc32_to_cpup(ehci, &qtd->hw_next),
127 hc32_to_cpup(ehci, &qtd->hw_alt_next),
128 hc32_to_cpup(ehci, &qtd->hw_token),
129 hc32_to_cpup(ehci, &qtd->hw_buf [0]));
131 ehci_dbg(ehci, " p1=%08x p2=%08x p3=%08x p4=%08x\n",
132 hc32_to_cpup(ehci, &qtd->hw_buf[1]),
133 hc32_to_cpup(ehci, &qtd->hw_buf[2]),
134 hc32_to_cpup(ehci, &qtd->hw_buf[3]),
135 hc32_to_cpup(ehci, &qtd->hw_buf[4]));
139 dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
143 ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
145 dbg_qtd("overlay", ehci, (struct ehci_qtd *) &hw->hw_qtd_next);
149 dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
151 ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n",
152 label, itd->frame, itd, hc32_to_cpu(ehci, itd->hw_next),
154 ehci_dbg (ehci,
156 hc32_to_cpu(ehci, itd->hw_transaction[0]),
157 hc32_to_cpu(ehci, itd->hw_transaction[1]),
158 hc32_to_cpu(ehci, itd->hw_transaction[2]),
159 hc32_to_cpu(ehci, itd->hw_transaction[3]),
160 hc32_to_cpu(ehci, itd->hw_transaction[4]),
161 hc32_to_cpu(ehci, itd->hw_transaction[5]),
162 hc32_to_cpu(ehci, itd->hw_transaction[6]),
163 hc32_to_cpu(ehci, itd->hw_transaction[7]));
164 ehci_dbg (ehci,
166 hc32_to_cpu(ehci, itd->hw_bufp[0]),
167 hc32_to_cpu(ehci, itd->hw_bufp[1]),
168 hc32_to_cpu(ehci, itd->hw_bufp[2]),
169 hc32_to_cpu(ehci, itd->hw_bufp[3]),
170 hc32_to_cpu(ehci, itd->hw_bufp[4]),
171 hc32_to_cpu(ehci, itd->hw_bufp[5]),
172 hc32_to_cpu(ehci, itd->hw_bufp[6]));
173 ehci_dbg (ehci, " index: %d %d %d %d %d %d %d %d\n",
180 dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd)
182 ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n",
183 label, sitd->frame, sitd, hc32_to_cpu(ehci, sitd->hw_next),
185 ehci_dbg (ehci,
187 hc32_to_cpu(ehci, sitd->hw_fullspeed_ep),
188 hc32_to_cpu(ehci, sitd->hw_uframe),
189 hc32_to_cpu(ehci, sitd->hw_results),
190 hc32_to_cpu(ehci, sitd->hw_buf[0]),
191 hc32_to_cpu(ehci, sitd->hw_buf[1]));
301 dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
323 #define dbg_status(ehci, label, status) { \
326 ehci_dbg (ehci, "%s\n", _buf); \
329 #define dbg_cmd(ehci, label, command) { \
332 ehci_dbg (ehci, "%s\n", _buf); \
335 #define dbg_port(ehci, label, port, status) { \
338 ehci_dbg (ehci, "%s\n", _buf); \
411 static inline char token_mark(struct ehci_hcd *ehci, __hc32 token)
413 __u32 v = hc32_to_cpu(ehci, token);
426 struct ehci_hcd *ehci,
440 __le32 list_end = EHCI_LIST_END(ehci);
446 mark = token_mark(ehci, hw->hw_token);
448 if ((hw->hw_alt_next & QTD_MASK(ehci))
449 == ehci->async->hw->hw_alt_next)
455 scratch = hc32_to_cpup(ehci, &hw->hw_info1);
456 hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &hw->hw_current) : 0;
462 scratch, hc32_to_cpup(ehci, &hw->hw_info2),
463 hc32_to_cpup(ehci, &hw->hw_token), mark,
464 (cpu_to_hc32(ehci, QTD_TOGGLE) & hw->hw_token)
466 (hc32_to_cpup(ehci, &hw->hw_alt_next) >> 1) & 0x0f);
473 scratch = hc32_to_cpup(ehci, &td->hw_token);
477 else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma))
480 if (td->hw_alt_next == ehci->async->hw->hw_alt_next)
519 struct ehci_hcd *ehci;
526 ehci = hcd_to_ehci (hcd);
536 spin_lock_irqsave (&ehci->lock, flags);
537 for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh)
538 qh_lines (ehci, qh, &next, &size);
539 if (ehci->reclaim && size > 0) {
544 for (qh = ehci->reclaim; size > 0 && qh; qh = qh->reclaim)
545 qh_lines (ehci, qh, &next, &size);
547 spin_unlock_irqrestore (&ehci->lock, flags);
556 struct ehci_hcd *ehci;
569 ehci = hcd_to_ehci (hcd);
573 temp = scnprintf (next, size, "size = %d\n", ehci->periodic_size);
580 spin_lock_irqsave (&ehci->lock, flags);
581 for (i = 0; i < ehci->periodic_size; i++) {
582 p = ehci->pshadow [i];
585 tag = Q_NEXT_TYPE(ehci, ehci->periodic [i]);
594 switch (hc32_to_cpu(ehci, tag)) {
599 hc32_to_cpup(ehci,
620 u32 scratch = hc32_to_cpup(ehci,
632 ehci,
654 tag = Q_NEXT_TYPE(ehci, hw->hw_next);
662 tag = Q_NEXT_TYPE(ehci, p.fstn->hw_next);
668 tag = Q_NEXT_TYPE(ehci, p.itd->hw_next);
675 hc32_to_cpup(ehci, &p.sitd->hw_uframe)
678 tag = Q_NEXT_TYPE(ehci, p.sitd->hw_next);
690 spin_unlock_irqrestore (&ehci->lock, flags);
700 struct ehci_hcd *ehci;
708 ehci = hcd_to_ehci (hcd);
712 spin_lock_irqsave (&ehci->lock, flags);
726 i = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
745 pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
746 offset = HCC_EXT_CAPS(ehci_readl(ehci,
747 &ehci->caps->hcc_params));
777 i = ehci_readl(ehci, &ehci->caps->hcs_params);
782 i = ehci_readl(ehci, &ehci->caps->hcc_params);
789 ehci_readl(ehci, &ehci->regs->status));
795 ehci_readl(ehci, &ehci->regs->command));
801 ehci_readl(ehci, &ehci->regs->intr_enable));
807 ehci_readl(ehci, &ehci->regs->frame_index));
811 for (i = 1; i <= HCS_N_PORTS (ehci->hcs_params); i++) {
813 ehci_readl(ehci,
814 &ehci->regs->port_status[i - 1]));
818 if (i == HCS_DEBUG_PORT(ehci->hcs_params) && ehci->debug) {
821 ehci_readl(ehci,
822 &ehci->debug->control));
828 if (ehci->reclaim) {
829 temp = scnprintf(next, size, "reclaim qh %p\n", ehci->reclaim);
837 ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim,
838 ehci->stats.lost_iaa);
843 ehci->stats.complete, ehci->stats.unlink);
849 spin_unlock_irqrestore (&ehci->lock, flags);
978 struct ehci_hcd *ehci;
987 ehci = hcd_to_ehci(hcd);
999 params = ehci_readl(ehci, &ehci->caps->hcs_params);
1001 ehci_dbg(ehci, "ERR: LPM on bad port %lu\n", port);
1004 portsc = &ehci->regs->port_status[port-1];
1005 temp = ehci_readl(ehci, portsc);
1007 ehci_dbg(ehci, "LPM: no device attached\n");
1011 ehci_writel(ehci, temp, portsc);
1018 temp = ehci_readl(ehci, &ehci->regs->command);
1021 ehci_writel(ehci, temp, &ehci->regs->command);
1025 params = ehci_readl(ehci, &ehci->caps->hcs_params);
1027 ehci_dbg(ehci, "ERR: LPM off bad port %lu\n", port);
1030 portsc = &ehci->regs->port_status[port-1];
1031 temp = ehci_readl(ehci, portsc);
1033 ehci_dbg(ehci, "ERR: no device attached\n");
1037 ehci_writel(ehci, temp, portsc);
1044 static inline void create_debug_files (struct ehci_hcd *ehci)
1046 struct usb_bus *bus = &ehci_to_hcd(ehci)->self;
1048 ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root);
1049 if (!ehci->debug_dir)
1052 if (!debugfs_create_file("async", S_IRUGO, ehci->debug_dir, bus,
1056 if (!debugfs_create_file("periodic", S_IRUGO, ehci->debug_dir, bus,
1060 if (!debugfs_create_file("registers", S_IRUGO, ehci->debug_dir, bus,
1064 if (!debugfs_create_file("lpm", S_IRUGO|S_IWUSR, ehci->debug_dir, bus,
1071 debugfs_remove_recursive(ehci->debug_dir);
1074 static inline void remove_debug_files (struct ehci_hcd *ehci)
1076 debugfs_remove_recursive(ehci->debug_dir);