aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/host/uhci-debug.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pretzel.yyz.us>2005-06-27 22:05:03 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-27 22:05:03 -0400
commit1bad3f4050b2a641bbfeaddb2717b28247311e9c (patch)
treebdc2efda40f48e0fbb64e6b9aca793e95ac72fc4 /drivers/usb/host/uhci-debug.c
parent747802ab478399f13ff57751c2ebd22577be4eeb (diff)
parentc7b645f934e52a54af58142d91fb51f881f8ce26 (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r--drivers/usb/host/uhci-debug.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index 24c73c5a343..4538a98b6f9 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)
return out - buf;
}
+static int uhci_show_root_hub_state(struct uhci_hcd *uhci, char *buf, int len)
+{
+ char *out = buf;
+ char *rh_state;
+
+ /* Try to make sure there's enough memory */
+ if (len < 60)
+ return 0;
+
+ switch (uhci->rh_state) {
+ case UHCI_RH_RESET:
+ rh_state = "reset"; break;
+ case UHCI_RH_SUSPENDED:
+ rh_state = "suspended"; break;
+ case UHCI_RH_AUTO_STOPPED:
+ rh_state = "auto-stopped"; break;
+ case UHCI_RH_RESUMING:
+ rh_state = "resuming"; break;
+ case UHCI_RH_SUSPENDING:
+ rh_state = "suspending"; break;
+ case UHCI_RH_RUNNING:
+ rh_state = "running"; break;
+ case UHCI_RH_RUNNING_NODEVS:
+ rh_state = "running, no devs"; break;
+ default:
+ rh_state = "?"; break;
+ }
+ out += sprintf(out, "Root-hub state: %s\n", rh_state);
+ return out - buf;
+}
+
static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len)
{
char *out = buf;
@@ -408,6 +439,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
spin_lock_irqsave(&uhci->lock, flags);
+ out += uhci_show_root_hub_state(uhci, out, len - (out - buf));
out += sprintf(out, "HC status\n");
out += uhci_show_status(uhci, out, len - (out - buf));