STRUCT ES58X_DEVICE(9)
π 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 toes58x_get_tx_urbfor more details.tx_urbs_idle_cntβ number of urbs intx_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 whenes58x_set_realtime_diff_nswas 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 toes58x_can_get_echo_skb. can only be used in RX branches. β οΈnum_can_chβ number of CAN channel (i.e. number of elements ofnetdev).opened_channel_cntβ number of channels opened. free of race conditions because its two users (net_device_ops:ndo_openandnet_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 ofrx_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_devicefunction). 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:
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)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)
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
- 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