阅读:1368回复:1
PCI9054 DMA Slave模式问题
我做完了利用9054芯片内DMA控制器做DMA主模式传输,现在想利用系统DMA控制器做从模式实验,遇到问题如下,我看的书是《Windows2000 设备驱动程序设计指南》。
1、StartDevice中系统没有分配CmResourceTypeDma资源(主模式中好象不用也行),也就是说系统没有给我的驱动分配任何系统可用DMA通道及资源。 2、AdapterControl例程有个启动DMA操作函数StartTransfer,但书中没给出此函数内容,我想它应该是对PCI某几个寄存器进行操作,但我不知道具体怎么做,忘各位指点一下。 希望做过9054 DMA Slave操作的同仁能解答下,并给一段相应的程序,谢谢! |
|
沙发#
发布于:2005-06-09 12:41
VOID StartTransfer(PDEVICE_EXTENSION pdx, PHYSICAL_ADDRESS address, BOOLEAN isread)
{ // StartTransfer // Setup read or write transfer registers. Note that the 9054 calls a transfer // from memory to the device a \"read\" //Channel0 interrupt to the PCI Bus interrupt,Done Interrupt Enable,FIFO WRITE_PORT_ULONG((PULONG) (pdx->portbase + DMAMODE0), 0x20C00); //DMA Channel0 PCI Address WRITE_PORT_ULONG((PULONG) (pdx->portbase + DMAPADR0), address); //DMA Channel0 Local Address,自己设计的FIFO地址 WRITE_PORT_ULONG((PULONG) (pdx->portbase + DMALADR0), 0x8); //DMA Channel0 Transfer Size(Bytes) WRITE_PORT_ULONG((PULONG) (pdx->portbase + DMASIZ0), pdx->xfer); if (isread) { // read from device //from the Local Bus to the PCI Bus WRITE_PORT_ULONG((PULONG) (pdx->portbase + DMADPR0), 0x8); } // read from device else { // write to device //from the PCI Bus to the Local Bus WRITE_PORT_ULONG((PULONG) (pdx->portbase + DMADPR0), 0x0); } // write to device // start the transfer pdx->state = Started; //Channel0 Enable,Start WRITE_PORT_ULONG((PULONG) (pdx->portbase + DMACSR0), 0x3); } // StartTransfer |
|