Hello Oliver, On Thursday 16 January 2003 00:34, Oliver Neukum wrote: > Hi, > > I'd like to propose a small further patch. > > I want to bind URBs to usb_devices at allocation. > usb_alloc_urb (int i, int mem_flags) -> > usb_alloc_urb (struct usb_device *dev, int i, int mem_flags) > and usb_fill_* loose the struct usb_device references. > > Explanation: > The HCDs allocate and deallocate data structures during every submission. > This is wasteful, but as long as an URB can be sent to several devices, it > is unavoidable, because the devices may be be on busses controlled by > different HCDs.
In my driver, I use urbs as a part of a larger data structure (incl. data buffers). The structs are allocated in a global pool, and used from interrupt context. Binding an URB to a specific device will make me alloc() and free() urbs each time. How about a caching function: If an URB is submitted once, allocate the hcd-internal data structures and store a pointer inside the URB. If the URB is submitted twice, check that the device is the same, and reuse the structure. If the device is another, free the data structure and allocate a new one. With this aproach, you can do the same thing "under the hood". No API change, but speed optimisation. best regards Wolfgang Mües ------------------------------------------------------- This SF.NET email is sponsored by: Thawte.com Understand how to protect your customers personal information by implementing SSL on your Apache Web Server. Click here to get our FREE Thawte Apache Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel