Here is a new version of my patch that also allows drivers to
ask the generic driver code to allocate a fixed-size per-device blob of
consistent DMA memory. It includes an example patch to via-rhine.c,
removing another 14 lines, including another memory allocation failure
error branch. I am running the resulting via-rhine driver now.
If I can eliminate an average of 5 line from each of the 557
modules in my modules.pcimap (never mind other busses for the moment),
that would be over 2000 lines of code. More importantly, I'm sure it
would eliminate a lot of bugs in untested error branches.
Dave M.: I am cc'ing this to because you asked for a
bus-independent API for allocating DMA consistent memory when I
discusssed consolidating some other driver DMA mapping operations
about six months ago. This patch adds the wrapper functions
dma_{alloc,free}_consistent() for this purpose which are not optimized
right now, but provide an API and could be expanded to support more
the the DMA allocation API as it is actually used. The implementation
can be optimized later, but I think it addresses your concern about
propagating artificial PCI dependence.
-- Adam J. Richter __ ______________ 575 Oroville Road adam@yggdrasil.com \ / Milpitas, California 95035 +1 408 309-6081 | g g d r a s i l United States of America "Free Software For The Rest Of Us."
This archive was generated by hypermail 2b29 : Thu Nov 07 2002 - 22:00:31 EST