Skip to content

Commit 39549ee

Browse files
grandwolfdavem330
authored andcommitted
can: CAN Network device driver and Netlink interface
The CAN network device driver interface provides a generic interface to setup, configure and monitor CAN network devices. It exports a set of common data structures and functions, which all real CAN network device drivers should use. Please have a look to the SJA1000 or MSCAN driver to understand how to use them. The name of the module is can-dev.ko. Furthermore, it adds a Netlink interface allowing to configure the CAN device using the program "ip" from the iproute2 utility suite. For further information please check "Documentation/networking/can.txt" Signed-off-by: Wolfgang Grandegger <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4261a20 commit 39549ee

File tree

6 files changed

+869
-0
lines changed

6 files changed

+869
-0
lines changed

drivers/net/can/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@ config CAN_VCAN
1212
This driver can also be built as a module. If so, the module
1313
will be called vcan.
1414

15+
config CAN_DEV
16+
tristate "Platform CAN drivers with Netlink support"
17+
depends on CAN
18+
default Y
19+
---help---
20+
Enables the common framework for platform CAN drivers with Netlink
21+
support. This is the standard library for CAN drivers.
22+
If unsure, say Y.
23+
24+
config CAN_CALC_BITTIMING
25+
bool "CAN bit-timing calculation"
26+
depends on CAN_DEV
27+
default Y
28+
---help---
29+
If enabled, CAN bit-timing parameters will be calculated for the
30+
bit-rate specified via Netlink argument "bitrate" when the device
31+
get started. This works fine for the most common CAN controllers
32+
with standard bit-rates but may fail for exotic bit-rates or CAN
33+
source clock frequencies. Disabling saves some space, but then the
34+
bit-timing parameters must be specified directly using the Netlink
35+
arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw".
36+
If unsure, say Y.
37+
1538
config CAN_DEBUG_DEVICES
1639
bool "CAN devices debugging messages"
1740
depends on CAN

drivers/net/can/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
#
44

55
obj-$(CONFIG_CAN_VCAN) += vcan.o
6+
7+
obj-$(CONFIG_CAN_DEV) += can-dev.o
8+
can-dev-y := dev.o
9+
10+
ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG

0 commit comments

Comments
 (0)