On Thursday 28 June 2007, Marcel Holtmann wrote:

> the attached patch is an attempt for usb_alloc_bulk_urb() which will
> allocate the URB itself and its transfer buffer. It also use the
> endpoint data structure to create the pipe value. Please review it.

Seeing all these recent discussions reminds me that the USB gadget
stack (peripheral side, not host side) has drivers using a similar
idiom.  Have a look at drivers/usb/gadget/zero.c and see the two
routines alloc_ep_req() and free_ep_req() ...

In those cases, nothing like a URB_FREE_BUFFER flag was needed.
And I confess I think a purely layered/wrappered approach seems
best to me here; the core doesn't _need_ such a mechanism, ergo
it shouldn't have one.  It's easy enough to audit code to make
sure that if they use one routine to allocate, they use its
sibling to free.

Plus, I think I'd rather see the usb_host_endpoint be passed around
instead of the usb_endpoint_desriptor it holds.  That's just one
level less indirection, but the host_endpoint struct is a more
appropriate focus for the core and HCDs since it can hold various
other stuff that's useful.

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to