Skip to content

Commit d6e640f

Browse files
hartkoppmarckleinebudde
authored andcommitted
can: update documentation wording error frames -> error messages
As Heinz-Juergen Oertel pointed out 'CAN error frames' are a already defined term for the CAN protocol violation indication on the wire. To avoid confusion with the error messages created by CAN drivers available via CAN RAW sockets update the documentation and change the naming from 'error frames' to 'error messages' or 'error message frames'. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 8b5e218 commit d6e640f

4 files changed

Lines changed: 27 additions & 27 deletions

File tree

‎Documentation/networking/can.txt‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,16 @@ solution for a couple of reasons:
232232
arbitration problems and error frames caused by the different
233233
ECUs. The occurrence of detected errors are important for diagnosis
234234
and have to be logged together with the exact timestamp. For this
235-
reason the CAN interface driver can generate so called Error Frames
236-
that can optionally be passed to the user application in the same
237-
way as other CAN frames. Whenever an error on the physical layer
235+
reason the CAN interface driver can generate so called Error Message
236+
Frames that can optionally be passed to the user application in the
237+
same way as other CAN frames. Whenever an error on the physical layer
238238
or the MAC layer is detected (e.g. by the CAN controller) the driver
239-
creates an appropriate error frame. Error frames can be requested by
240-
the user application using the common CAN filter mechanisms. Inside
241-
this filter definition the (interested) type of errors may be
242-
selected. The reception of error frames is disabled by default.
243-
The format of the CAN error frame is briefly described in the Linux
244-
header file "include/linux/can/error.h".
239+
creates an appropriate error message frame. Error messages frames can
240+
be requested by the user application using the common CAN filter
241+
mechanisms. Inside this filter definition the (interested) type of
242+
errors may be selected. The reception of error messages is disabled
243+
by default. The format of the CAN error message frame is briefly
244+
described in the Linux header file "include/linux/can/error.h".
245245

246246
4. How to use Socket CAN
247247
------------------------
@@ -383,7 +383,7 @@ solution for a couple of reasons:
383383
defaults are set at RAW socket binding time:
384384

385385
- The filters are set to exactly one filter receiving everything
386-
- The socket only receives valid data frames (=> no error frames)
386+
- The socket only receives valid data frames (=> no error message frames)
387387
- The loopback of sent CAN frames is enabled (see chapter 3.2)
388388
- The socket does not receive its own sent frames (in loopback mode)
389389

@@ -434,7 +434,7 @@ solution for a couple of reasons:
434434
4.1.2 RAW socket option CAN_RAW_ERR_FILTER
435435

436436
As described in chapter 3.4 the CAN interface driver can generate so
437-
called Error Frames that can optionally be passed to the user
437+
called Error Message Frames that can optionally be passed to the user
438438
application in the same way as other CAN frames. The possible
439439
errors are divided into different error classes that may be filtered
440440
using the appropriate error mask. To register for every possible
@@ -527,7 +527,7 @@ solution for a couple of reasons:
527527

528528
rcvlist_all - list for unfiltered entries (no filter operations)
529529
rcvlist_eff - list for single extended frame (EFF) entries
530-
rcvlist_err - list for error frames masks
530+
rcvlist_err - list for error message frames masks
531531
rcvlist_fil - list for mask/value filters
532532
rcvlist_inv - list for mask/value filters (inverse semantic)
533533
rcvlist_sff - list for single standard frame (SFF) entries
@@ -784,13 +784,13 @@ solution for a couple of reasons:
784784
$ ip link set canX type can restart-ms 100
785785

786786
Alternatively, the application may realize the "bus-off" condition
787-
by monitoring CAN error frames and do a restart when appropriate with
788-
the command:
787+
by monitoring CAN error message frames and do a restart when
788+
appropriate with the command:
789789

790790
$ ip link set canX type can restart
791791

792-
Note that a restart will also create a CAN error frame (see also
793-
chapter 3.4).
792+
Note that a restart will also create a CAN error message frame (see
793+
also chapter 3.4).
794794

795795
6.6 Supported CAN hardware
796796

‎include/linux/can.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/* special address description flags for the CAN_ID */
2222
#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
2323
#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
24-
#define CAN_ERR_FLAG 0x20000000U /* error frame */
24+
#define CAN_ERR_FLAG 0x20000000U /* error message frame */
2525

2626
/* valid bits in CAN ID for frame formats */
2727
#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
@@ -32,14 +32,14 @@
3232
* Controller Area Network Identifier structure
3333
*
3434
* bit 0-28 : CAN identifier (11/29 bit)
35-
* bit 29 : error frame flag (0 = data frame, 1 = error frame)
35+
* bit 29 : error message frame flag (0 = data frame, 1 = error message)
3636
* bit 30 : remote transmission request flag (1 = rtr frame)
3737
* bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
3838
*/
3939
typedef __u32 canid_t;
4040

4141
/*
42-
* Controller Area Network Error Frame Mask structure
42+
* Controller Area Network Error Message Frame Mask structure
4343
*
4444
* bit 0-28 : error class mask (see include/linux/can/error.h)
4545
* bit 29-31 : set to zero
@@ -97,7 +97,7 @@ struct sockaddr_can {
9797
* <received_can_id> & mask == can_id & mask
9898
*
9999
* The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
100-
* filter for error frames (CAN_ERR_FLAG bit set in mask).
100+
* filter for error message frames (CAN_ERR_FLAG bit set in mask).
101101
*/
102102
struct can_filter {
103103
canid_t can_id;

‎include/linux/can/error.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* linux/can/error.h
33
*
4-
* Definitions of the CAN error frame to be filtered and passed to the user.
4+
* Definitions of the CAN error messages to be filtered and passed to the user.
55
*
66
* Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
77
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
@@ -12,7 +12,7 @@
1212
#ifndef CAN_ERROR_H
1313
#define CAN_ERROR_H
1414

15-
#define CAN_ERR_DLC 8 /* dlc for error frames */
15+
#define CAN_ERR_DLC 8 /* dlc for error message frames */
1616

1717
/* error class (mask) in can_id */
1818
#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */

‎net/can/af_can.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ static struct dev_rcv_lists *find_dev_rcv_lists(struct net_device *dev)
334334
* relevant bits for the filter.
335335
*
336336
* The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
337-
* filter for error frames (CAN_ERR_FLAG bit set in mask). For error frames
338-
* there is a special filterlist and a special rx path filter handling.
337+
* filter for error messages (CAN_ERR_FLAG bit set in mask). For error msg
338+
* frames there is a special filterlist and a special rx path filter handling.
339339
*
340340
* Return:
341341
* Pointer to optimal filterlist for the given can_id/mask pair.
@@ -347,7 +347,7 @@ static struct hlist_head *find_rcv_list(canid_t *can_id, canid_t *mask,
347347
{
348348
canid_t inv = *can_id & CAN_INV_FILTER; /* save flag before masking */
349349

350-
/* filter for error frames in extra filterlist */
350+
/* filter for error message frames in extra filterlist */
351351
if (*mask & CAN_ERR_FLAG) {
352352
/* clear CAN_ERR_FLAG in filter entry */
353353
*mask &= CAN_ERR_MASK;
@@ -408,7 +408,7 @@ static struct hlist_head *find_rcv_list(canid_t *can_id, canid_t *mask,
408408
* <received_can_id> & mask == can_id & mask
409409
*
410410
* The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
411-
* filter for error frames (CAN_ERR_FLAG bit set in mask).
411+
* filter for error message frames (CAN_ERR_FLAG bit set in mask).
412412
*
413413
* The provided pointer to the sk_buff is guaranteed to be valid as long as
414414
* the callback function is running. The callback function must *not* free
@@ -578,7 +578,7 @@ static int can_rcv_filter(struct dev_rcv_lists *d, struct sk_buff *skb)
578578
return 0;
579579

580580
if (can_id & CAN_ERR_FLAG) {
581-
/* check for error frame entries only */
581+
/* check for error message frame entries only */
582582
hlist_for_each_entry_rcu(r, n, &d->rx[RX_ERR], list) {
583583
if (can_id & r->mask) {
584584
deliver(skb, r);

0 commit comments

Comments
 (0)