aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2006-08-25 22:35:29 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:55 -0400
commit0165de09747be76b09ef769fcfed3514fe5f6509 (patch)
treef4b3dd96715630fbaa73b7791ba08f5c170d32a1 /drivers/usb/core/hub.c
parentcb4c8fe57c05dbb04128503f4a7483a1163b1b47 (diff)
wusb: hub code recognizes wusb ports
This patch enables the USB stack to recognize WUSB devices (from a WUSB HCD) and assigns them the proper speed setting (USB_SPEED_VARIABLE). 1. Introduce usb_hcd->wireless to mark a host controller instance as being wireless, and thus having wireless 'fake' ports. [discarded previous model of using a reserved bit in the port_stat struct to do this; thanks to Alan Stern for indicating the proper way to do it]. 2. Introduce hub.c:hub_is_wusb() that tests if a hub is a WUSB root hub (WUSB doesn't have non-root hubs). New code being pushed to linuxuwb.org requires this patch to connect WUSB devices. Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index bdf5be09965..db4a9be1cb8 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 */
1336static 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;