CE下PCI网卡的传输方式

jw212 2010-10-13 05:44:28
今天看到MSDN上有关的文章:

The Windows CE NDIS implementation does not support direct memory access (DMA). Do not use the NdisSetupDmaTransfer, NdisCompleteDmaTransfer, NdisMRegisterDmaChannel, NdisMDeregisterDmaChannel, NdisMAllocateMapRegisters, NdisMFreeMapRegisters, NdisMReadDmaCounter, and NdisGetSharedDataAlignment functions.

Use the NdisMAllocateSharedMemory and NdisMFreeSharedMemory functions for PCI bus master DMA transfers.

那在CE下PCI网卡用PIO么,会不会很慢啊?有没有人搞过这方面的研究啊

而且我看过CE下E100BeX代码,里面仍有对NdisMAllocateMapRegisters的调用:Mp_init.c L993
Status = NdisMAllocateMapRegisters(
Adapter->AdapterHandle,
0,
NDIS_DMA_32BITS,
Adapter->NumTbd,
NIC_MAX_PACKET_SIZE);

这个又是如何解释啊,NDIS不是不support了么?
...全文
105 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
jw212 2010-10-14
  • 打赏
  • 举报
回复
今天在又翻了一些资料出来,在microsoft windows CE device driver kit中有一节是:Implementing DMA for NDIS Miniport Drivers
专门提到了这个问题,当前ce还没有自己的DMA机制,然而开发人员可以在他们自己的小端口卡驱动程序中实现相同的功能,但是写的太简单了,而且没有找到实例,不知道有没有人做过可以出来讲解一下啊?

Implementing DMA for NDIS Miniport Drivers
DMA is important for efficient networking because it enables the layers in
the networking architecture to share data without first copying that data

two categories of DMA: slave DMA and busmaster DMAB
 
Slave DMA
Slave DMA is appropriate for OEMs because it requires a block of memory that
is pre-allocated in the device memory map of the Windows CE–based platform.
Miniport drivers can map that block of physical memory to the driver’virtual
memory space,
and then use the VirtualAlloc and VirtualCopy functions to move
data in and out of that space
 
busmaster DMA
To receive data, the driver allocates a shared memory block, transfers the
data to buffers within that block, and uses NDIS functions to indicate that a
packet has arrived. To send data, the driver uses the LockPages and
UnlockPages functions to map the virtual memory to device memory, informs the
NIC of the addresses of the data, and instructs the NIC to send the data.
This method can be faster for larger data block sizes.

19,520

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧