STRUCT ES58X_PRIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct es58x_priv(9) β€” bestie's guide to the private struct πŸ’…

Okay so welcome to struct es58x_priv(9), the kernel API manual page that's literally all about one thing: the struct that holds every single thing specific to a CAN channel. Yes queen, the whole vibe of this page is "one channel, one struct, no cap" πŸ’–


🌸 NAME 🌸

struct es58x_priv β€” All information specific to a CAN channel. That's it, that's the name, and she ate πŸ’…


✨ SYNOPSIS ✨

Here's the whole glow-up, character for character, because we do NOT paraphrase code in this house 🫢

struct es58x_priv {
    struct can_priv can;
    struct devlink_port devlink_port;
    struct es58x_device *es58x_dev;
    struct urb *tx_urb;
    u32 tx_tail;
    u32 tx_head;
    u8 tx_can_msg_cnt;
    bool tx_can_msg_is_fd;
    u8 err_passive_before_rtx_success;
    u8 channel_idx;
 };

πŸŽ€ Members πŸŽ€

Okay this is the main character section, the member-by-member breakdown. Grab a snack πŸ“

  • can β€” a struct can_priv and it must be the first member. Why? Because Socket CAN relies on the fact that the function netdev_priv returns a pointer to a struct can_priv. So like, position matters, it's giving first-born energy πŸ‘‘
  • devlink_port β€” the devlink instance for the network interface. That's her whole job πŸ’β€β™€οΈ
  • es58x_dev β€” pointer to the corresponding ES58X device. Yep, just a pointer back home 🏠
  • tx_urb β€” used as a buffer to concatenate the TX messages and to do a bulk send. Please refer to es58x_start_xmit for more details, iykyk πŸ”₯
  • tx_tail β€” index of the oldest packet still pending for completion. tx_tail & echo_skb_mask represents the beginning of the echo skb FIFO, i.e. index of the first element. So basically the start of the queue, no cap πŸ¦‹
  • tx_head β€” index of the next packet to be sent to the device. tx_head & echo_skb_mask represents the end of the echo skb FIFO plus one, i.e. the first free index. Slay, that's the next open seat 🌈
  • tx_can_msg_cnt β€” number of messages in tx_urb. Simple, iconic, counting queen πŸ’œ
  • tx_can_msg_is_fd β€” false: all messages in tx_urb are Classical CAN, true: all messages in tx_urb are CAN FD. And the rationale (yes she has lore): ES58X FD devices do not allow to mix Classical CAN and FD CAN frames in one single bulk transmission. So like, pick a lane bestie 🚫🧚
  • err_passive_before_rtx_success β€” okay so the ES58X device might enter in a state in which it keeps alternating between error passive and active states. This counter keeps track of the number of error passive and if it gets bigger than ES58X_CONSECUTIVE_ERR_PASSIVE_MAX, es58x_rx_err_msg will force the status to bus-off. Ma'am, that's a lot, but it's important 😭
Ngl, that last one is the dramatic member of the struct. She's out here flipping between states and if she goes past ES58X_CONSECUTIVE_ERR_PASSIVE_MAX it's straight to bus-off. The audacity πŸ’€
  • channel_idx β€” channel index, starts at zero. Zero-based indexing, periodt 🎯

πŸ”₯ SEE ALSO πŸ”₯

The whole friend group, linked below, and yes I'm listing every single one because we don't do "etc." in this group chat ✨

Kernel file ./drivers/net/can/usb/etas_es58x/es58x_core.h plus 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_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_len(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). Tag them all, they deserve it πŸ«ΆπŸ’–


πŸŽ€ Cute little sign-off time πŸŽ€: this whole glow-up lives under ./drivers/net/can/usb/etas_es58x, and the page itself is dated October 2026, with the manual name living its best life as struct es58x_priv(9). Anyway, go read es58x_start_xmit and stay hydrated bestie πŸ¦‹πŸ’œβ­
πŸ“¦ where this page comes from