STRUCT ES581_4_URB_CMD(9)
π 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 nameddo_not_useβ do not use it, bestie, I'm serious π. Instead, use the functionses58x_get_crcandes58x_set_crcto 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.hstructes581_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
- 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