can-utils/include/linux
Oliver Hartkopp c398e56afb 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-11-22 18:41:38 +01:00
..
can can: add optional DLC element to Classical CAN frame structure 2020-11-22 18:41:38 +01:00
can.h can: add optional DLC element to Classical CAN frame structure 2020-11-22 18:41:38 +01:00
errqueue.h include: add errqueue.h, net_tstamp.h, netlink.h 2019-05-09 14:36:53 +02:00
net_tstamp.h include: add errqueue.h, net_tstamp.h, netlink.h 2019-05-09 14:36:53 +02:00
netlink.h Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00