Hello,
I’m writing PCI bus master DMA driver for win NT. I’m using DMA on the
pci card to transfer/receive data. For transfer data I’m using one dma
channel and for receiving data I’m using another dma channel. Now my
question is
Q1. Do I’ve to get adapter object for each channel(using
HalGetAdapter). Or just one HalGetAdapter() call can be used for both
the channels???
Thanking You,
Rgds,
Sunil
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> I’m writing PCI bus master DMA driver for win NT. I’m using DMA on the
pci card to transfer/receive data. For transfer data I’m using one dma
channel and for receiving data I’m using another dma channel. Now my
question is
Q1. Do I’ve to get adapter object for each channel(using
HalGetAdapter). Or just one HalGetAdapter() call can be used for both
the channels???
Just to be sure we’re all clear: I assume you mean NT V4.0, where this
function is still legal. And by “dma channel” I assume you mean “pseudo DMA
channel” (there ARE no channels in Busmaster DMA, right?).
A1. Well, in fact we talk about this in our book: It’s actually not
completely clear WHICH is “the right thing to do” in NT V4. At the end of
the day, in fact it really doesn’t matter much. It WILL work either way.
However, when *I* write DMA drivers, personally, I use two adapters… one
for read and one for write.
Using one “adapter” per simultaneous transfer is slightly preferable, as it
allows the HAL to keep track of the number of map registers that might be
committed. But, in fact, the NT DMA architecture (to stretch the normal
English definition of that word) doesn’t really specify.
Hope That Helps,
Peter
OSR Open Systems Resources, Inc.
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Peter,
There is a problem, however, that you don’t really cover in your book.
(Hmmm, well, maybe I blinked when I read it and missed it. If you
allocate 2 adapter objects, one for send, and the other for receive, you
still only have one device queue through which all those read and writes
must funnel. If you hang a read on the device queue before a send is cleared
from that device queue, you can end up with a send thinking its a receive,
and things go bump really really fast. There MUST be synchronization between
the two adapter objects.
Under NT4, one solution to this is to create another DEVICE_OBJECT, so you
now have a send device queue and a receive device queue each with it’s own
adapter object. Under 200, this is more difficult to do since the adapter
object wants a PDO.
Gary G. Little
Sr. Staff Engineer
Broadband Storage, LLC
xxxxx@broadstor.com
xxxxx@delphieng.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com