]> git.hungrycats.org Git - linux/commit
[PATCH] USB: track usb ch9 device state
authorDavid Brownell <david-b@pacbell.net>
Thu, 6 Mar 2003 07:46:40 +0000 (23:46 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Thu, 6 Mar 2003 07:46:40 +0000 (23:46 -0800)
commitb3dca1317e2f4d32c0f693ff1c103561a91f6ba9
tree01b05991ac53912241ffd3f31abcd3e598372c1f
parenta9048822b6c80515d4ffb15ea5cf5306acaddef7
[PATCH] USB: track usb ch9 device state

This patch merges the USB state definitions from the ARM Linux
code (inside the sa1100 driver) and uses them to track what can
be done with the device.  That replaces the recently added
"udev->present" flag with a more complete/standard state model.

There are a few changes that might affect behavior if things
start to go really haywire:

 - usb_set_address() and usb_set_configuration(), used while
   enumerating, handle some unlikely cases more correctly:
   don't allow setting address to zero (undefined behavior),
   and do allow un-configuring (config 0).  (Adds a FIXME
   for an existing set-configuration bug too.)

 - usb_disconnect() flags the state change earlier (as soon
   as it's known).

 - usb_submit_urb() works in the states where messaging is
   allowed, and also enforces the "unless configured, only
   control traffic is legal" rule.

 - usb_unlink_urb() doesn't care any more about that state.
   (There seemed to be agreement that it must not matter.)

This will help with some further cleanups in the complex of
issues relating to driver removal, device removal, config
changing (with driver unbind and rebind), reset, and so on.
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/core/urb.c
drivers/usb/core/usb.c
include/linux/usb.h
include/linux/usb_ch9.h