ytphy_modify_ext_with_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ytphy_modify_ext_with_lock β€” like, the manual page, bestie

okay so this is ytphy_modify_ext_with_lock(9) from the Kernel API Manual, and honestly? it's giving "tiny function, huge responsibilities" ✨ she does one thing and she does it well.


🌸 NAME 🌸

ytphy_modify_ext_with_lock β€” the girl who bits-modifies a PHY's extended register πŸŽ€


✨ SYNOPSIS ✨

int ytphy_modify_ext_with_lock (struct phy_device *phydev , u16 regnum ,
u16 mask , u16 set );

like, that's the whole signature, no cap. she takes four things and hands you back an int πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • phydev β€” a pointer to a struct phy_device. yes bestie, it's a pointer, handle her with care 🫢
  • regnum β€” register number to write. this is which register we're messing with πŸ“
  • mask β€” bit mask of bits to clear. the bits you want gone πŸ’€
  • set β€” bit mask of bits to set. the bits you want on πŸ”₯

πŸ‘‘ NOTE πŸ‘‘

so here's the vibe check: this is a convenience function 🧚 it lets you modify a PHY's extended register, and the new register value comes out as:

new register value = (old register value & ~mask) | set

that's the math, that's the whole personality β€” clear the mask bits, then slam in the set bits. iconic honestly.

returns 0 or a negative error code 😭 so like, check your return value, bestie, fr fr.


πŸ’œ SEE ALSO πŸ’œ

she lives in the kernel file ./drivers/net/phy/motorcomm.c, and here's her whole friend group β€” literally all of them:

ytphy_read_ext(9), ytphy_read_ext_with_lock(9), ytphy_write_ext(9), ytphy_write_ext_with_lock(9), ytphy_modify_ext(9), ytphy_get_wol(9), ytphy_set_wol(9), yt8521_read_page(9), yt8521_write_page(9), struct ytphy_cfg_reg_map(9), struct ytphy_ldo_vol_map(9), yt8521_probe(9), ytphy_utp_read_lpa(9), yt8521_adjust_status(9), yt8521_read_status_paged(9), yt8521_read_status(9), yt8521_modify_bmcr_paged(9), yt8521_modify_utp_fiber_bmcr(9), yt8521_soft_reset(9), yt8521_suspend(9), yt8521_resume(9), yt8521_config_init(9), yt8531_link_change_notify(9), yt8521_prepare_fiber_features(9), yt8521_fiber_setup_forced(9), ytphy_check_and_restart_aneg(9), yt8521_fiber_config_aneg(9), ytphy_setup_master_slave(9), ytphy_utp_config_advert(9), ytphy_utp_config_aneg(9), yt8521_config_aneg_paged(9), yt8521_config_aneg(9), yt8521_aneg_done_paged(9), yt8521_aneg_done(9), ytphy_utp_read_abilities(9), yt8521_get_features_paged(9), yt8521_get_features(9), yt8821_get_features(9), yt8821_get_rate_matching(9), yt8821_aneg_done(9), yt8821_serdes_init(9), yt8821_utp_init(9), yt8821_auto_sleep_config(9), yt8821_soft_reset(9), yt8821_config_init(9), yt8821_adjust_status(9), yt8821_update_interface(9), yt8821_read_status(9), yt8821_modify_utp_fiber_bmcr(9), yt8821_suspend(9), yt8821_resume(9)

no I did not skip any of them, I would never πŸ™ˆ


πŸ’‘ reminder: mask clears, set sets, and the return is 0 or negative. don't forget to actually look at it, bestie 😭

mwah πŸ’‹ sending you off with the fine print: this page is from the ./drivers/net/phy source, dated October 2026 β€” and the manual name is ytphy_modify_ext_with_lock(9), in case you were wondering who slayed this hard. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from