1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 05:53:49 +01:00
Gilles DOFFE ae51a22fbb can: use frame len instead of can_dlc
RIOT implementation of CAN bus relies on SocketCAN model.
Since commit c398e56 (can: add optional DLC element to Classical CAN
frame structure), '__u8 can_dlc' attribute of struct can_frame is
considered as deprecated in SocketCAN and kept for legacy support.
Attribute '__u8 len' should be used instead.

	union {
		/* CAN frame payload length in byte (0 .. CAN_MAX_DLEN)
		 * was previously named can_dlc so we need to carry that
		 * name for legacy support
		 */
		__u8 len;
		__u8 can_dlc; /* deprecated */
	};

Moreover, CAN FD frame structure does not support legacy attribute
'can_dlc', making 'len' mandatory for incoming CAN FD support in RIOT.

	struct canfd_frame {
		canid_t can_id;  /* 32 bit CAN_ID + EFF/RTR/ERR flags */
		__u8    len;     /* frame payload length in byte */
		__u8    flags;   /* additional flags for CAN FD */
		__u8    __res0;  /* reserved / padding */
		__u8    __res1;  /* reserved / padding */
		__u8    data[CANFD_MAX_DLEN]
__attribute__((aligned(8)));
	};

Signed-off-by: Gilles DOFFE <gilles.doffe@rtone.fr>
2025-01-29 20:51:22 +01:00
..
2022-02-21 10:49:43 +01:00
2022-02-21 10:49:43 +01:00
2025-01-29 20:51:22 +01:00
2024-01-29 14:44:10 -05:00
2023-07-26 09:02:10 +02:00
2024-07-08 11:18:57 +02:00
2024-01-29 14:44:10 -05:00
2024-03-29 10:19:42 +01:00
2020-10-23 00:46:26 +02:00
2024-03-29 10:19:42 +01:00
2020-10-23 00:46:26 +02:00
2024-03-01 11:18:18 +01:00
2022-02-21 10:49:43 +01:00
2020-10-23 11:29:57 +02:00