I'm trying to write a slightly modified CAN protocol for SocketCAN. The SocketCAN documentation has a short section about this:
5.3 writing own CAN protocol modules
To implement a new protocol in the protocol family PF_CAN a new
protocol has to be defined in include/linux/can.h .
The prototypes and definitions to use the SocketCAN core can be
accessed by including include/linux/can/core.h .
In addition to functions that register the CAN protocol and the
CAN device notifier chain there are functions to subscribe CAN
frames received by CAN interfaces and to send CAN frames:
can_rx_register - subscribe CAN frames from a specific interface
can_rx_unregister - unsubscribe CAN frames from a specific interface
can_send - transmit a CAN frame (optional with local loopback)
For details see the kerneldoc documentation in net/can/af_can.c or
the source code of net/can/raw.c or net/can/bcm.c .
(https://www.kernel.org/doc/Documentation/networking/can.txt)
The problem is I can't find some of the files referenced here. I'm not super familiar with the Linux kernel, so I don't know if I'm looking in the wrong place. I can find include/linux/can.h
and the directory include/linux/can/
but there is no core.h
file there. Additionally, I can't locate the net/
directory that is referenced.
Other info:
I am able to send and receive raw CAN frames, so I believe I have SocketCAN set up correctly
Contents of directory (where
core.h
should be):beaglebone:~# ls /usr/include/linux/can/ bcm.h error.h gw.h netlink.h raw.h
I'm using Debian on a BeagleBone Black (I'm not sure if the embeddedness of my system makes a difference)
If someone can help point me to where I should be looking for these files, I would be very obliged.
Many thanks!