Lines Matching refs:ehci
15 static void dbg_hcs_params(struct ehci_hcd *ehci, char *label) in dbg_hcs_params() argument
17 u32 params = ehci_readl(ehci, &ehci->caps->hcs_params); in dbg_hcs_params()
19 ehci_dbg(ehci, in dbg_hcs_params()
37 byte = readb(&ehci->caps->portroute[(i >> 1)]); in dbg_hcs_params()
42 ehci_dbg(ehci, "%s portroute %s\n", label, buf); in dbg_hcs_params()
51 static void dbg_hcc_params(struct ehci_hcd *ehci, char *label) in dbg_hcc_params() argument
53 u32 params = ehci_readl(ehci, &ehci->caps->hcc_params); in dbg_hcc_params()
56 ehci_dbg(ehci, in dbg_hcc_params()
63 ehci_dbg(ehci, in dbg_hcc_params()
80 dbg_qtd(const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) in dbg_qtd() argument
82 ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, in dbg_qtd()
83 hc32_to_cpup(ehci, &qtd->hw_next), in dbg_qtd()
84 hc32_to_cpup(ehci, &qtd->hw_alt_next), in dbg_qtd()
85 hc32_to_cpup(ehci, &qtd->hw_token), in dbg_qtd()
86 hc32_to_cpup(ehci, &qtd->hw_buf[0])); in dbg_qtd()
88 ehci_dbg(ehci, " p1=%08x p2=%08x p3=%08x p4=%08x\n", in dbg_qtd()
89 hc32_to_cpup(ehci, &qtd->hw_buf[1]), in dbg_qtd()
90 hc32_to_cpup(ehci, &qtd->hw_buf[2]), in dbg_qtd()
91 hc32_to_cpup(ehci, &qtd->hw_buf[3]), in dbg_qtd()
92 hc32_to_cpup(ehci, &qtd->hw_buf[4])); in dbg_qtd()
96 dbg_qh(const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) in dbg_qh() argument
100 ehci_dbg(ehci, "%s qh %p n%08x info %x %x qtd %x\n", label, in dbg_qh()
102 dbg_qtd("overlay", ehci, (struct ehci_qtd *) &hw->hw_qtd_next); in dbg_qh()
106 dbg_itd(const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) in dbg_itd() argument
108 ehci_dbg(ehci, "%s [%d] itd %p, next %08x, urb %p\n", in dbg_itd()
109 label, itd->frame, itd, hc32_to_cpu(ehci, itd->hw_next), in dbg_itd()
111 ehci_dbg(ehci, in dbg_itd()
113 hc32_to_cpu(ehci, itd->hw_transaction[0]), in dbg_itd()
114 hc32_to_cpu(ehci, itd->hw_transaction[1]), in dbg_itd()
115 hc32_to_cpu(ehci, itd->hw_transaction[2]), in dbg_itd()
116 hc32_to_cpu(ehci, itd->hw_transaction[3]), in dbg_itd()
117 hc32_to_cpu(ehci, itd->hw_transaction[4]), in dbg_itd()
118 hc32_to_cpu(ehci, itd->hw_transaction[5]), in dbg_itd()
119 hc32_to_cpu(ehci, itd->hw_transaction[6]), in dbg_itd()
120 hc32_to_cpu(ehci, itd->hw_transaction[7])); in dbg_itd()
121 ehci_dbg(ehci, in dbg_itd()
123 hc32_to_cpu(ehci, itd->hw_bufp[0]), in dbg_itd()
124 hc32_to_cpu(ehci, itd->hw_bufp[1]), in dbg_itd()
125 hc32_to_cpu(ehci, itd->hw_bufp[2]), in dbg_itd()
126 hc32_to_cpu(ehci, itd->hw_bufp[3]), in dbg_itd()
127 hc32_to_cpu(ehci, itd->hw_bufp[4]), in dbg_itd()
128 hc32_to_cpu(ehci, itd->hw_bufp[5]), in dbg_itd()
129 hc32_to_cpu(ehci, itd->hw_bufp[6])); in dbg_itd()
130 ehci_dbg(ehci, " index: %d %d %d %d %d %d %d %d\n", in dbg_itd()
137 dbg_sitd(const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) in dbg_sitd() argument
139 ehci_dbg(ehci, "%s [%d] sitd %p, next %08x, urb %p\n", in dbg_sitd()
140 label, sitd->frame, sitd, hc32_to_cpu(ehci, sitd->hw_next), in dbg_sitd()
142 ehci_dbg(ehci, in dbg_sitd()
144 hc32_to_cpu(ehci, sitd->hw_fullspeed_ep), in dbg_sitd()
145 hc32_to_cpu(ehci, sitd->hw_uframe), in dbg_sitd()
146 hc32_to_cpu(ehci, sitd->hw_results), in dbg_sitd()
147 hc32_to_cpu(ehci, sitd->hw_buf[0]), in dbg_sitd()
148 hc32_to_cpu(ehci, sitd->hw_buf[1])); in dbg_sitd()
261 dbg_status(struct ehci_hcd *ehci, const char *label, u32 status) in dbg_status() argument
266 ehci_dbg(ehci, "%s\n", buf); in dbg_status()
270 dbg_cmd(struct ehci_hcd *ehci, const char *label, u32 command) in dbg_cmd() argument
275 ehci_dbg(ehci, "%s\n", buf); in dbg_cmd()
279 dbg_port(struct ehci_hcd *ehci, const char *label, int port, u32 status) in dbg_port() argument
284 ehci_dbg(ehci, "%s\n", buf); in dbg_port()
356 static inline char token_mark(struct ehci_hcd *ehci, __hc32 token) in token_mark() argument
358 __u32 v = hc32_to_cpu(ehci, token); in token_mark()
370 static void qh_lines(struct ehci_hcd *ehci, struct ehci_qh *qh, in qh_lines() argument
381 __le32 list_end = EHCI_LIST_END(ehci); in qh_lines()
387 mark = token_mark(ehci, hw->hw_token); in qh_lines()
389 if ((hw->hw_alt_next & QTD_MASK(ehci)) in qh_lines()
390 == ehci->async->hw->hw_alt_next) in qh_lines()
396 scratch = hc32_to_cpup(ehci, &hw->hw_info1); in qh_lines()
397 hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &hw->hw_current) : 0; in qh_lines()
404 scratch, hc32_to_cpup(ehci, &hw->hw_info2), in qh_lines()
405 hc32_to_cpup(ehci, &hw->hw_token), mark, in qh_lines()
406 (cpu_to_hc32(ehci, QTD_TOGGLE) & hw->hw_token) in qh_lines()
408 (hc32_to_cpup(ehci, &hw->hw_alt_next) >> 1) & 0x0f, in qh_lines()
409 hc32_to_cpup(ehci, &hw->hw_current), in qh_lines()
410 hc32_to_cpup(ehci, &hw->hw_qtd_next), in qh_lines()
411 hc32_to_cpup(ehci, &hw->hw_buf[0])); in qh_lines()
420 scratch = hc32_to_cpup(ehci, &td->hw_token); in qh_lines()
424 } else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma)) { in qh_lines()
427 if (td->hw_alt_next == ehci->async->hw->hw_alt_next) in qh_lines()
454 hc32_to_cpup(ehci, &td->hw_buf[0])); in qh_lines()
473 struct ehci_hcd *ehci; in fill_async_buffer() local
480 ehci = hcd_to_ehci(hcd); in fill_async_buffer()
491 spin_lock_irqsave(&ehci->lock, flags); in fill_async_buffer()
492 for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh) in fill_async_buffer()
493 qh_lines(ehci, qh, &next, &size); in fill_async_buffer()
494 if (!list_empty(&ehci->async_unlink) && size > 0) { in fill_async_buffer()
499 list_for_each_entry(qh, &ehci->async_unlink, unlink_node) { in fill_async_buffer()
502 qh_lines(ehci, qh, &next, &size); in fill_async_buffer()
505 spin_unlock_irqrestore(&ehci->lock, flags); in fill_async_buffer()
512 struct ehci_hcd *ehci; in fill_bandwidth_buffer() local
522 ehci = hcd_to_ehci(bus_to_hcd(buf->bus)); in fill_bandwidth_buffer()
528 spin_lock_irq(&ehci->lock); in fill_bandwidth_buffer()
536 bw = &ehci->bandwidth[i]; in fill_bandwidth_buffer()
546 list_for_each_entry(tt, &ehci->tt_list, tt_list) { in fill_bandwidth_buffer()
588 spin_unlock_irq(&ehci->lock); in fill_bandwidth_buffer()
593 static unsigned output_buf_tds_dir(char *buf, struct ehci_hcd *ehci, in output_buf_tds_dir() argument
596 u32 scratch = hc32_to_cpup(ehci, &hw->hw_info1); in output_buf_tds_dir()
604 switch ((hc32_to_cpu(ehci, qtd->hw_token) >> 8) & 0x03) { in output_buf_tds_dir()
624 struct ehci_hcd *ehci; in fill_periodic_buffer() local
638 ehci = hcd_to_ehci(hcd); in fill_periodic_buffer()
642 temp = scnprintf(next, size, "size = %d\n", ehci->periodic_size); in fill_periodic_buffer()
650 spin_lock_irqsave(&ehci->lock, flags); in fill_periodic_buffer()
651 for (i = 0; i < ehci->periodic_size; i++) { in fill_periodic_buffer()
652 p = ehci->pshadow[i]; in fill_periodic_buffer()
655 tag = Q_NEXT_TYPE(ehci, ehci->periodic[i]); in fill_periodic_buffer()
664 switch (hc32_to_cpu(ehci, tag)) { in fill_periodic_buffer()
669 hc32_to_cpup(ehci, in fill_periodic_buffer()
690 temp = output_buf_tds_dir(next, ehci, in fill_periodic_buffer()
698 tag = Q_NEXT_TYPE(ehci, hw->hw_next); in fill_periodic_buffer()
705 tag = Q_NEXT_TYPE(ehci, p.fstn->hw_next); in fill_periodic_buffer()
711 tag = Q_NEXT_TYPE(ehci, p.itd->hw_next); in fill_periodic_buffer()
718 hc32_to_cpup(ehci, &p.sitd->hw_uframe) in fill_periodic_buffer()
721 tag = Q_NEXT_TYPE(ehci, p.sitd->hw_next); in fill_periodic_buffer()
733 spin_unlock_irqrestore(&ehci->lock, flags); in fill_periodic_buffer()
740 static const char *rh_state_string(struct ehci_hcd *ehci) in rh_state_string() argument
742 switch (ehci->rh_state) { in rh_state_string()
758 struct ehci_hcd *ehci; in fill_registers_buffer() local
766 ehci = hcd_to_ehci(hcd); in fill_registers_buffer()
770 spin_lock_irqsave(&ehci->lock, flags); in fill_registers_buffer()
784 i = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); in fill_registers_buffer()
792 i >> 8, i & 0x0ff, rh_state_string(ehci)); in fill_registers_buffer()
803 pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller); in fill_registers_buffer()
804 offset = HCC_EXT_CAPS(ehci_readl(ehci, in fill_registers_buffer()
805 &ehci->caps->hcc_params)); in fill_registers_buffer()
836 i = ehci_readl(ehci, &ehci->caps->hcs_params); in fill_registers_buffer()
841 i = ehci_readl(ehci, &ehci->caps->hcc_params); in fill_registers_buffer()
848 ehci_readl(ehci, &ehci->regs->status)); in fill_registers_buffer()
854 ehci_readl(ehci, &ehci->regs->command)); in fill_registers_buffer()
860 ehci_readl(ehci, &ehci->regs->intr_enable)); in fill_registers_buffer()
866 ehci_read_frame_index(ehci)); in fill_registers_buffer()
870 for (i = 1; i <= HCS_N_PORTS(ehci->hcs_params); i++) { in fill_registers_buffer()
872 ehci_readl(ehci, in fill_registers_buffer()
873 &ehci->regs->port_status[i - 1])); in fill_registers_buffer()
877 if (i == HCS_DEBUG_PORT(ehci->hcs_params) && ehci->debug) { in fill_registers_buffer()
880 ehci_readl(ehci, in fill_registers_buffer()
881 &ehci->debug->control)); in fill_registers_buffer()
887 if (!list_empty(&ehci->async_unlink)) { in fill_registers_buffer()
889 list_first_entry(&ehci->async_unlink, in fill_registers_buffer()
898 ehci->stats.normal, ehci->stats.error, ehci->stats.iaa, in fill_registers_buffer()
899 ehci->stats.lost_iaa); in fill_registers_buffer()
904 ehci->stats.complete, ehci->stats.unlink); in fill_registers_buffer()
910 spin_unlock_irqrestore(&ehci->lock, flags); in fill_registers_buffer()
1026 static inline void create_debug_files(struct ehci_hcd *ehci) in create_debug_files() argument
1028 struct usb_bus *bus = &ehci_to_hcd(ehci)->self; in create_debug_files()
1030 ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root); in create_debug_files()
1032 debugfs_create_file("async", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1034 debugfs_create_file("bandwidth", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1036 debugfs_create_file("periodic", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1038 debugfs_create_file("registers", S_IRUGO, ehci->debug_dir, bus, in create_debug_files()
1042 static inline void remove_debug_files(struct ehci_hcd *ehci) in remove_debug_files() argument
1044 debugfs_remove_recursive(ehci->debug_dir); in remove_debug_files()
1049 static inline void dbg_hcs_params(struct ehci_hcd *ehci, char *label) { } in dbg_hcs_params() argument
1050 static inline void dbg_hcc_params(struct ehci_hcd *ehci, char *label) { } in dbg_hcc_params() argument
1053 struct ehci_hcd *ehci, struct ehci_qh *qh) { } in dbg_qh() argument
1071 static inline void dbg_status(struct ehci_hcd *ehci, const char *label, in dbg_status() argument
1073 static inline void dbg_cmd(struct ehci_hcd *ehci, const char *label, in dbg_cmd() argument
1075 static inline void dbg_port(struct ehci_hcd *ehci, const char *label, in dbg_port() argument