diff options
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 24c73c5a3435..4538a98b6f9d 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -237,6 +237,37 @@ static int uhci_show_sc(int port, unsigned short status, char *buf, int len) | |||
237 | return out - buf; | 237 | return out - buf; |
238 | } | 238 | } |
239 | 239 | ||
240 | static int uhci_show_root_hub_state(struct uhci_hcd *uhci, char *buf, int len) | ||
241 | { | ||
242 | char *out = buf; | ||
243 | char *rh_state; | ||
244 | |||
245 | /* Try to make sure there's enough memory */ | ||
246 | if (len < 60) | ||
247 | return 0; | ||
248 | |||
249 | switch (uhci->rh_state) { | ||
250 | case UHCI_RH_RESET: | ||
251 | rh_state = "reset"; break; | ||
252 | case UHCI_RH_SUSPENDED: | ||
253 | rh_state = "suspended"; break; | ||
254 | case UHCI_RH_AUTO_STOPPED: | ||
255 | rh_state = "auto-stopped"; break; | ||
256 | case UHCI_RH_RESUMING: | ||
257 | rh_state = "resuming"; break; | ||
258 | case UHCI_RH_SUSPENDING: | ||
259 | rh_state = "suspending"; break; | ||
260 | case UHCI_RH_RUNNING: | ||
261 | rh_state = "running"; break; | ||
262 | case UHCI_RH_RUNNING_NODEVS: | ||
263 | rh_state = "running, no devs"; break; | ||
264 | default: | ||
265 | rh_state = "?"; break; | ||
266 | } | ||
267 | out += sprintf(out, "Root-hub state: %s\n", rh_state); | ||
268 | return out - buf; | ||
269 | } | ||
270 | |||
240 | static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) | 271 | static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) |
241 | { | 272 | { |
242 | char *out = buf; | 273 | char *out = buf; |
@@ -408,6 +439,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) | |||
408 | 439 | ||
409 | spin_lock_irqsave(&uhci->lock, flags); | 440 | spin_lock_irqsave(&uhci->lock, flags); |
410 | 441 | ||
442 | out += uhci_show_root_hub_state(uhci, out, len - (out - buf)); | ||
411 | out += sprintf(out, "HC status\n"); | 443 | out += sprintf(out, "HC status\n"); |
412 | out += uhci_show_status(uhci, out, len - (out - buf)); | 444 | out += uhci_show_status(uhci, out, len - (out - buf)); |
413 | 445 | ||