留着
来源:互联网 发布:pdf全文翻译软件 编辑:程序博客网 时间:2024/05/29 17:50
The netif Interface All other communication in the direction interface ! network
stack is done via the netif_*() calls. For example, on successful device opening,
the network stack has to be noti ed, that it can now pass frames to the interface.
This is done by calling netif_start_queue(). After this call, the hard_start_xmit()
callback can be called by the network stack. Furthermore a network driver usually
manages a frame transmission queue. If this gets lled up, the network stack has
to be told to stop passing further frames for a while. This happens with a call
to netif_stop_queue(). If some frames have been sent, and there is enough space
again to queue new frames, this can be noti ed with netif_wake_queue(). Another
important call is netif_receive_skb()1: It passes a frame to the network stack, that
was just received by the device. Frame data has to be included in a so-called \socket
bu er" for that (see below).
Socket Bu ers Socket bu ers are the basic data type for the whole network stack.
They serve as containers for network data and are able to quickly add data headers
and footers, or strip them o again. Therefore a socket bu er consists of an allocated
bu er and several pointers that mark beginning of the bu er (head), beginning of data
(data), end of data (tail) and end of bu er (end). In addition, a socket bu er holds
network header information and (in case of received data) a pointer to the net_device,
it was received on. There exist functions that create a socket bu er (dev_alloc_skb()),
add data either from front (skb_push()) or back (skb_put()), remove data from front
(skb_pull()) or back (skb_trim()), or delete the bu er (kfree_skb()). A socket bu er
is passed from layer to layer, and is freed by the layer that
Ethernet and EtherCAT Devices Another issue lies in the way Linux handles de-
vices of the same type. For example, a PCI driver scans the PCI bus for devices it can
handle. Then it registers itself as the responsible driver for all of the devices found.
The problem is, that an unmodi ed driver can not be told to ignore a device because
it will be used for EtherCAT later. There must be a way to handle multiple devices
of the same type, where one is reserved for EtherCAT, while the other is treated as
an ordinary Ethernet device.
For all this reasons, the author decided that the only acceptable solution is to modify
standard Ethernet drivers in a way that they keep their normal functionality, but gain
the ability to treat one or more of the devices as EtherCAT-capable.
Below are the advantages of this solution:
No need to tell the standard drivers to ignore certain devices.
One networking driver for EtherCAT and non-EtherCAT devices.
No need to implement a network driver from scratch and running into issues,
the former developers already solved.
The chosen approach has the following disadvantages:
The modi ed driver gets more complicated, as it must handle EtherCAT and
non-EtherCAT devices.
Many additional case di erentiations in the driver code.
Changes and bug xes on the standard drivers have to be ported to the Ether-
CAT-capable versions from time to time.
- 留着
- 留着
- 留着
- 留着
- 留着
- L留着
- PowerDesigner版本控制 留着
- 留着 自用研究
- 进度条 转载-没测试~ 留着
- 几个不错的博客,留着
- oracle dataguard 物理备库创建(留着)
- 总结20条编程经验,有用,留着
- css li 不换行 没用到,留着
- 英语作文的好结尾i~(留着4,6级用)
- 别人推荐的SQL书,留着,慢慢学习
- 三篇关于handler的文章不错,留着
- 成语归类大全(留着,孩子有用的)
- 网页下拉列表跳转的实现(嘿嘿...留着...以后用得着...)
- 图的遍历
- Android应用自动更新功能的代码实现
- 我感兴趣的博客和网站
- try_module_get简析
- lpcxpresso-cn开发板编译环境IAR Embedded Bench使用小结
- 留着
- Ffmpeg开发手册
- 转义符 自备
- windows7 修改窗口背景色
- 使用WinINet和WinHTTP实现HTTP访问
- 动态修改strings文件中的字符串 使用占位符
- Flex4.5RadioButton组件的应用
- WTL学习二:画文字
- HP 5200LX驱动安装历程