can-utils/include/linux/can
Oliver Hartkopp 1845141208 can: add optional DLC element to Classical CAN frame structure
ISO 11898-1 Chapter 8.4.2.3 defines a 4 bit data length code (DLC) table which
maps the DLC to the payload length of the CAN frame in bytes:

    DLC      ->  payload length
    0 .. 8   ->  0 .. 8
    9 .. 15  ->  8

Although the DLC values 8 .. 15 in Classical CAN always result in a payload
length of 8 bytes these DLC values are transparently transmitted on the CAN
bus. As the struct can_frame only provides a 'len' element (formerly 'can_dlc')
which contains the plain payload length ( 0 .. 8 ) of the CAN frame, the raw
DLC is not visible to the application programmer, e.g. for testing use-cases.

To access the raw DLC values 9 .. 15 the len8_dlc element is introduced, which
is only valid when the payload length 'len' is 8 and the DLC is greater than 8.

The len8_dlc element is filled by the CAN interface driver and used for CAN
frame creation by the CAN driver when the CAN_CTRLMODE_CC_LEN8_DLC flag is
supported by the driver and enabled via netlink configuration interface.

Reported-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2020-10-29 15:25:30 +01:00
..
bcm.h include: import header files from kernel v5.4-rc7 2019-11-12 08:59:58 +01:00
error.h include: import header files from kernel v5.4-rc7 2019-11-12 08:59:58 +01:00
gw.h include: import header files from kernel v5.4-rc7 2019-11-12 08:59:58 +01:00
isotp.h includes: update to Linux 5.10 include files 2020-10-14 09:28:22 +02:00
j1939.h include: import header files from kernel v5.4-rc7 2019-11-12 08:59:58 +01:00
netlink.h can: add optional DLC element to Classical CAN frame structure 2020-10-29 15:25:30 +01:00
raw.h includes: update to Linux 5.10 include files 2020-10-14 09:28:22 +02:00
vxcan.h include: import header files from kernel v5.4-rc7 2019-11-12 08:59:58 +01:00