Lines Matching defs:ehci

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