On Thu, Mar 06, 2003 at 11:23:16AM -0500, Alan Stern wrote:
> 
> Okay, so this means that the driver has to allocate and free the urb.  
> What used to be a simple function call has now turned into (without error 
> checking):
> 
>       urb = usb_allocate_urb(...);
>       usb_submit_bulk_msg(urb, ...);
>       status = usb_wait_msg(urb, timeout, &bytes);
>       usb_free_urb(urb);

Careful you don't have a race between usb_submit... and usb_wait_msg,
where the urb could complete and we would just sit and wait in the
wait_msg() call not realizing it's actually completed.  Just an
implementation detail :)

> Unfortunately, to do this requires a far-reaching change.  It probably 
> should have been done earlier (for all I know, it was proposed but nobody 
> thought it was a good idea or wanted to do it).  Here's the idea:  Change 
> the
> 
>       struct usb_device *dev;
> 
> member of struct urb into
> 
>       struct usb_interface *intf;

I really want to do this, as it makes so much sense from the point of
view of the device driver.  I should have done it when I changed the
probe function :(

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to