Skip to contentSkip to conversation

Tutorial or Read-me file for Linux can API

DISCUSSION Katoch 2 participants 2 messages Apr 5, 2013 CAN network drivers

lore
Share & tools
lore
#1 lore raw
Quoted 5 lines · Katoch

Hi,

I am going through a can base network driver for MCP-2515
https://github.com/raspberrypi/linux/blob/rpi-3.6.y/drivers/net/can/mcp251x.c

Quoted 8 lines

Please suggest where i can find the description of the function, :-- alloc_candev
open_candev
alloc_can_skb
can_dropped_invalid_skb
alloc_can_err_skb
etc .....

The mcp251x driver uses the Linux CAN driver infrastructure, e.g. to be able to set bitrates and other settings with the ip tool from the iproute2 package.

See:

http://lxr.linux.no/#linux+v3.8.5/Documentation/networking/can.txt#L746

You can find the according header files and implementations in:

linux/include/linux/can/dev.h

and

linux/drivers/net/can/dev.c

Please take care that CONFIG_CAN_DEV and CONFIG_CAN_CALC_BITTIMING are enabled in your Linux kernel configuration, see:

http://lxr.linux.no/#linux+v3.8.5/drivers/net/can/Kconfig#L33

Regards,
Oliver