Chinaunix首页 | 论坛 | 博客
  • 博客访问: 84159
  • 博文数量: 19
  • 博客积分: 546
  • 博客等级: 中士
  • 技术积分: 232
  • 用 户 组: 普通用户
  • 注册时间: 2010-02-10 00:07
文章分类

全部博文(19)

文章存档

2014年(1)

2013年(3)

2012年(2)

2011年(4)

2010年(9)

我的朋友

分类: LINUX

2011-01-03 05:18:51

1.         Reset

DMA registers的值设为0;

2.         Initialization

-         Allocate the descriptor and status array in memory;

-         Write the base address of the descriptor array to TxDescriptor register;

-         Write the base address of the status array to TxStatus register;

-         Write the number of descriptors and statuses minus 1 to the TxDescriptor number register (一个descriptor对应一个status);

-         The descriptors and statuses in the arrays need not be initialized yet;

3.         Enable the transmit datapath

Setting the TxEnable bit in the command register;

4.         Setting up the descriptor

-         根据payload大小,并加上TCP/IP header, 看需要分配几个descriptor。将descriptor指向数据;

-         如果frame分为几个fragment,由此需要用多个descriptor 设置每个descriptor control fieldLast bit;

-         设置每个descriptor control fieldInterrupt bit;

-         设置每个descriptor control fieldSize;

5.         Increase the TxProduceIndex

-         TxProduceIndex = TxProduceIndex + # of descriptors(上一步中分配的);

-         If the datapath is not enabled during initialization, enable the datapath now;

6.         Transmission

-         The Ethernet block will start transmitting the frames as soon as it detects TxProduceIndex not equal to TxConsumeIndex

-            Tx DMA starts reading descriptors from memory;

-            The Ethernet block will try to start transmission on the Ethernet connection via the (R)MII interface;

7.         Write back the status of transmission

-         The Tx DMA writes the status of  the fragment’s transmission

-            Status for all but the last fragment: written as soon as they have been accepted by the Tx DMA manager

-            Status for the last fragment: written after the transmission has completed on the Ethernet connection

8.         The Ethernet block trigger a TxDoneInt interrupt

This interrupt triggers the device driver to inspect the status information.

阅读(1194) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~