diff options
-rw-r--r-- | drivers/usb/core/hcd.h | 1 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 58c7767bc904..fc71a08a1af4 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -85,6 +85,7 @@ struct usb_hcd { /* usb_bus.hcpriv points to this */ | |||
85 | unsigned uses_new_polling:1; | 85 | unsigned uses_new_polling:1; |
86 | unsigned poll_rh:1; /* poll for rh status? */ | 86 | unsigned poll_rh:1; /* poll for rh status? */ |
87 | unsigned poll_pending:1; /* status has changed? */ | 87 | unsigned poll_pending:1; /* status has changed? */ |
88 | unsigned wireless:1; /* Wireless USB HCD */ | ||
88 | 89 | ||
89 | int irq; /* irq allocated */ | 90 | int irq; /* irq allocated */ |
90 | void __iomem *regs; /* device memory/io */ | 91 | void __iomem *regs; /* device memory/io */ |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index bdf5be099650..db4a9be1cb8a 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1331,6 +1331,18 @@ static int hub_port_status(struct usb_hub *hub, int port1, | |||
1331 | return ret; | 1331 | return ret; |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | |||
1335 | /* Returns 1 if @hub is a WUSB root hub, 0 otherwise */ | ||
1336 | static unsigned hub_is_wusb(struct usb_hub *hub) | ||
1337 | { | ||
1338 | struct usb_hcd *hcd; | ||
1339 | if (hub->hdev->parent != NULL) /* not a root hub? */ | ||
1340 | return 0; | ||
1341 | hcd = container_of(hub->hdev->bus, struct usb_hcd, self); | ||
1342 | return hcd->wireless; | ||
1343 | } | ||
1344 | |||
1345 | |||
1334 | #define PORT_RESET_TRIES 5 | 1346 | #define PORT_RESET_TRIES 5 |
1335 | #define SET_ADDRESS_TRIES 2 | 1347 | #define SET_ADDRESS_TRIES 2 |
1336 | #define GET_DESCRIPTOR_TRIES 2 | 1348 | #define GET_DESCRIPTOR_TRIES 2 |
@@ -1371,7 +1383,9 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
1371 | /* if we`ve finished resetting, then break out of the loop */ | 1383 | /* if we`ve finished resetting, then break out of the loop */ |
1372 | if (!(portstatus & USB_PORT_STAT_RESET) && | 1384 | if (!(portstatus & USB_PORT_STAT_RESET) && |
1373 | (portstatus & USB_PORT_STAT_ENABLE)) { | 1385 | (portstatus & USB_PORT_STAT_ENABLE)) { |
1374 | if (portstatus & USB_PORT_STAT_HIGH_SPEED) | 1386 | if (hub_is_wusb(hub)) |
1387 | udev->speed = USB_SPEED_VARIABLE; | ||
1388 | else if (portstatus & USB_PORT_STAT_HIGH_SPEED) | ||
1375 | udev->speed = USB_SPEED_HIGH; | 1389 | udev->speed = USB_SPEED_HIGH; |
1376 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) | 1390 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) |
1377 | udev->speed = USB_SPEED_LOW; | 1391 | udev->speed = USB_SPEED_LOW; |