Am Donnerstag, 20. Februar 2003 01:45 schrieb Greg KH:
> On Wed, Feb 19, 2003 at 07:33:57PM -0500, Johannes Erdfelt wrote:
> > > But what about drivers that fire off urbs and don't keep a pointer to
> > > them around?  They don't know if all of their urbs are completed or
> > > not, nor should they really care.  The visor driver is one good example
> > > of this.
> >
> > Sounds broken to me. Someone needs to keep track of it, and it's not the
> > core right now.
> >
> > I think they should care simply because they allocated the memory and
> > submitted the URB.
> >
> > It's very irresponsible to expect someone else to deal with your mess :)
>
> Heh.  No, urbs are referenced counted now.  So a driver can do the
> following just fine:
>       - usb_alloc_urb()
>       - urb data = kmalloc()
>       - usb_submit_urb()
>       - usb_free_urb()
>
> Then later in the completion function you free the transfer buffer.
> When the hcd is done with the urb, the last urb_free_urb() call in the
> hcd causes the urb to disappear.
>
> No worries or overhead in the usb driver to keep track of all of
> the urbs it created, enabling very simple code.

What do you do on disconnect() ? How do you make sure that a
completion handler will eventually be called if nobody's there to unlink
it.

        Regards
                Oliver



-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to