es58x_check_msg_len(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ es58x_check_msg_len ✨

okay so real talk, this one lives in the Kernel API Manual and it's literally just the vibe check for your CAN messages πŸ’… like it's not deep, it's just making sure the message you got is exactly the size it said it was gonna be. no notes. iconic.


πŸŽ€ NAME πŸŽ€

es58x_check_msg_len β€” check the size of a received message. that's it. that's the whole job. queen of boundaries fr fr πŸ¦‹


🌸 SYNOPSIS 🌸

es58x_check_msg_len (dev , msg , actual_len );

yes bestie, keep the spaces exactly like that, it's a macro thing, iykyk πŸ’€


πŸ’– ARGUMENTS πŸ’–

  • dev β€” the device 🫢 it's only here so we can print error messages when stuff goes wrong. emotional support device, basically.
  • msg β€” the received message. and listen, this one matters: it must not be a pointer ⚠️ like, not a pointer. don't do it. i'm serious πŸ™ˆ
  • actual_len β€” the length of the message as advertised in the command header. so this is what the message claims about itself. we're fact-checking it. πŸ”₯

🌈 DESCRIPTION 🌈

okay so first thing: this must be a macro. why? because it has to accept the different types of messages as an input, and a regular function just can't do that for you, sorry babe 😭

it can be used with any of the messages that have a fixed length β€” those are its people, its main character messages πŸ‘‘

and what does it actually do? it checks for an exact match of the size. not "close enough", not "roughly", not "vibes are right". exact. match. periodt πŸ’…


⭐ RETURN ⭐

  • zero on success πŸŽ‰ slay, the size was correct, we move
  • -EMSGSIZE if actual_len differs from the expected length πŸ’€ yeah that's a fail, the message lied about its length, we're calling it out

πŸ¦‹ SEE ALSO πŸ¦‹

okay bestie, this list is long but every single one of these is part of the family, so here we go:

kernel file ./drivers/net/can/usb/etas_es58x/es58x_core.h, enum es58x_driver_info(9), enum es58x_physical_layer(9), enum es58x_sync_edge(9), enum es58x_flag(9), enum es58x_err(9), enum es58x_event(9), struct es58x_priv(9), struct es58x_parameters(9), struct es58x_operators(9), struct es58x_sw_version(9), struct es58x_hw_revision(9), struct es58x_device(9), es58x_sizeof_es58x_device(9), es58x_check_msg_max_len(9), es58x_msg_num_element(9), es58x_priv(9), ES58X_SIZEOF_URB_CMD(9), es58x_get_urb_cmd_len(9), es58x_get_netdev(9), es58x_get_raw_can_id(9), es58x_get_flags(9)


ngl the -EMSGSIZE thing is the whole personality of this macro. check your lengths, bestie. πŸ“

and that's the page!! mwah πŸ’‹ this little writeup lives in ./drivers/net/can/usb/etas_es58x, dated October 2026, and it's filed under es58x_check_msg_len(9) β€” periodt, go check your message sizes, ily bye πŸ§šπŸ’œ

πŸ“¦ where this page comes from