diff options
author | Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | 2006-08-26 02:35:29 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 18:58:55 (GMT) |
commit | 0165de09747be76b09ef769fcfed3514fe5f6509 (patch) | |
tree | f4b3dd96715630fbaa73b7791ba08f5c170d32a1 /drivers/usb/core/hub.c | |
parent | cb4c8fe57c05dbb04128503f4a7483a1163b1b47 (diff) | |
download | linux-fsl-qoriq-0165de09747be76b09ef769fcfed3514fe5f6509.tar.xz |
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.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index bdf5be0..db4a9be 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, return ret; } + +/* Returns 1 if @hub is a WUSB root hub, 0 otherwise */ +static unsigned hub_is_wusb(struct usb_hub *hub) +{ + struct usb_hcd *hcd; + if (hub->hdev->parent != NULL) /* not a root hub? */ + return 0; + hcd = container_of(hub->hdev->bus, struct usb_hcd, self); + return hcd->wireless; +} + + #define PORT_RESET_TRIES 5 #define SET_ADDRESS_TRIES 2 #define GET_DESCRIPTOR_TRIES 2 @@ -1371,7 +1383,9 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, /* if we`ve finished resetting, then break out of the loop */ if (!(portstatus & USB_PORT_STAT_RESET) && (portstatus & USB_PORT_STAT_ENABLE)) { - if (portstatus & USB_PORT_STAT_HIGH_SPEED) + if (hub_is_wusb(hub)) + udev->speed = USB_SPEED_VARIABLE; + else if (portstatus & USB_PORT_STAT_HIGH_SPEED) udev->speed = USB_SPEED_HIGH; else if (portstatus & USB_PORT_STAT_LOW_SPEED) udev->speed = USB_SPEED_LOW; |