On Fri, 20 Feb 2004, Hollis Blanchard wrote:
> 
> Well, I was picturing all those *_dma_supported() functions as being 
> plugged into (new) fields in struct bus_type:
>       struct bus_type {
>               ...
>               int (*dma_supported)(struct device *dev, u64 mask);
>       }

Ok, that would work. It might even be a good idea (not just DMA-related) 
to make sure that everything you can portably "do" with a device would 
show up as device operations. Right now it's not very well specified, and 
there's obviously a lot of confusion.

> If your *_dma_supported functions only take usb_dev, pci_dev, etc, then 
> you end up with code like asm-generic/dma-mapping.h:

I agree, that is horrible. On the other hand, some architectures don't 
need any indirection or any conditionals at all, since they know that they 
only have one type of DMA. 

Making the device operations explicit would be good, though, and would 
match how we do things in general. It's a fairly big change at this point, 
but if somebody is willing to put the effort into the cleanup, then I'm 
all for it.

I'd still ask that people don't do DMA on non-host devices. I'd rather 
have a USB "struct device" just return "DMA not supported", to make sure 
that everybody asks the right chip.

                Linus


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&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