STRUCT ES58X_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct es58x_device(9) β€” the Kernel API Manual, bestie edition ✨

okay so you're looking at the struct es58x_device page from the Kernel API Manual, and honestly? it's the whole personality of an ES58X device in one struct. everything specific to one of these lil guys lives in here. let's go πŸŽ€


🌸 NAME 🌸

struct es58x_device β€” literally all the information specific to an ES58X device. every last crumb. no cap πŸ’…


✨ SYNOPSIS ✨

struct es58x_device {
    struct device *dev;
    struct usb_device *udev;
    struct net_device *netdev[ES58X_NUM_CAN_CH_MAX];
    const struct es58x_parameters *param;
    const struct es58x_operators *ops;
    unsigned int rx_pipe;
    unsigned int tx_pipe;
    struct usb_anchor rx_urbs;
    struct usb_anchor tx_urbs_busy;
    struct usb_anchor tx_urbs_idle;
    atomic_t tx_urbs_idle_cnt;
    struct es58x_sw_version firmware_version;
    struct es58x_sw_version bootloader_version;
    struct es58x_hw_revision hardware_revision;
    u64 ktime_req_ns;
    s64 realtime_diff_ns;
    u64 timestamps[ES58X_ECHO_BULK_MAX];
    u8 num_can_ch;
    u8 opened_channel_cnt;
    u16 rx_cmd_buf_len;
    union es58x_urb_cmd rx_cmd_buf;
};

like, look at her. iconic. πŸ‘‘


πŸ¦‹ Members πŸ¦‹

okay so let's meet the cast, field by field:

  • dev β€” device information. the basics, the lore.
  • udev β€” USB device information. yes it's a different device thing, don't come for me.
  • netdev β€” array of our CAN channels. our lil collective πŸ’–
  • param β€” the constant parameters. these do not change, periodt.
  • ops β€” operators.
  • rx_pipe β€” the USB reception pipe.
  • tx_pipe β€” the USB transmission pipe.
  • rx_urbs β€” anchor for received URBs.
  • tx_urbs_busy β€” anchor for TX URBs which were send to the device. (yes, that's "send", it's what the page says, we do not edit the lore 🫢)
  • tx_urbs_idle β€” anchor for TX USB which are idle. so here's the vibe: this driver allocates the memory for the URBs during the probe. when a TX URB is needed, it can be taken from this anchor. and the network queue wake/stop logic should prevent this URB from getting empty β€” that's the whole point, bestie. please refer to es58x_get_tx_urb for more details.
  • tx_urbs_idle_cnt β€” number of urbs in tx_urbs_idle.
  • firmware_version β€” the firmware version number.
  • bootloader_version β€” the bootloader version number.
  • hardware_revision β€” the hardware revision number. wow, numbers. obsessed.
  • ktime_req_ns β€” kernel timestamp when es58x_set_realtime_diff_ns was called.
  • realtime_diff_ns β€” difference in nanoseconds between the clocks of the ES58X device and the kernel. clock math, but make it cute πŸ•°οΈ
  • timestamps β€” a temporary buffer to store the time stamps before feeding them to es58x_can_get_echo_skb. can only be used in RX branches. ⚠️
  • num_can_ch β€” number of CAN channel (i.e. number of elements of netdev).
  • opened_channel_cnt β€” number of channels opened. free of race conditions because its two users (net_device_ops:ndo_open and net_device_ops:ndo_close) guarantee that the network stack big kernel lock (a.k.a. rtnl_mutex) is being hold. (again: "is being hold". we preserve. ✍️)
  • rx_cmd_buf_len β€” length of rx_cmd_buf.
  • rx_cmd_buf β€” the device might split the URB commands in an arbitrary amount of pieces. this buffer is used to concatenate all those pieces. can only be used in RX branches. and listen β€” this field has to be the last one of the structure because it is has a flexible size (c.f. es58x_sizeof_es58x_device function). so do not move her. she needs to be last. the way that flexibility works only at the end… πŸ’€
ngl the recurring theme here is: some of these fields are RX-branch-only, and rx_cmd_buf must be the final field because of its flexible size. respect the layout πŸ™ˆ

🌈 SEE ALSO 🌈

kernel file ./drivers/net/can/usb/etas_es58x/es58x_core.h, plus the whole friend group:


aaaand that's the page!! 🫢 this one came from ./drivers/net/can/usb/etas_es58x and the version dating is October 2026 β€” so yeah, from the future, main character energy fr fr ⭐ bye bestie, go read es58x_get_tx_urb next if you wanna know more about that idle anchor situation πŸŽ€

πŸ“¦ where this page comes from