diff options
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index e1239319655c..6637a0e49978 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -98,6 +98,7 @@ static int uhci_show_urbp(struct urb_priv *urbp, char *buf, int len, int space) | |||
98 | char *out = buf; | 98 | char *out = buf; |
99 | struct uhci_td *td; | 99 | struct uhci_td *td; |
100 | int i, nactive, ninactive; | 100 | int i, nactive, ninactive; |
101 | char *ptype; | ||
101 | 102 | ||
102 | if (len < 200) | 103 | if (len < 200) |
103 | return 0; | 104 | return 0; |
@@ -110,13 +111,15 @@ static int uhci_show_urbp(struct urb_priv *urbp, char *buf, int len, int space) | |||
110 | (usb_pipein(urbp->urb->pipe) ? "IN" : "OUT")); | 111 | (usb_pipein(urbp->urb->pipe) ? "IN" : "OUT")); |
111 | 112 | ||
112 | switch (usb_pipetype(urbp->urb->pipe)) { | 113 | switch (usb_pipetype(urbp->urb->pipe)) { |
113 | case PIPE_ISOCHRONOUS: out += sprintf(out, "ISO"); break; | 114 | case PIPE_ISOCHRONOUS: ptype = "ISO"; break; |
114 | case PIPE_INTERRUPT: out += sprintf(out, "INT"); break; | 115 | case PIPE_INTERRUPT: ptype = "INT"; break; |
115 | case PIPE_BULK: out += sprintf(out, "BLK"); break; | 116 | case PIPE_BULK: ptype = "BLK"; break; |
116 | case PIPE_CONTROL: out += sprintf(out, "CTL"); break; | 117 | default: |
118 | case PIPE_CONTROL: ptype = "CTL"; break; | ||
117 | } | 119 | } |
118 | 120 | ||
119 | out += sprintf(out, "%s", (urbp->fsbr ? " FSBR" : "")); | 121 | out += sprintf(out, "%s%s", ptype, (urbp->fsbr ? " FSBR" : "")); |
122 | out += sprintf(out, " Actlen=%d", urbp->urb->actual_length); | ||
120 | 123 | ||
121 | if (urbp->urb->status != -EINPROGRESS) | 124 | if (urbp->urb->status != -EINPROGRESS) |
122 | out += sprintf(out, " Status=%d", urbp->urb->status); | 125 | out += sprintf(out, " Status=%d", urbp->urb->status); |
@@ -124,7 +127,8 @@ static int uhci_show_urbp(struct urb_priv *urbp, char *buf, int len, int space) | |||
124 | 127 | ||
125 | i = nactive = ninactive = 0; | 128 | i = nactive = ninactive = 0; |
126 | list_for_each_entry(td, &urbp->td_list, list) { | 129 | list_for_each_entry(td, &urbp->td_list, list) { |
127 | if (++i <= 10 || debug > 2) { | 130 | if (urbp->qh->type != USB_ENDPOINT_XFER_ISOC && |
131 | (++i <= 10 || debug > 2)) { | ||
128 | out += sprintf(out, "%*s%d: ", space + 2, "", i); | 132 | out += sprintf(out, "%*s%d: ", space + 2, "", i); |
129 | out += uhci_show_td(td, out, len - (out - buf), 0); | 133 | out += uhci_show_td(td, out, len - (out - buf), 0); |
130 | } else { | 134 | } else { |
@@ -147,13 +151,27 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) | |||
147 | char *out = buf; | 151 | char *out = buf; |
148 | int i, nurbs; | 152 | int i, nurbs; |
149 | __le32 element = qh_element(qh); | 153 | __le32 element = qh_element(qh); |
154 | char *qtype; | ||
150 | 155 | ||
151 | /* Try to make sure there's enough memory */ | 156 | /* Try to make sure there's enough memory */ |
152 | if (len < 80 * 6) | 157 | if (len < 80 * 7) |
153 | return 0; | 158 | return 0; |
154 | 159 | ||
155 | out += sprintf(out, "%*s[%p] link (%08x) element (%08x)\n", space, "", | 160 | switch (qh->type) { |
156 | qh, le32_to_cpu(qh->link), le32_to_cpu(element)); | 161 | case USB_ENDPOINT_XFER_ISOC: qtype = "ISO"; break; |
162 | case USB_ENDPOINT_XFER_INT: qtype = "INT"; break; | ||
163 | case USB_ENDPOINT_XFER_BULK: qtype = "BLK"; break; | ||
164 | case USB_ENDPOINT_XFER_CONTROL: qtype = "CTL"; break; | ||
165 | default: qtype = "Skel" ; break; | ||
166 | } | ||
167 | |||
168 | out += sprintf(out, "%*s[%p] %s QH link (%08x) element (%08x)\n", | ||
169 | space, "", qh, qtype, | ||
170 | le32_to_cpu(qh->link), le32_to_cpu(element)); | ||
171 | if (qh->type == USB_ENDPOINT_XFER_ISOC) | ||
172 | out += sprintf(out, "%*s period %d frame %x desc [%p]\n", | ||
173 | space, "", qh->period, qh->iso_frame, | ||
174 | qh->iso_packet_desc); | ||
157 | 175 | ||
158 | if (element & UHCI_PTR_QH) | 176 | if (element & UHCI_PTR_QH) |
159 | out += sprintf(out, "%*s Element points to QH (bug?)\n", space, ""); | 177 | out += sprintf(out, "%*s Element points to QH (bug?)\n", space, ""); |
@@ -261,7 +279,8 @@ static int uhci_show_root_hub_state(struct uhci_hcd *uhci, char *buf, int len) | |||
261 | default: | 279 | default: |
262 | rh_state = "?"; break; | 280 | rh_state = "?"; break; |
263 | } | 281 | } |
264 | out += sprintf(out, "Root-hub state: %s\n", rh_state); | 282 | out += sprintf(out, "Root-hub state: %s FSBR: %d\n", |
283 | rh_state, uhci->fsbr_is_on); | ||
265 | return out - buf; | 284 | return out - buf; |
266 | } | 285 | } |
267 | 286 | ||
@@ -275,7 +294,7 @@ static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) | |||
275 | unsigned short portsc1, portsc2; | 294 | unsigned short portsc1, portsc2; |
276 | 295 | ||
277 | /* Try to make sure there's enough memory */ | 296 | /* Try to make sure there's enough memory */ |
278 | if (len < 80 * 6) | 297 | if (len < 80 * 9) |
279 | return 0; | 298 | return 0; |
280 | 299 | ||
281 | usbcmd = inw(io_addr + 0); | 300 | usbcmd = inw(io_addr + 0); |
@@ -314,6 +333,10 @@ static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) | |||
314 | out += sprintf(out, " sof = %02x\n", sof); | 333 | out += sprintf(out, " sof = %02x\n", sof); |
315 | out += uhci_show_sc(1, portsc1, out, len - (out - buf)); | 334 | out += uhci_show_sc(1, portsc1, out, len - (out - buf)); |
316 | out += uhci_show_sc(2, portsc2, out, len - (out - buf)); | 335 | out += uhci_show_sc(2, portsc2, out, len - (out - buf)); |
336 | out += sprintf(out, "Most recent frame: %x (%d) " | ||
337 | "Last ISO frame: %x (%d)\n", | ||
338 | uhci->frame_number, uhci->frame_number & 1023, | ||
339 | uhci->last_iso_frame, uhci->last_iso_frame & 1023); | ||
317 | 340 | ||
318 | return out - buf; | 341 | return out - buf; |
319 | } | 342 | } |