• Alan Stern's avatar
    [PATCH] USB device init: implement the Windows scheme · 1e3cd4ce
    Alan Stern authored
    This patch implements the Windows scheme for USB device initialization.
    It also incorporates the change recently posted by David to scrub the
    endpoint state following a SET-ADDRESS.  Other noteworthy changes:
    
    	There are two new module parameters to control whether the
    	old scheme or the new one is used first and whether the other
    	scheme is tried if the first one fails.  Default settings are
    	to use the new scheme only.
    
    	hub_set_address() returns 0 immediately if the device is already
    	in the USB_STATE_ADDRESS state.
    
    	On the first attempt to read the device descriptor the code
    	uses a short 1-second timeout.  This ought to help prevent
    	full-speed devices with an 8- or 16-byte maxpacket from
    	slowing the procedure down by NAKing the unexpectedly early
    	status stage of the transfer.
    
    	For debugging, the ep0 maxpacket value is printed.  It might
    	be a good idea to validate it rather than just believing the
    	device -- although I haven't heard of any device providing
    	an incorrect value other than 0.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    1e3cd4ce
hub.c 77.8 KB