DMA to Multiple Buffers with 1 Chain

Hi. I have a custom PCI card that provides radar video, and supports up to
4 logical output channels. That is, the incoming radar video is processed
according to the demands of 1 to 4 channel configurations. The card divides
a 360 degree antenna sweep into 4096 slices, and raises an interrupt for
each slice. My driver must build a DMA chain to copy the video into each
client buffer. (This is an exclusive device so only one process will be the
client for all 4 channels.)

As you can see, I can have 1 to 4 separate transfers from the board’s local
space into 1 to 4 separate buffers in user memory. I’d like to build one
great honkin’ DMA chain to do all at once, since all data is available at
the same instant, and I have to get it befor the next interrupt. But I
can’t do this using a single GetScatterGatherList that I know and have come
to love.

After searching this list, I find that Peter and Mark indicate
(http://www.osronline.com/lists_archive/ntdev/thread5762.html) that I can
get multiple DMA adapters for my single device. Is this truly so? If so,
could I get one DMA adapter for each channel, call GetScatterGatherList for
each channel, and then combine their SG lists into one DMA chain? Or is
this bad? Does this scale to, say, 8 channels?

Any other suggestions? Thanks.

john.

“John Reilly” wrote in message news:xxxxx@ntdev…
>
> After searching this list, I find that Peter and Mark indicate
> (http://www.osronline.com/lists_archive/ntdev/thread5762.html) that I can
> get multiple DMA adapters for my single device. Is this truly so? If so,
> could I get one DMA adapter for each channel, call GetScatterGatherList
for
> each channel, and then combine their SG lists into one DMA chain? Or is
> this bad? Does this scale to, say, 8 channels?
>

John… if it weren’t so, would I have posted it : -)

Assumptions: You have a device that is capable of performing scatter/gather
in hardware; Your device is a 32-bit busmaster on systems with less than 4GB
of physical memory, or a 64-bit busmaster on systems that have more than 4GB
of physical memory.

Then, in fact, the whole issue about adapters and map registers is really
moot.

Again, given the assumptions above (true for this whole posting), here’s an
experiment to try as a proof point: Instead of setting the max length of
transfer to whatever you have now, set the max lengthof transfer to four
times that max length (one for each of four channels). You should get back
four times the number of map registers as your “max map register count”.

Remember: To produce a driver that works properly on all platforms, you must
never exceed this “max map register count.”

As long as you meet the assumptions above, you can call GetScatterGatherList
in parallel as many times as you like. If you want to hand the result of
what Windows would consider 4 DMA transfers all as one big freakin’
scatter/gather list to your device, hey, that’s between you and the God of
Radar Devices. Seriously, no problem.

Remember to do all the appropriate things: PutScatterGatherList for each
list, KeFlushIoBuffers, blah blah…

Peter
OSR