STRUCT CAN_FRAME(9)
π struct can_frame(9) β the Kernel API Manual, but make it cute
okay bestie, welcome to struct can_frame(9) from the Kernel API Manual β¨ this is the page about the Classical CAN frame structure, aka CAN 2.0B β like, the OG CAN frame, the blueprint, the blueprint-that-ate π«Ά
β¨ NAME β¨
struct can_frame β Classical CAN frame structure (aka CAN 2.0B) π
πΈ SYNOPSIS πΈ
here's the whole thing, character for character, no cap:
struct can_frame {
canid_t can_id;
union {
__u8 len;
__u8 can_dlc;
};
__u8 __pad;
__u8 __res0;
__u8 len8_dlc;
__u8 data[CAN_MAX_DLEN];
};
likeβ¦ look at her. iconic. π
π¦ Members π¦
can_idβ the CAN ID of the frame plus theCAN_*_FLAGflags. for the full deets, go look at thecanid_tdefinition π{unnamed_union}β it's an anonymous union, bestie. no name, all main character energy πlenβ CAN frame payload length in byte,0 .. 8β¨can_dlcβ deprecated name for CAN frame payload length in byte,0 .. 8. yeah she's still here, but she's deprecated, so, yk, uselenπ__padβ padding ποΈ__res0β reserved / paddinglen8_dlcβ the optional DLC value (9 .. 15) when the payload length is 8 bytes. so like,len8_dlccontains values from9 .. 15when the payload length is 8 bytes but the DLC value (seeISO 11898-1) is greater then 8. β οΈ important: theCAN_CTRLMODE_CC_LEN8_DLCflag has to be enabled in the CAN driver for this to work, fr fr.dataβ CAN frame payload (up to 8 byte) π
lowkey read the len8_dlc one twice, bestie β the "greater then 8" and the "flag has to be enabled in CAN driver" bits are the whole point π«Ά
π SEE ALSO π
- Kernel file
./include/uapi/linux/can.h struct canfd_frame(9)struct canxl_frame(9)struct sockaddr_can(9)struct can_filter(9)
like, go read them, they're all in the same friend group π
and that's the whole page, bestie! π§ this one lives at ./include/uapi/linux in the kernel tree, from October 2026 β and the page title is struct can_frame(9), in case you forgot already π slay, go forth and parse those frames ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms