Alan Stern wrote: > 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.) I think this is too confusing. I could add some inline functions for retrieving the sg related values if you still want the overloaded fields. > 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. I'm not sure what code you're referring to? The sg list is already mapped and the HCD need only do something like this: for_each_sg(sg, sg, std->urb->sg_nents, i) { std->sgl_virt[i].buf_ptr = cpu_to_le64(sg_dma_address(sg)); std->sgl_virt[i].len = cpu_to_le32(sg_dma_len(sg)); } to fill in the hardware's sg list. > Perhaps it would be nice to see more code sharing between the two > sg_init routines, but that's a minor point. Heh, yeah. It was a Friday afternoon hack just to get something out there to discuss. > Lastly, usbmon will of course have to be modified. Thanks for the heads up on this. I hadn't considered usbmon at all. David -- David Vrabel, Senior Software Engineer, Drivers CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562 Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/ -- 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