Am Freitag, 30. April 2004 05:37 schrieb Alan Stern:
> Let's define a new field in struct urb.  It could even be one of the bits
> in transfer_flags; call it URB_REJECT.  The idea is that if the URB_REJECT
> flag is set then usb_submit_urb() will fail.  What we want can be
> accomplished as simply as this:
>
>         urb->transfer_flags |= (URB_REJECT | URB_ASYNC_UNLINK);
>         usb_unlink_urb(urb);
>         while (atomic_read(&urb->kref.refcount) > 1) {
>                 current->state = TASK_UNINTERRUPTIBLE;
>                 schedule_timeout((5 * HZ + 999) / 1000);
>         }
>         urb->transfer_flags &= ~(URB_REJECT | URB_ASYNC_UNLINK);

Very, very tempting. Elegant and simple. But I have a problem with it.
It's entirely legal for a driver to call usb_get_urb() twice. And then we
have a problem. So I don't think that we should use the refcount.

        Regards
                Oliver



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to