I am writing a driver to handle a network device on uClinux.
For reception of Ethernet frames, the interrupt handler receives the frame from the hardware, then it gets passed up and dealt with by the higher layers of the TCP/IP stack, so we do not have to do anything in user space.
The network device also sends and receives "control frames" which contain statistical information. When these interrupts are received, the same hardware reception procedure occurs (from a different buffer), but this time, we need to write a user space application that interprets the statistical information, and updates SNMP information.
How do we call a user space application from a kernel interrupt handler? Is that what I want to do or is there a better way? I think I am lacking an understanding of what the next step is after an interrupt handler executes?
Thanks,
Austin.
The standard approach is "netlink" sockets.
I haven't seen a response to your question, so here's a quick description.
In recent kernels, (where "recent" is any time in the last 10 years), the standard way to deliver any packet- or message-oriented networkish information to userspace is through a netlink socket.
Essentially a netlink socket is a socket opened with a kernel-defined protocol family that connects your socket to one of several possible in-kernel sources and sinks.
It is relatively straightforward to hook into, and rather than "calling a user space application" on receipt of the stats/control frames, the netlink concept allows your driver to deliver the information asynchronously. This has all sorts of benefits.
A Google search using the terms "linux netlink" revealed lots of friendly links, one of which is the following Linux Journal article:
http://www.linuxjournal.com/article/7356
The single problem that you may have is that uClinux is getting a bit long in the tooth (since ARM7 has been largely supplanted by ARM9 and M68XXX has been supplanted by MMUful ColdFire, etc etc). So with more information about which kernel version you are using, my answers and those of others would be more informative.
If your kernel is so old that netlink doesn't make sense, you may want to get somewhat "dirty" and set up a /proc interface. Procfs is deprecated for new work, so consider such an option only if your kernel is pre-2.6. (In 2.6 and forward, sysfs is a much more disciplined approach.)