Re: patch to shift memory allocation s to usb_alloc_urb ()

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Am Montag, 2. Juli 2007 schrieb David Brownell:
> On Saturday 30 June 2007, Oliver Neukum wrote:
> 
> > So do we have consensus for this prototype:
> > 
> > struct urb *usb_alloc_urb(struct usb_host_endpoint *ep,
> > 		unsigned int max_length, unsigned int iso_fields,
> > 		gfp_t mem_flags);  
> 
> Calling conventions that require line-wrapping are almost by
> definition unwieldy ... :(

In usbcore we have names_containing_exact_descriptions.
But yes. I intended to find a unified API that allows preallocation.
If we can live with a separate allocator for ISO URBs, we can
do better.

> That might make sense for an HCD method; size_t for length,
> and rename it so it doesn't suggest it's a "maximum" so much
> as an educated guess.

So you are suggesting that usbcore should preallocate, but
also, if need be allocate more in usb_submit_urb()? So that
the guarantee against getting ENOMEM is valid only if you
don't exceed the hint given at allocation time?
That is an idea I would have never had, but it is very good.

> But otherwise, I thought one of the goals was to get rid of
> such annoying "iso fields" (should be packets, not fields!)
> parameters, which were always being passed as zero ... ?
> 
> I'd expect drivers would just pass {ep, length, gfp} except
> for the rare ISO ones, which would pass the number of packets.
> That suggests two separate signatures at that level.

OK.

	Regards
		Oliver

-------------------------------------------------------------------------
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/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.