On Sunday 03 April 2005 8:33 am, Duncan Sands wrote: > Suppose a driver has taken a reference to a usb device (usb_get_dev). > Can the list of interfaces shift around underneath it? For example, > suppose the configuration changes, changing the set of interfaces.
Yes, exactly. As of last year sometime, usbcore will finally make sure that all drivers are unbound from the old config (and all URBs sent to it are canceled) before it sets up the new one. > Will the old set of interfaces continue to exist and be accessible > (if useless) via the referenced usb device, until the reference > is dropped? Or is it necessary to take references to individual > interfaces (via the not EXPORTed usb_get_intf)? When a driver gets a disconnect(interface) call, it must stop using all those references ... though it's just barely OK to drop such a reference (with the also-not-exported usb_put_intf!) after that disconnect() returns. The way to get a proper reference to an interface is from probe(), normally as the parameter but also possibly by groveling around in the active config and finding one to usb_driver_claim_interface(). I'd not rely on any other method of getting an interface reference, though I trust usbfs gets the locking right now. Then on disconnect() clean up, nulling out the old pointers and either just stopping all use of the interface passed in the disconnect() call or calling usb_driver_release_interface(). - Dave ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel