STRUCT ES581_4_URB_CMD(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

struct es581_4_urb_cmd β€” the little container that holds commands received from or sent to the ES581.4 device. That's it, that's the whole vibe. It's from the Kernel API Manual, and honestly? She's iconic. πŸŽ€


✨ SYNOPSIS

okay bestie, here's the whole struct, laid out exactly like it is, no cap:

struct es581_4_urb_cmd {
    __le16 SOF;
    u8 cmd_type;
    u8 cmd_id;
    __le16 msg_len;
    union {
      struct es581_4_tx_conf_msg tx_conf_msg;
      struct es581_4_bulk_tx_can_msg bulk_tx_can_msg;
      struct es581_4_rx_can_msg rx_can_msg[ES581_4_RX_BULK_MAX];
      struct es581_4_bulk_echo_msg bulk_echo_msg;
      struct es581_4_rx_err_msg rx_err_msg;
      struct es581_4_rx_event_msg rx_event_msg;
      struct es581_4_tx_ack_msg tx_ack_msg;
      struct es581_4_rx_cmd_ret rx_cmd_ret;
      __le64 timestamp;
      u8 rx_cmd_ret_u8;
      u8 raw_msg[];
    };
    __le16 reserved_for_crc16_do_not_use;
 };

look at her. so many fields. so much going on. we love a multi-talented queen πŸ‘‘


🌸 Members

  • SOF β€” Start of Frame. the opening line, the "hey bestie" of the packet πŸ’–
  • cmd_type β€” the Command Type (type: enum es581_4_cmd_type). and lowkey important: the CRC calculation starts at this position. remember that, it comes back later πŸ‘€
  • cmd_id β€” the Command ID (type: enum es581_4_cmd_id). the actual name-tag of which command this is.
  • msg_len β€” Length of the message, excluding CRC β€” so basically the length of the union. not the whole struct, just the union part. don't get it twisted ✨
  • {unnamed_union} β€” it's an anonymous union. no name, all main character energy. she simply doesn't need one πŸ’…
  • tx_conf_msg β€” Channel configuration.
  • bulk_tx_can_msg β€” Tx messages.
  • rx_can_msg β€” Array of Rx messages. not one, an array β€” she's plural πŸ¦‹
  • bulk_echo_msg β€” Tx message being looped back. right back atcha, babe.
  • rx_err_msg β€” Error message. πŸ’€ (we don't gatekeep, errors are content too)
  • rx_event_msg β€” Event message.
  • tx_ack_msg β€” Tx acknowledgment message. the "seen βœ“βœ“" of the kernel world, fr fr.
  • rx_cmd_ret β€” Command return code.
  • timestamp β€” Timestamp reply. ⭐
  • rx_cmd_ret_u8 β€” Rx 8 bits return code (type: enum es58x_cmd_ret_code_u8).
  • raw_msg β€” Message raw payload. just raw vibes, unprocessed, unfiltered 🌈
  • reserved_for_crc16_do_not_use β€” okay so listen πŸ‘€ the structure ends with a CRC16. but the structures in the union above are of variable lengths, so we literally cannot predict the offset of the CRC in advance. that's why this field is named do_not_use β€” do not use it, bestie, I'm serious πŸ™ˆ. Instead, use the functions es58x_get_crc and es58x_set_crc to manipulate it. those are the designated tools, use them, thank you 🫢
⚠️ real talk: that reserved_for_crc16_do_not_use field is named that way for a reason. Variable-length union members mean the CRC offset is a mystery until runtime β€” hence the helper functions. don't go poking it directly, it's giving chaos πŸ’€

πŸ¦‹ SEE ALSO

  • Kernel file ./drivers/net/can/usb/etas_es58x/es581_4.h struct es581_4_tx_conf_msg(9) β€” go read that one next, iykwim πŸ’œ

okay that's the whole page, bestie, you ate that πŸ“ stay slay, stay in ./drivers/net/can/usb/etas_es58x, and remember: this gorgeous little writeup is from the source ./drivers/net/can/usb/etas_es58x, dated October 2026, and it's struct es581_4_urb_cmd(9) in the Kernel API Manual β€” periodt. πŸ§šβ€β™€οΈπŸ’–πŸ”₯

πŸ“¦ where this page comes from