diff options
author | Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | 2006-08-25 22:35:30 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 14:58:55 -0400 |
commit | 5bb6e0ae8f9f3a215d6a7f99c8486b0301cc5db9 (patch) | |
tree | eee524e6f099445dbcacc38fd92e38fa0cf05101 /drivers/usb | |
parent | 0165de09747be76b09ef769fcfed3514fe5f6509 (diff) |
wusb: handle wusb device ep0 speed settings
This patch teaches the USB stack handling of WUSB devices (those whose
speed is USB_SPEED_VARIABLE). For these devices, we need to set ep0's
maxpacketsize to 512 (even though the device descriptor reports it as
0xff).
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')
-rw-r--r-- | drivers/usb/core/hub.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index db4a9be1cb8a..1bd5ee26f0e0 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2060,8 +2060,13 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2060 | 2060 | ||
2061 | /* USB 2.0 section 5.5.3 talks about ep0 maxpacket ... | 2061 | /* USB 2.0 section 5.5.3 talks about ep0 maxpacket ... |
2062 | * it's fixed size except for full speed devices. | 2062 | * it's fixed size except for full speed devices. |
2063 | * For Wireless USB devices, ep0 max packet is always 512 (tho | ||
2064 | * reported as 0xff in the device descriptor). WUSB1.0[4.8.1]. | ||
2063 | */ | 2065 | */ |
2064 | switch (udev->speed) { | 2066 | switch (udev->speed) { |
2067 | case USB_SPEED_VARIABLE: /* fixed at 512 */ | ||
2068 | udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(512); | ||
2069 | break; | ||
2065 | case USB_SPEED_HIGH: /* fixed at 64 */ | 2070 | case USB_SPEED_HIGH: /* fixed at 64 */ |
2066 | udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64); | 2071 | udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64); |
2067 | break; | 2072 | break; |
@@ -2131,6 +2136,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2131 | * down tremendously by NAKing the unexpectedly | 2136 | * down tremendously by NAKing the unexpectedly |
2132 | * early status stage. Also, retry on all errors; | 2137 | * early status stage. Also, retry on all errors; |
2133 | * some devices are flakey. | 2138 | * some devices are flakey. |
2139 | * 255 is for WUSB devices, we actually need to use 512. | ||
2140 | * WUSB1.0[4.8.1]. | ||
2134 | */ | 2141 | */ |
2135 | for (j = 0; j < 3; ++j) { | 2142 | for (j = 0; j < 3; ++j) { |
2136 | buf->bMaxPacketSize0 = 0; | 2143 | buf->bMaxPacketSize0 = 0; |
@@ -2140,7 +2147,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2140 | buf, GET_DESCRIPTOR_BUFSIZE, | 2147 | buf, GET_DESCRIPTOR_BUFSIZE, |
2141 | (i ? USB_CTRL_GET_TIMEOUT : 1000)); | 2148 | (i ? USB_CTRL_GET_TIMEOUT : 1000)); |
2142 | switch (buf->bMaxPacketSize0) { | 2149 | switch (buf->bMaxPacketSize0) { |
2143 | case 8: case 16: case 32: case 64: | 2150 | case 8: case 16: case 32: case 64: case 255: |
2144 | if (buf->bDescriptorType == | 2151 | if (buf->bDescriptorType == |
2145 | USB_DT_DEVICE) { | 2152 | USB_DT_DEVICE) { |
2146 | r = 0; | 2153 | r = 0; |
@@ -2214,7 +2221,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
2214 | if (retval) | 2221 | if (retval) |
2215 | goto fail; | 2222 | goto fail; |
2216 | 2223 | ||
2217 | i = udev->descriptor.bMaxPacketSize0; | 2224 | i = udev->descriptor.bMaxPacketSize0 == 0xff? |
2225 | 512 : udev->descriptor.bMaxPacketSize0; | ||
2218 | if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) { | 2226 | if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) { |
2219 | if (udev->speed != USB_SPEED_FULL || | 2227 | if (udev->speed != USB_SPEED_FULL || |
2220 | !(i == 8 || i == 16 || i == 32 || i == 64)) { | 2228 | !(i == 8 || i == 16 || i == 32 || i == 64)) { |