so far i have only used file operational structure in device driver.
Using system call open & read , write.
How to open device driver & transmit data using net_device_ops ?
Is there reference example on net for the user program to interact with it ?
I’m not sure I understand the question, so let me know if my answer doesn’t make sense.
I see you have defined functions for
.ndo_open,.ndo_stop, and.ndo_start_xmit..ndo_openis called by the kernel when you configure the interface usingifconfig upor use ifconfig to assign an address to the interface..ndo_stopis called by the kernel when you remove the module or if you shutdown the interface usingifconfig down.ifconfig is described here: http://linux.die.net/man/8/ifconfig
.ndo_start_xmitis called by the kernel network stack when a socket is used to transmit a packet. So, to transmit data using.ndo_start_xmityou’ll need to create a socket, assign an appropriate destination address, and send the data via the socket. If you’re using IP, there are tools you can use send packets easily, such as netperf or iperf.