On Wednesday 21 July 2004 09:17, Matthew Dharm wrote:
> 
> So, why not make some allocations earlier?  If I allocate enough URBs for a
> sg-list of such-and-such size, then tell the SCSI layer that my maximum
> sg-list length is such-and-such size, then I should be able to avoid that
> allocation.  Pre-allocating URBs at device init time (before it's attached
> to the SCSI subsystem) doens't bother me (much).

Why not?  Because URB allocation is Linux 2.2 legacy API ... :)


> Sounds good, yes?  But (and here's the kicker) what about things like the
> HCDs?
> 
> I'm no HCD expert, but it looks to me (doing a quick browse through the
> code) like there might be a few places in the core or the HCDs which
> allocate memory once they receive the URB to process.  That blows the
> entire point of this exercise out of the water.  Unless....
> 
> The only idea I had was to force URBs to be allocated in a manner such that
> they are associated with a device (and thus, by implication, with a
> particular controller and it's DMA pool).  Then, we can make any
> allocations that the core or HCD might need at that time.

That's exactly the reason why the gadget API passes the endpoint in
when allocating a usb_request object (analagous to URB on host side).
Per-request host-side allocations today are:

   -URB
  - URB-private data (different for each HCD)
  - TD (usually just one, except for UHCI or ep0)

Today, only the first can be pre-allocated.  But passing the endpoint
in means that they can _all_ be pre-allocated, and things like endpoint
polling interval (for periodic urbs) can be initialized ... although ISO is
messy since it's got that funky urb-within-urb notion (rather than just
doing the simple "packet-per-urb" thing).

- Dave




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&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