Re: [RFC] pass sg lists to HCDs if supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 30 Jan 2009, David Vrabel wrote:

> All,
> 
> The epic USB 3.0 thread was getting a bit long so here's some actual
> (untested!) code to discuss.
> 
> If an HCD supports sg lists then we simply submit one urb with the
> mapped sg list (urb->sg) instead of many urbs each with an
> urb->transfer_buffer.
> 
> I think this is a good first step. Later on we can look at improving the
> API to allow urbs with sg lists to be submitted asynchronously which may
> be more useful to drivers other than mass storage.

It's a decent start.

Instead of adding new fields to struct urb, we could overload the 
existing fields.  For instance, the scatterlist address could be stored 
in urb->transfer_buffer and the number of entries could be stored in 
urb->number_of_packets.  If that value is 0 then it's a normal URB.  
(That's because only Bulk will use sg; Iso won't.)

The code that takes care of setting up the transfer buffer addresses
should be split out and EXPORTed, because any HCD that supports sg will
want to use it.

Perhaps it would be nice to see more code sharing between the two
sg_init routines, but that's a minor point.

Lastly, usbmon will of course have to be modified.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux