Your device needs to be PCI DMA Master Capable.
After locating and registering your PCI card (using
WD_PciScanCards(), WD_PciGetCardInfo() and
WD_CardRegister()), you need to lock a memory buffer. To do this,
call WD_DMALock() to lock a memory buffer in the kernel and
receive an array of pages (dma.dwPages) representing the physical
address/es of your buffer.
(For Contiguous Buffer DMA the array will contain a single page). [Please refer
to the
WinDriver User's Manual
for more information regarding DMA handling and the related APIs. Note that in
newer versions of WinDriver WD_DMALock() is described in the
WinDriver PCI Low Level API Reference, which is available from the
WinDriver/docs/ directory].
Now it is up to you to program your BUS-MASTER device with the page list and
send a command for your card to start the transfer.
Programming a PCI device for DMA transfer is device specific.
Examples of DMA functions, using our API, can be found in the special WinDriver
libraries for the enhanced WinDriver supported PCI chip sets for major PCI chip
vendors, such as PLX, Altera, QuickLogic, AMCC, and others (See the WinDriver
Use's Manual for more information regarding this enhanced support).
At the end of the transfer you should call WD_DMAUnlock() to
release the buffer's locked physical memory.
|