ethtool_lin...st_link_mode(9)
π
ethtool_link_ksettings_test_link_mode β Kernel API Manual β¨
okay so bestie, welcome to the Kernel API Manual, and today's main character is a tiny little helper from ethtool land that just peeks at one single bit and tells you if it's lit or not. no cap, that's the whole vibe. it's giving "small but mighty" π
πΈ NAME πΈ
ethtool_link_ksettings_test_link_mode β test a bit in the ksettings link mode mask π¦
β¨ SYNOPSIS β¨
ethtool_link_ksettings_test_link_mode (ptr , name , mode );
π ARGUMENTS π
ptrβ a pointer tostruct ethtool_link_ksettings, like, the ksettings thing itself. hand it over and it'll go look inside π«Άnameβ which mask we're digging around in, and it's one ofsupported/advertising/lp_advertising. pick your fighter πmodeβ one of theETHTOOL_LINK_MODE_*_BITvalues. and listen π¨ this one is not atomic and there's no bound checking, so nobody's holding your hand here, bestie β you gotta know your indices are valid, fr fr π
π RETURN π
true / false β literally just "yep that bit's set" or "nope, it's not." binary queen behavior π
π₯ SEE ALSO π₯
kernel file ./include/linux/ethtool.h β and omg the friend group is HUGE, look at all of them:
enum ethtool_phys_id_state(9)struct kernel_ethtool_ringparam(9)enum ethtool_supported_ring_param(9)ethtool_rxfh_indir_default(9)struct ethtool_rxfh_context(9)ethtool_link_ksettings_zero_link_mode(9)ethtool_link_ksettings_add_link_mode(9)ethtool_link_ksettings_del_link_mode(9)ethtool_intersect_link_masks(9)struct ethtool_phy_stats(9)struct ethtool_pause_stats(9)struct ethtool_fec_hist_range(9)struct ethtool_fec_stats(9)struct ethtool_rmon_hist_range(9)struct ethtool_rmon_stats(9)struct ethtool_ts_stats(9)struct ethtool_module_eeprom(9)struct ethtool_module_power_mode_params(9)struct ethtool_mm_state(9)struct ethtool_mm_cfg(9)struct ethtool_mm_stats(9)struct ethtool_mmsv_ops(9)struct ethtool_mmsv(9)struct ethtool_rxfh_param(9)struct ethtool_rxfh_fields(9)struct kernel_ethtool_ts_info(9)struct ethtool_ops(9)struct ethtool_netdev_state(9)struct ethtool_phy_ops(9)ethtool_set_ethtool_phy_ops(9)ethtool_params_from_link_mode(9)ethtool_get_phc_vclocks(9)ethtool_mm_frag_size_add_to_min(9)ethtool_mm_frag_size_min_to_add(9)ethtool_get_ts_info_by_layer(9)ethtool_sprintf(9)ethtool_puts(9)ethtool_cpy(9)
like, that's the whole roster β every single one of them, no gatekeeping π
and that's the page!! short, sweet, and lowkey iconic. this came out of the ./include/linux corner of the kernel and it's dated October 2026 β so go check your link mode bits, bestie, and slay β¨ππ¦πΈπ
π¦ 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