Lines Matching refs:ehci
27 static void dbg_hcs_params (struct ehci_hcd *ehci, char *label) in dbg_hcs_params() argument
29 u32 params = ehci_readl(ehci, &ehci->caps->hcs_params); in dbg_hcs_params()
31 ehci_dbg (ehci, in dbg_hcs_params()
50 byte = readb (&ehci->caps->portroute[(i>>1)]); in dbg_hcs_params()
55 ehci_dbg (ehci, "%s portroute %s\n", in dbg_hcs_params()
61 static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {} in dbg_hcs_params() argument
71 static void dbg_hcc_params (struct ehci_hcd *ehci, char *label) in dbg_hcc_params() argument
73 u32 params = ehci_readl(ehci, &ehci->caps->hcc_params); in dbg_hcc_params()
76 ehci_dbg (ehci, in dbg_hcc_params()
83 ehci_dbg (ehci, in dbg_hcc_params()
100 static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {} in dbg_hcc_params() argument
107 dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) in dbg_qtd() argument
109 ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, in dbg_qtd()
110 hc32_to_cpup(ehci, &qtd->hw_next), in dbg_qtd()
111 hc32_to_cpup(ehci, &qtd->hw_alt_next), in dbg_qtd()
112 hc32_to_cpup(ehci, &qtd->hw_token), in dbg_qtd()
113 hc32_to_cpup(ehci, &qtd->hw_buf [0])); in dbg_qtd()
115 ehci_dbg(ehci, " p1=%08x p2=%08x p3=%08x p4=%08x\n", in dbg_qtd()
116 hc32_to_cpup(ehci, &qtd->hw_buf[1]), in dbg_qtd()
117 hc32_to_cpup(ehci, &qtd->hw_buf[2]), in dbg_qtd()
118 hc32_to_cpup(ehci, &qtd->hw_buf[3]), in dbg_qtd()
119 hc32_to_cpup(ehci, &qtd->hw_buf[4])); in dbg_qtd()
123 dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) in dbg_qh() argument
127 ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label, in dbg_qh()
129 dbg_qtd("overlay", ehci, (struct ehci_qtd *) &hw->hw_qtd_next); in dbg_qh()
133 dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) in dbg_itd() argument
135 ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n", in dbg_itd()
136 label, itd->frame, itd, hc32_to_cpu(ehci, itd->hw_next), in dbg_itd()
138 ehci_dbg (ehci, in dbg_itd()
140 hc32_to_cpu(ehci, itd->hw_transaction[0]), in dbg_itd()
141 hc32_to_cpu(ehci, itd->hw_transaction[1]), in dbg_itd()
142 hc32_to_cpu(ehci, itd->hw_transaction[2]), in dbg_itd()
143 hc32_to_cpu(ehci, itd->hw_transaction[3]), in dbg_itd()
144 hc32_to_cpu(ehci, itd->hw_transaction[4]), in dbg_itd()
145 hc32_to_cpu(ehci, itd->hw_transaction[5]), in dbg_itd()
146 hc32_to_cpu(ehci, itd->hw_transaction[6]), in dbg_itd()
147 hc32_to_cpu(ehci, itd->hw_transaction[7])); in dbg_itd()
148 ehci_dbg (ehci, in dbg_itd()
150 hc32_to_cpu(ehci, itd->hw_bufp[0]), in dbg_itd()
151 hc32_to_cpu(ehci, itd->hw_bufp[1]), in dbg_itd()
152 hc32_to_cpu(ehci, itd->hw_bufp[2]), in dbg_itd()
153 hc32_to_cpu(ehci, itd->hw_bufp[3]), in dbg_itd()
154 hc32_to_cpu(ehci, itd->hw_bufp[4]), in dbg_itd()
155 hc32_to_cpu(ehci, itd->hw_bufp[5]), in dbg_itd()
156 hc32_to_cpu(ehci, itd->hw_bufp[6])); in dbg_itd()
157 ehci_dbg (ehci, " index: %d %d %d %d %d %d %d %d\n", in dbg_itd()
164 dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) in dbg_sitd() argument
166 ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n", in dbg_sitd()
167 label, sitd->frame, sitd, hc32_to_cpu(ehci, sitd->hw_next), in dbg_sitd()
169 ehci_dbg (ehci, in dbg_sitd()
171 hc32_to_cpu(ehci, sitd->hw_fullspeed_ep), in dbg_sitd()
172 hc32_to_cpu(ehci, sitd->hw_uframe), in dbg_sitd()
173 hc32_to_cpu(ehci, sitd->hw_results), in dbg_sitd()
174 hc32_to_cpu(ehci, sitd->hw_buf[0]), in dbg_sitd()
175 hc32_to_cpu(ehci, sitd->hw_buf[1])); in dbg_sitd()
285 dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) in dbg_qh() argument
307 #define dbg_status(ehci, label, status) { \ argument
310 ehci_dbg (ehci, "%s\n", _buf); \
313 #define dbg_cmd(ehci, label, command) { \ argument
316 ehci_dbg (ehci, "%s\n", _buf); \
319 #define dbg_port(ehci, label, port, status) { \ argument
322 ehci_dbg (ehci, "%s\n", _buf); \
392 static inline char token_mark(struct ehci_hcd *ehci, __hc32 token) in token_mark() argument
394 __u32 v = hc32_to_cpu(ehci, token); in token_mark()
407 struct ehci_hcd *ehci, in qh_lines() argument
421 __le32 list_end = EHCI_LIST_END(ehci); in qh_lines()
427 mark = token_mark(ehci, hw->hw_token); in qh_lines()
429 if ((hw->hw_alt_next & QTD_MASK(ehci)) in qh_lines()
430 == ehci->async->hw->hw_alt_next) in qh_lines()
436 scratch = hc32_to_cpup(ehci, &hw->hw_info1); in qh_lines()
437 hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &hw->hw_current) : 0; in qh_lines()
443 scratch, hc32_to_cpup(ehci, &hw->hw_info2), in qh_lines()
444 hc32_to_cpup(ehci, &hw->hw_token), mark, in qh_lines()
445 (cpu_to_hc32(ehci, QTD_TOGGLE) & hw->hw_token) in qh_lines()
447 (hc32_to_cpup(ehci, &hw->hw_alt_next) >> 1) & 0x0f); in qh_lines()
454 scratch = hc32_to_cpup(ehci, &td->hw_token); in qh_lines()
458 else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma)) in qh_lines()
461 if (td->hw_alt_next == ehci->async->hw->hw_alt_next) in qh_lines()
500 struct ehci_hcd *ehci; in fill_async_buffer() local
507 ehci = hcd_to_ehci (hcd); in fill_async_buffer()
517 spin_lock_irqsave (&ehci->lock, flags); in fill_async_buffer()
518 for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh) in fill_async_buffer()
519 qh_lines (ehci, qh, &next, &size); in fill_async_buffer()
520 if (!list_empty(&ehci->async_unlink) && size > 0) { in fill_async_buffer()
525 list_for_each_entry(qh, &ehci->async_unlink, unlink_node) { in fill_async_buffer()
528 qh_lines(ehci, qh, &next, &size); in fill_async_buffer()
531 spin_unlock_irqrestore (&ehci->lock, flags); in fill_async_buffer()
538 struct ehci_hcd *ehci; in fill_bandwidth_buffer() local
548 ehci = hcd_to_ehci(bus_to_hcd(buf->bus)); in fill_bandwidth_buffer()
554 spin_lock_irq(&ehci->lock); in fill_bandwidth_buffer()
562 bw = &ehci->bandwidth[i]; in fill_bandwidth_buffer()
572 list_for_each_entry(tt, &ehci->tt_list, tt_list) { in fill_bandwidth_buffer()
614 spin_unlock_irq(&ehci->lock); in fill_bandwidth_buffer()
623 struct ehci_hcd *ehci; in fill_periodic_buffer() local
637 ehci = hcd_to_ehci (hcd); in fill_periodic_buffer()
641 temp = scnprintf (next, size, "size = %d\n", ehci->periodic_size); in fill_periodic_buffer()
648 spin_lock_irqsave (&ehci->lock, flags); in fill_periodic_buffer()
649 for (i = 0; i < ehci->periodic_size; i++) { in fill_periodic_buffer()
650 p = ehci->pshadow [i]; in fill_periodic_buffer()
653 tag = Q_NEXT_TYPE(ehci, ehci->periodic [i]); in fill_periodic_buffer()
662 switch (hc32_to_cpu(ehci, tag)) { in fill_periodic_buffer()
667 hc32_to_cpup(ehci, in fill_periodic_buffer()
688 u32 scratch = hc32_to_cpup(ehci, in fill_periodic_buffer()
700 ehci, in fill_periodic_buffer()
722 tag = Q_NEXT_TYPE(ehci, hw->hw_next); in fill_periodic_buffer()
729 tag = Q_NEXT_TYPE(ehci, p.fstn->hw_next); in fill_periodic_buffer()
735 tag = Q_NEXT_TYPE(ehci, p.itd->hw_next); in fill_periodic_buffer()
742 hc32_to_cpup(ehci, &p.sitd->hw_uframe) in fill_periodic_buffer()
745 tag = Q_NEXT_TYPE(ehci, p.sitd->hw_next); in fill_periodic_buffer()
757 spin_unlock_irqrestore (&ehci->lock, flags); in fill_periodic_buffer()
764 static const char *rh_state_string(struct ehci_hcd *ehci) in rh_state_string() argument
766 switch (ehci->rh_state) { in rh_state_string()
782 struct ehci_hcd *ehci; in fill_registers_buffer() local
790 ehci = hcd_to_ehci (hcd); in fill_registers_buffer()
794 spin_lock_irqsave (&ehci->lock, flags); in fill_registers_buffer()
808 i = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); in fill_registers_buffer()
816 i >> 8, i & 0x0ff, rh_state_string(ehci)); in fill_registers_buffer()
827 pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller); in fill_registers_buffer()
828 offset = HCC_EXT_CAPS(ehci_readl(ehci, in fill_registers_buffer()
829 &ehci->caps->hcc_params)); in fill_registers_buffer()
860 i = ehci_readl(ehci, &ehci->caps->hcs_params); in fill_registers_buffer()
865 i = ehci_readl(ehci, &ehci->caps->hcc_params); in fill_registers_buffer()
872 ehci_readl(ehci, &ehci->regs->status)); in fill_registers_buffer()
878 ehci_readl(ehci, &ehci->regs->command)); in fill_registers_buffer()
884 ehci_readl(ehci, &ehci->regs->intr_enable)); in fill_registers_buffer()
890 ehci_read_frame_index(ehci)); in fill_registers_buffer()
894 for (i = 1; i <= HCS_N_PORTS (ehci->hcs_params); i++) { in fill_registers_buffer()
896 ehci_readl(ehci, in fill_registers_buffer()
897 &ehci->regs->port_status[i - 1])); in fill_registers_buffer()
901 if (i == HCS_DEBUG_PORT(ehci->hcs_params) && ehci->debug) { in fill_registers_buffer()
904 ehci_readl(ehci, in fill_registers_buffer()
905 &ehci->debug->control)); in fill_registers_buffer()
911 if (!list_empty(&ehci->async_unlink)) { in fill_registers_buffer()
913 list_first_entry(&ehci->async_unlink, in fill_registers_buffer()
922 ehci->stats.normal, ehci->stats.error, ehci->stats.iaa, in fill_registers_buffer()
923 ehci->stats.lost_iaa); in fill_registers_buffer()
928 ehci->stats.complete, ehci->stats.unlink); in fill_registers_buffer()
934 spin_unlock_irqrestore (&ehci->lock, flags); in fill_registers_buffer()
1050 static inline void create_debug_files (struct ehci_hcd *ehci) in create_debug_files() argument
1052 struct usb_bus *bus = &ehci_to_hcd(ehci)->self; in create_debug_files()
1054 ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root); in create_debug_files()
1055 if (!ehci->debug_dir) in create_debug_files()
1058 if (!debugfs_create_file("async", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1062 if (!debugfs_create_file("bandwidth", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1066 if (!debugfs_create_file("periodic", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1070 if (!debugfs_create_file("registers", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1077 debugfs_remove_recursive(ehci->debug_dir); in create_debug_files()
1080 static inline void remove_debug_files (struct ehci_hcd *ehci) in remove_debug_files() argument
1082 debugfs_remove_recursive(ehci->debug_dir); in remove_debug_files()