On Wed, 6 Apr 2005, Duncan Sands wrote: > Hi Alan, thanks for the info. > > > If you want to be able to use a pointer to the interface, then > > usb_get_intf is what you need. But of course you shouldn't do anything > > significant (like sending an URB to the interface) once it's a zombie. > > Do you mean "mustn't do anything significant", or do you mean "it is > pointless to do anything significant, because it is sure to fail"?
Hmmm... I guess it depends on what you mean by "significant". Simple memory references through the struct usb_interface are okay, obviously. Submitting an URB isn't a good idea. If the device actually was disconnected, of course, the submission will fail anyway. In the other case, where the driver was unbound but the device is still attached, the danger is that the URB might very well succeed! > > The reason usb_get_intf isn't exported is because drivers aren't expected > > to use interfaces unless they are bound to them. The assumption is that > > drivers will contain sufficient internal interlocks so that they won't > > need to refer to an interface once they've unbound from it. > > I was hoping that things had become more relaxed. Well obviously usb_get_intf hasn't been in tremendous demand, because it's still not exported. On the other hand it is true that the hub driver uses it, so I don't see why other drivers shouldn't be allowed to as well. My advice: If you need to export usb_{get,put}_intf, go right ahead! Alan Stern ------------------------------------------------------- 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