PCI DMA Driver

Hello,

I’m writing PCI Dma driver. I would like to know how to get handle to
DMA(sitting on PCI device). I’m using HalAssignSlotResources( ) to get
handle to memory, port and interrupt. But HalAssignSlotResources( ) is
not able to get the handle to DMA.

In function HalAssignSlotResources( ), the case statement
CmResourceTypeDma is not getting executed. Can anybody give some
information regarding the same.

Thanks!
Rgds,
Sunil Sahu


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

>In function HalAssignSlotResources( ), the case statement

CmResourceTypeDma is not getting executed. Can anybody give some
information regarding the same.

On classic x86 systems, this only refers to ISA bus system DMA, which is
very different from PCI bus masters. Don’t know for sure if there is any
other hardware out there that shows up as CmResourceTypeDma. Typically, I
don’t believe there is any “system” DMA for PCI busses, although
personally, I think it would have been a great idea for PCI system chipsets
to have standardized scatter-gather DMA (essentially memory to memory copy
in hardware).

In ISA bus system DMA, you have to allocate the “channel” to some specific
piece of I/O hardware while in use for a transfer. In contrast, for PCI bus
masters, it’s possible for every PCI slot to have an active bus master
command pending, and the PCI transfer bursts will get interleaved by the
PCI bus arbitrator.

  • Jan

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 Dma driver. I would like to know how to get handle to

DMA(sitting on PCI device). I’m using HalAssignSlotResources( ) to get
handle to memory, port and interrupt. But HalAssignSlotResources( ) is
not able to get the handle to DMA.

In function HalAssignSlotResources( ), the case statement
CmResourceTypeDma is not getting executed. Can anybody give some
information regarding the same.

The DMA channel numbers are ISA only. PCI cards do not require such for DMA
support. Use HalGetAdapter to create the DMA support for your PCI card.

Max


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

> personally, I think it would have been a great idea for PCI system
chipsets

to have standardized scatter-gather DMA (essentially memory to memory copy
in hardware).

This is a bad way - the good way for a chipset would be to support the
address translation registers/table for DMA addresses set by the cards.
This is called the “hardware map registers”. Usually the x86 machines have
no such.

Max


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

Although I hear the IA64 may change that.

Gary

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, January 30, 2001 4:22 PM
To: NT Developers Interest List
Subject: [ntdev] Re: PCI DMA Driver

personally, I think it would have been a great idea for
PCI system
chipsets
> to have standardized scatter-gather DMA (essentially
memory to memory copy
> in hardware).

This is a bad way - the good way for a chipset would be to
support the
address translation registers/table for DMA addresses set by
the cards.
This is called the “hardware map registers”. Usually the x86
machines have
no such.

Max


You are currently subscribed to ntdev as:
xxxxx@delphieng.com
To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

At 03:21 AM 1/31/2001 +0300, Maxim S. Shatskih wrote:

> personally, I think it would have been a great idea for PCI system
chipsets
> to have standardized scatter-gather DMA (essentially memory to memory copy
> in hardware).

This is a bad way - the good way for a chipset would be to support the
address translation registers/table for DMA addresses set by the cards.
This is called the “hardware map registers”. Usually the x86 machines have
no such.

Seems like hardware map registers and having scatter-gather DMA in the PCI
chipset would accomplish very different goals. I think about all the lower
end PCI devices that are target only or do contiguous only bus mastering
and think these devices could have worked a lot more efficiently had the
already very complex PCI/processor chipset been designed with DMA support.
This seems like it would have added only a tiny amount of complexity to the
chipset, and added zero complexity to the PCI device. It would have also
made programming many PCI devices potentially simpler, as a standard DMA
architecture would have existed.

  • Jan

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

Hello,
I am writing a WinNt driver for BusMaster Dma PCI card.

Q1. Is it necessary to call the IoCompleteRequest() for every
IoStartPacket() / IoStartNextPkt() function calls.?

Q2. I am using I/O manager Q’s for the IRP’s by calling IoStartPacket()
function.
and in the StartIo() function I am not calling the IoCompleteRequest()
function, but i am calling IoCompleteRequest() function in the Dpc
function. now my Question is “till i call the IocompleteRequest(), the
StartIo() function will be blocked or it can be called for the next
IostartPacket() function call ?”

Q3. I got doubt when books expliend about IoStartPacket() saying that
the IO Manager will see the Device status, if device is busy it will Q’s
the IRP otherwise it will call the StartIo() function.

what is the meaning of DeviceBusy? when it becomes busy(means at which
call it becoms)? when it becomes notbusy?
If we call the IoCompleteRequest() then will it becomes not busy?

please give me the details?


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

> function. now my Question is "till i call the IocompleteRequest(), the

StartIo() function will be blocked or it can be called for the next
IostartPacket() function call ?"

IoCompleteRequest does nothing with the queue.
You must call IoStartNextPacket to get the next packet off the queue. This
delivers the next IRP to your StartIo routine.
IoStartNextPacket must be called either from StartIo itself or from the DPC
which completed the IRP.

Max


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

Art Baker/OSR/Walter and many others have beaten this subject to death in
their books and articles. So you understand what I’m trying to say. You can
also check out a simple sample on our website just meant to demonstrate this
stuff.

http://support.microsoft.com/support/ddk/ntddk/NTsamples/default.asp

-Eliyas

-----Original Message-----
From: Sunil Kumar Sahu [mailto:xxxxx@teil.soft.net]
Sent: Thursday, February 01, 2001 6:25 AM
To: NT Developers Interest List
Subject: [ntdev] PCI DMA Driver

Hello,
I am writing a WinNt driver for BusMaster Dma PCI card.

Q1. Is it necessary to call the IoCompleteRequest() for every
IoStartPacket() / IoStartNextPkt() function calls.?

Q2. I am using I/O manager Q’s for the IRP’s by calling IoStartPacket()
function.
and in the StartIo() function I am not calling the IoCompleteRequest()
function, but i am calling IoCompleteRequest() function in the Dpc
function. now my Question is “till i call the IocompleteRequest(), the
StartIo() function will be blocked or it can be called for the next
IostartPacket() function call ?”

Q3. I got doubt when books expliend about IoStartPacket() saying that
the IO Manager will see the Device status, if device is busy it will Q’s
the IRP otherwise it will call the StartIo() function.

what is the meaning of DeviceBusy? when it becomes busy(means at which
call it becoms)? when it becomes notbusy?
If we call the IoCompleteRequest() then will it becomes not busy?

please give me the details?


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.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

Hello,

I’m writing PCI busmaster DMA driver for win NT 4.0. I’m using
HalAllocateCommonBuffer( ) for the data to be transfered using DMA.

I’ve to transfer the data from this buffer to the SDRAM(size 16 MB)
sitting on the Pci device.

I’m programming the source address of the Dma with the physical address
returned by the HalAllocateCommonBuffer( ). My final destination for
data transfer is the SDRAM sitting on the Pci device.

I’m getting the bus relative SDRAM address from the BAR 0 of the pci
configuration space. I’m also getting the virtual address of the mapped
SDRAM. ( Just for your information I’m able to do memory read or write
to SDRAM with this virtual address).

Now the question is :- Which address shall I use to program the DMA
destination address?? Shall I use the address which I’m getting from the
BAR 0 of the cofiguration space or I’ve to use virtual address for
programming the destination address of the DMA.
I tried both the way but I’m not able to do DMA. Can anybody tell where
I’m going wrong??

Waiting for reply,
Thanks!
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