Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>


authored by

Inaky Perez-Gonzalez and committed by
Greg Kroah-Hartman
6c529cdc 8af548dc

+27 -20
+27 -20
drivers/usb/core/hub.c
··· 2419 2419 #undef GET_DESCRIPTOR_BUFSIZE 2420 2420 } 2421 2421 2422 - for (j = 0; j < SET_ADDRESS_TRIES; ++j) { 2423 - retval = hub_set_address(udev, devnum); 2424 - if (retval >= 0) 2422 + /* 2423 + * If device is WUSB, we already assigned an 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 2447 break; 2426 - msleep(200); 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; 2448 + } 2442 2449 2443 2450 retval = usb_get_device_descriptor(udev, 8); 2444 2451 if (retval < 8) { ··· 2462 2455 if (retval) 2463 2456 goto fail; 2464 2457 2465 - i = udev->descriptor.bMaxPacketSize0 == 0xff? 2458 + i = udev->descriptor.bMaxPacketSize0 == 0xff? /* wusb device? */ 2466 2459 512 : udev->descriptor.bMaxPacketSize0; 2467 2460 if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) { 2468 2461 if (udev->speed != USB_SPEED_FULL ||