Here's a suggestion that would help all existing usb drivers.  Add an
additional parameter to usb_control_msg (and the other synchronous message
subroutines as well) that takes a struct urb **.  The subroutines can use
it to store a pointer to the dynamically allocated URB, so that the driver
would have the ability to cancel the URB whenever it wanted.
What I'd thought about was instead to just provide the URB to unlink
if the timeout failed, device was disconnected, or whatever. Why ask
for some new api notion? In fact I think I have code sitting somewhere
around here that does exactly that, maybe I should dig it up...

That means synchronous callers could

dev->some_urb = ... alloc+save, locked against disconnect ...
... setup timeout to unlink the urb ...
sync_control_message (urb, bRequest, bRequestType, ...,
INTERRUPTIBLE or maybe not)
... cancel that timeout
switch (urb->status) {
...
}
free dev->som_urb

and the disconnect code could just unlink all active/submitted urbs.

- Dave




-------------------------------------------------------
This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Reply via email to