Network device driver [closed]

末鹿安然 提交于 2019-12-13 07:56:51

问题


I want to write Linux device driver for network based device. This network device is just Input output control only and also this device connects through Ethernet port via ethernet cable. How can i write driver? How to transfer data between device and kernel?


回答1:


If the device just connects to the Linux machine through Ethernet, then you don't need to write a kernel driver at all - a userspace daemon can have full access to Ethernet through the AF_PACKET socket address family. See the packet(7) man page for details.




回答2:


You can choose for a TCP or UDP connection communication.

for TCP you must opt for a stream based transfer But UDP is not a reliable communication rather it is faster as compared to TCP.

I would suggest to go with Beginning Linux Programming which has a theoretical as well as a practical reflection.

Cheers !!



来源:https://stackoverflow.com/questions/15918141/network-device-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!