can_frame_bits(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… can_frame_bits β€” a kernel API manual, but make it make sense

okay so bestie, welcome to the can_frame_bits(9) glow-up ✨ this little icon lives in the Kernel API Manual, and its whole job is honestly so real of it: it calculates the number of bits on the wire in a CAN frame. that's it. that's the gig. no cap. πŸŽ€


✨ SYNOPSIS ✨

can_frame_bits (is_fd , is_eff , bitstuffing , intermission , data_len );

like, five args, all vibes, all important. let's meet them 🫢


🌸 ARGUMENTS 🌸

  • is_fd β€” drop a true here if we're talking CAN-FD frame, or false if it's a Classical CAN frame. pick your era bestie πŸ’…
  • is_eff β€” true means Extended frame, false means Standard frame. extended is giving main character energy, standard is giving classic icon, both slay.
  • bitstuffing β€” true = calculate the bitstuffing worst case 😭 false = calculate the bitstuffing best case (aka no dynamic bitstuffing). and listen, CAN-FD's fixed stuff bits are always included no matter which one you pick β€” them bits are non-negotiable, periodt. ⭐
  • intermission β€” if and only if this is true, include the inter frame space assuming no bus idle (so like, only the intermission). lowkey important caveat: strictly speaking, the inter frame space is not part of the frame. but bestie, you still need it when you're calculating the delay between the Start Of Frame of two consecutive frames. iykyk πŸ¦‹
  • data_len β€” length of the data field, in bytes. this corresponds to can(fd)_frame->len. should be zero for remote frames. also heads up: no sanitization is done on data_len and it shall have no side effects. so like, it trusts you completely, don't betray it πŸ™ˆ

πŸ’– RETURN πŸ’–

the numbers of bits on the wire of a CAN frame. that's the whole return value, queen. go off. πŸ‘‘


🌈 SEE ALSO 🌈


ngl, if you're computing delays between consecutive frames and you forgot intermission, the vibes will be off and the math will be off too. just saying. πŸ’€

and that's the page!! this one ships out of ./include/linux/can, dated October 2026, and it's can_frame_bits(9) all day every day 🧚 mwah, go read the source, ily, bye!! πŸ’œ

πŸ“¦ where this page comes from