STRUCT ETHTOOL_REGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct ethtool_regs(9) πŸŽ€

okay so this is a page from the Kernel API Manual and it's literally all about struct ethtool_regs β€” the hardware register dump struct. it's giving "backstage pass to your NIC's brain" energy and honestly? iconic. let's get into it bestie πŸ’…


✨ NAME ✨

struct ethtool_regs β€” hardware register dump 🫢


🌸 SYNOPSIS 🌸

struct ethtool_regs {
    __u32 cmd;
    __u32 version;
    __u32 len;
    __u8 data[];
 };

look at her. four fields. one flexible array member. she's perfect, no notes πŸ’–


πŸ¦‹ Members πŸ¦‹

  • cmd β€” the command number, and it equals ETHTOOL_GREGS. that's it, that's the whole vibe. she knows what she is πŸ‘‘
  • version β€” the dump format version. this one's driver-specific and it may distinguish different chips/revisions. and listen, this part is a hard rule, not a suggestion: drivers must use new version numbers whenever the dump format changes in an incompatible way. no cap, if you break the format you bump the number. periodt. πŸ”₯
  • len β€” sneaky little dual-purpose field, love that for her. on entry it's the real length of data, and on return it's the number of bytes used. so it goes in as a question and comes back as an answer, main character energy fr fr 🌈
  • data β€” the buffer for the register dump. that's where the actual register juice lives πŸ§ƒ

πŸ’œ Description πŸ’œ

so if you're a userspace bestie trying to read a register dump, here's the tea: use ETHTOOL_GDRVINFO to find the maximum length of a register dump for the interface. πŸ”

then β€” and this is the important bit β€” you must allocate the buffer immediately following this structure. like, right after it. no gaps, no drama, just data living its best life directly after the struct πŸ™ˆ


⭐ SEE ALSO ⭐

kernel file ./include/uapi/linux/ethtool.h , plus the whole extended friend group:

  • struct ethtool_cmd(9)
  • struct ethtool_drvinfo(9)
  • struct ethtool_wolinfo(9)
  • struct ethtool_eeprom(9)
  • struct ethtool_eee(9)
  • struct ethtool_modinfo(9)
  • struct ethtool_coalesce(9)
  • struct ethtool_ringparam(9)
  • struct ethtool_channels(9)
  • struct ethtool_pauseparam(9)
  • enum ethtool_stringset(9)
  • enum ethtool_mac_stats_src(9)
  • enum ethtool_module_power_mode_policy(9)
  • enum ethtool_module_power_mode(9)
  • enum ethtool_c33_pse_ext_state(9)
  • enum ethtool_c33_pse_ext_substate_mr_mps_valid(9)
  • enum ethtool_c33_pse_ext_substate_error_condition(9)
  • enum ethtool_c33_pse_ext_substate_mr_pse_enable(9)
  • enum ethtool_c33_pse_ext_substate_option_detect_ted(9)
  • enum ethtool_c33_pse_ext_substate_option_vport_lim(9)
  • enum ethtool_c33_pse_ext_substate_ovld_detected(9)
  • enum ethtool_c33_pse_ext_substate_power_not_available(9)
  • enum ethtool_c33_pse_ext_substate_short_detected(9)
  • enum ethtool_pse_types(9)
  • enum ethtool_c33_pse_admin_state(9)
  • enum ethtool_c33_pse_pw_d_status(9)
  • enum ethtool_podl_pse_admin_state(9)
  • enum ethtool_podl_pse_pw_d_status(9)
  • enum ethtool_mm_verify_status(9)
  • enum ethtool_module_fw_flash_status(9)
  • struct ethtool_gstrings(9)
  • struct ethtool_sset_info(9)
  • enum ethtool_test_flags(9)
  • struct ethtool_test(9)
  • struct ethtool_stats(9)
  • struct ethtool_perm_addr(9)
  • struct ethtool_tcpip4_spec(9)
  • struct ethtool_ah_espip4_spec(9)
  • struct ethtool_usrip4_spec(9)
  • struct ethtool_tcpip6_spec(9)
  • struct ethtool_ah_espip6_spec(9)
  • struct ethtool_usrip6_spec(9)
  • struct ethtool_flow_ext(9)
  • struct ethtool_rx_flow_spec(9)
  • struct ethtool_rxnfc(9)
  • struct ethtool_rxfh_indir(9)
  • struct ethtool_rxfh(9)
  • struct ethtool_rx_ntuple_flow_spec(9)
  • struct ethtool_rx_ntuple(9)
  • struct ethtool_dump(9)
  • struct ethtool_get_features_block(9)
  • struct ethtool_gfeatures(9)
  • struct ethtool_set_features_block(9)
  • struct ethtool_sfeatures(9)
  • struct ethtool_ts_info(9)
  • struct ethtool_per_queue_op(9)
  • struct ethtool_fecparam(9)
  • enum ethtool_fec_config_bits(9)
  • struct ethtool_link_settings(9)
  • enum phy_upstream(9)

like I said. big friend group. everyone's invited to the group chat πŸ’€πŸ’–


and that's the whole page bestie, go forth and dump those registers responsibly 🧚

sourced from ./include/uapi/linux, dated October 2026 β€” mwah, sending you a forehead kiss, bye πŸ’‹βœ¨
πŸ“¦ where this page comes from