Subject: Re: Machine-independent bus DMA interface proposal
To: None <gibbs@freefall.freebsd.org>
From: Ignatios Souvatzis <is@beverly.rhein.de>
List: tech-kern
Date: 09/25/1996 10:39:52
Hi Justin,

> >
> >"Justin T. Gibbs" <gibbs@freefall.freebsd.org> writes:
> >
> >> 
> >> I think we're missing each other here.  Forcing the device driver to do the
> >> copy from a bus_dma_segment_t into its own private format doesn't solve the
> >> structure alignment problem.
> >
> >What `problem'?  Arguably, the device driver shouldn't be using a
> >structure at all, since structure packing isn't portable.  Tweaking
> >this one specific case misses the larger picture.
> 
> Then the SG format 'filters' can be written MI and can not only
> be shared among different devices, but different archtectures too.
> 
> >> In fact it forces each individual driver to
> >> handle it much the same as is done (or not done) now.
> >
> >No; it removes all knowledge of how the addresses are mapped from the
> >device driver.  The point of this interface is to deal with mapping
> >arbitrary regions of memory into DMAable regions of memory.
> 
> Put it still forces each driver to re-invent the wheel if their SG
> format is the same as other driver's.

I hope I'm not missing the point here... but it doesn't.

There is nobody preventing drivers which have functions/data formats in common 
*in excess of what the generic interface assumes* to use a common include file, 
or define a config tag which brings in a source file with common
functions. 

Whether this is worth the effort, and which of the methods to use,
depends on the particular format and driver...

Regards,
	Ignatios Souvatzis