__phy_modify_mmd(9)
π __phy_modify_mmd(9) β Kernel API Manual, but make it make sense
okay bestie, so this one lives in the Kernel API Manual (yes, that manual, the big scary one) and it's literally your new fave convenience function for tweaking a register on an MMD. One register. One vibe check. Slay. π
β¨ NAME β¨
__phy_modify_mmd β a convenience function for modifying a register on MMD π¦
(it's giving "little helper that does the read-modify-write so you don't have to", and honestly? iconic.)
πΈ SYNOPSIS πΈ
int __phy_modify_mmd (struct phy_device *phydev , int devad , u32 regnum
, u16 mask , u16 set );
not me showing you the exact signature, character for character, because we do not freelance the types around here π
π ARGUMENTS π
phydevβ thephy_devicestruct. the main character, fr fr.devadβ the MMD containing the register you wanna modify. that's its whole job.regnumβ the register number to modify. yes, this one.maskβ the bit mask of bits to clear. think of it as the "which bits are we touching" list.setβ the new value of the bits set inmaskto write toregnum. so like,setonly lands wheremasksays it can. teamwork π
β οΈ NOTE β οΈ
MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation. π¨
like, genuinely do not. the bus functions might be sitting there waiting on an interrupt to finish, and if you're inside interrupt context when that happens you're gonna have a bad time. no cap. this is one of those "read the warning, bestie" moments π
π«Ά SEE ALSO π«Ά
Kernel file ./drivers/net/phy/phy-core.c, plus the whole squad β every single one, no skips, we don't leave anyone out of the group chat:
phy_speed_to_str(9)phy_duplex_to_str(9)phy_rate_matching_to_str(9)phy_fix_phy_mode_for_mac_delays(9)phy_interface_num_ports(9)phy_set_max_speed(9)of_set_phy_timing_role(9)phy_resolve_aneg_pause(9)phy_resolve_aneg_linkmode(9)phy_check_downshift(9)__phy_read_mmd(9)phy_read_mmd(9)__phy_write_mmd(9)phy_write_mmd(9)phy_modify_changed(9)__phy_modify(9)phy_modify(9)__phy_modify_mmd_changed(9)phy_modify_mmd_changed(9)phy_modify_mmd(9)phy_save_page(9)phy_select_page(9)phy_restore_page(9)phy_read_paged(9)phy_write_paged(9)phy_modify_paged_changed(9)phy_modify_paged(9)
and that's the whole page, bestie π§ sign-off time: this one's from ./drivers/net/phy, dated October 2026, and it's __phy_modify_mmd(9) β go forth and modify those MMD registers responsibly πβ¨
π¦ 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