]> rtime.felk.cvut.cz Git - socketcan-devel.git/blob - kernel/2.6/Documentation/networking/can/can-core.txt
beaab9e505f0137cc557145e2c4e4aa693694846
[socketcan-devel.git] / kernel / 2.6 / Documentation / networking / can / can-core.txt
1 ============================================================================
2
3 can-core.txt : core module description
4
5 Part of the documentation for the socketCAN subsystem
6
7 This file contains:
8
9   1 Socket CAN core module
10     1.1 can.ko module params
11     1.2 procfs content
12     1.3 writing own CAN protocol modules
13
14 ============================================================================
15
16 1. Socket CAN core module
17 -------------------------
18
19   The Socket CAN core module implements the protocol family
20   PF_CAN. CAN protocol modules are loaded by the core module at
21   runtime. The core module provides an interface for CAN protocol
22   modules to subscribe needed CAN IDs (see overview.txt, chapter 3.1).
23
24   1.1 can.ko module params
25
26   - stats_timer: To calculate the Socket CAN core statistics
27     (e.g. current/maximum frames per second) this 1 second timer is
28     invoked at can.ko module start time by default. This timer can be
29     disabled by using stattimer=0 on the module commandline.
30
31   - debug: (removed since SocketCAN SVN r546)
32
33   1.2 procfs content
34
35   As described in overview.txt, chapter 3.1 the Socket CAN core uses
36   several filter lists to deliver received CAN frames to CAN protocol
37   modules. These receive lists, their filters and the count of filter
38   matches can be checked in the appropriate receive list. All entries
39   contain the device and a protocol module identifier:
40
41     foo@bar:~$ cat /proc/net/can/rcvlist_all
42
43     receive list 'rx_all':
44       (vcan3: no entry)
45       (vcan2: no entry)
46       (vcan1: no entry)
47       device   can_id   can_mask  function  userdata   matches  ident
48        vcan0     000    00000000  f88e6370  f6c6f400         0  raw
49       (any: no entry)
50
51   In this example an application requests any CAN traffic from vcan0.
52
53     rcvlist_all - list for unfiltered entries (no filter operations)
54     rcvlist_eff - list for single extended frame (EFF) entries
55     rcvlist_err - list for error frames masks
56     rcvlist_fil - list for mask/value filters
57     rcvlist_inv - list for mask/value filters (inverse semantic)
58     rcvlist_sff - list for single standard frame (SFF) entries
59
60   Additional procfs files in /proc/net/can
61
62     stats       - Socket CAN core statistics (rx/tx frames, match ratios, ...)
63     reset_stats - manual statistic reset
64     version     - prints the Socket CAN core version and the ABI version
65
66   1.3 writing own CAN protocol modules
67
68   To implement a new protocol in the protocol family PF_CAN a new
69   protocol has to be defined in include/linux/can.h .
70   The prototypes and definitions to use the Socket CAN core can be
71   accessed by including include/linux/can/core.h .
72   In addition to functions that register the CAN protocol and the
73   CAN device notifier chain there are functions to subscribe CAN
74   frames received by CAN interfaces and to send CAN frames:
75
76     can_rx_register   - subscribe CAN frames from a specific interface
77     can_rx_unregister - unsubscribe CAN frames from a specific interface
78     can_send          - transmit a CAN frame (optional with local loopback)
79
80   For details see the kerneldoc documentation in net/can/af_can.c or
81   the source code of net/can/raw.c or net/can/bcm.c .
82
83