On Tue, 3 Dec 2002 [EMAIL PROTECTED] wrote:

>I should have been more specific. Calling disconnect()
>will disconnect the driver from the interface. But the
>device will not be in the state it was before the driver
>bound to the device, it will be in the state the driver
>had put it before disconnect() was called plus the result
>of some timeouts which probably have never been properly
>tested.
>It usually works because most drivers sit idle most of
>the time.
>But usually working is not good enough for a regular API.
>Supporting unbinding a device from a driver needs support
>from the driver itself.

I think you're right here; there are (at least) 3 things that need to 
be done when disconnecting a driver from a device (interface):

1. The driver must stop using the interface.
2. All pending URBs must be aborted.
3. The device (or interface) should be placed into a stable/reset state.


#1 happens when the driver's disconnect() is called.

I don't think #2 happens, unless the URBs timeout or eventually 
complete successfully.  Some (e.g. interrupt-IN) don't timeout, and 
getting a (successfully) completed URB after the interface supposedly 
was disconnected may cause problems (depending on the driver).

I don't think #3 is possible for all devices.  The easiest way is have 
new drivers reset or otherwise stablize the device/interface.


Currently, #1 is done by usbdevfs, not (AFAIK) #2.  And #3 is really 
up to whatever new driver takes over.


-- 
Dan Streetman
[EMAIL PROTECTED]
--------------------------------------------------
186,282 miles per second:
It isn't just a good idea, it's the law!


-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to