From f1c1f540243438246aefb703fdcf16957e3a72e1 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Thu, 22 Jan 2009 10:11:21 +0100 Subject: USB: Add high-speed (480Mb/s) to all USB related outputs With this patch the USB related connection speed output ("usb tree" command and debug output) is now high-speed enabled. This patch also fixes a compilation warning when debugging is enabled. Signed-off-by: Stefan Roese Signed-off-by: Remy Bohmer --- common/cmd_usb.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'common/cmd_usb.c') diff --git a/common/cmd_usb.c b/common/cmd_usb.c index c95f61b..a18e16e 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -264,6 +264,16 @@ void usb_display_config(struct usb_device *dev) printf("\n"); } +static inline char *portspeed(int speed) +{ + if (speed == USB_SPEED_HIGH) + return "480 Mb/s"; + else if (speed == USB_SPEED_LOW) + return "1.5 Mb/s"; + else + return "12 Mb/s"; +} + /* shows the device tree recursively */ void usb_show_tree_graph(struct usb_device *dev, char *pre) { @@ -310,7 +320,7 @@ void usb_show_tree_graph(struct usb_device *dev, char *pre) pre[index] = 0; printf(" %s (%s, %dmA)\n", usb_get_class_desc( dev->config.if_desc[0].bInterfaceClass), - dev->speed ? "1.5MBit/s" : "12MBit/s", + portspeed(dev->speed), dev->config.MaxPower * 2); if (strlen(dev->mf) || strlen(dev->prod) || strlen(dev->serial)) printf(" %s %s %s %s\n", pre, dev->mf, dev->prod, dev->serial); -- cgit v1.1