From 366523c26b6320af171459b19e6e0e9e3baa83ca Mon Sep 17 00:00:00 2001 From: Michael Trimarchi Date: Thu, 18 Dec 2008 10:05:37 +0100 Subject: [PATCH] USB change speed USB changes the speed according to the port status Signed-off-by: Michael Trimarchi Signed-off-by: Remy Bohmer --- common/usb.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/usb.c b/common/usb.c index 313845234f..335012798c 100644 --- a/common/usb.c +++ b/common/usb.c @@ -1061,10 +1061,12 @@ static int hub_port_reset(struct usb_device *dev, int port, } portstatus = le16_to_cpu(portsts.wPortStatus); portchange = le16_to_cpu(portsts.wPortChange); + USB_HUB_PRINTF("portstatus %x, change %x, %s\n", portstatus, portchange, - portstatus&(1<speed = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0; + + if (portstatus & USB_PORT_STAT_HIGH_SPEED) + usb->speed = USB_SPEED_HIGH; + else if (portstatus & USB_PORT_STAT_LOW_SPEED) + usb->speed = USB_SPEED_LOW; + else + usb->speed = USB_SPEED_FULL; dev->children[port] = usb; usb->parent = dev; -- 2.30.2