aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2008-04-08 16:24:46 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:58 -0400
commit6c529cdca914ba2a08a4bba54f11dedc2d3a7c17 (patch)
treeb844a19181db9f3688a3334945f2417cc2d410d3 /drivers/usb
parent8af548dc8e36f845943ffcba07fafaa56c844221 (diff)
wusb: devices dont use a set address
A WUSB device gets his address during the connection phase; later on, during the authenthication phase (driven from user space) we assign the final address. So we need to skip in hub_port_init() the actual setting of the address for WUSB devices. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hub.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index baae2aa0dbf..1815034ccb7 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2419,26 +2419,33 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
2419#undef GET_DESCRIPTOR_BUFSIZE 2419#undef GET_DESCRIPTOR_BUFSIZE
2420 } 2420 }
2421 2421
2422 for (j = 0; j < SET_ADDRESS_TRIES; ++j) { 2422 /*
2423 retval = hub_set_address(udev, devnum); 2423 * If device is WUSB, we already assigned an
2424 if (retval >= 0) 2424 * unauthorized address in the Connect Ack sequence;
2425 * authorization will assign the final address.
2426 */
2427 if (udev->wusb == 0) {
2428 for (j = 0; j < SET_ADDRESS_TRIES; ++j) {
2429 retval = hub_set_address(udev, devnum);
2430 if (retval >= 0)
2431 break;
2432 msleep(200);
2433 }
2434 if (retval < 0) {
2435 dev_err(&udev->dev,
2436 "device not accepting address %d, error %d\n",
2437 devnum, retval);
2438 goto fail;
2439 }
2440
2441 /* cope with hardware quirkiness:
2442 * - let SET_ADDRESS settle, some device hardware wants it
2443 * - read ep0 maxpacket even for high and low speed,
2444 */
2445 msleep(10);
2446 if (USE_NEW_SCHEME(retry_counter))
2425 break; 2447 break;
2426 msleep(200); 2448 }
2427 }
2428 if (retval < 0) {
2429 dev_err(&udev->dev,
2430 "device not accepting address %d, error %d\n",
2431 devnum, retval);
2432 goto fail;
2433 }
2434
2435 /* cope with hardware quirkiness:
2436 * - let SET_ADDRESS settle, some device hardware wants it
2437 * - read ep0 maxpacket even for high and low speed,
2438 */
2439 msleep(10);
2440 if (USE_NEW_SCHEME(retry_counter))
2441 break;
2442 2449
2443 retval = usb_get_device_descriptor(udev, 8); 2450 retval = usb_get_device_descriptor(udev, 8);
2444 if (retval < 8) { 2451 if (retval < 8) {
@@ -2455,7 +2462,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
2455 if (retval) 2462 if (retval)
2456 goto fail; 2463 goto fail;
2457 2464
2458 i = udev->descriptor.bMaxPacketSize0 == 0xff? 2465 i = udev->descriptor.bMaxPacketSize0 == 0xff? /* wusb device? */
2459 512 : udev->descriptor.bMaxPacketSize0; 2466 512 : udev->descriptor.bMaxPacketSize0;
2460 if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) { 2467 if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) {
2461 if (udev->speed != USB_SPEED_FULL || 2468 if (udev->speed != USB_SPEED_FULL ||