__phy_modify_mmd_changed(9)
π
__phy_modify_mmd_changed(9) β from the Kernel API Manual, bestie π
okay so picture this: you're deep in the kernel, you're in the Kernel API Manual, and you've stumbled onto __phy_modify_mmd_changed. Bestie. This is the unlocked little helper that lets you poke at a register inside an MMD β¨. Let's get into it, no cap.
πΈ NAME πΈ
__phy_modify_mmd_changed β the function for modifying a register on MMD. That's literally what it does, and it ate π
π¦ SYNOPSIS π¦
int __phy_modify_mmd_changed (struct phy_device *phydev , int devad ,
u32 regnum , u16 mask , u16 set );
like yes, that's the whole signature, copy it exactly if you're typing it out, iykyk π«Ά
π ARGUMENTS π
phydevβ thephy_devicestruct, your main character of the hour πdevadβ the MMD that's holding the register you wanna modifyregnumβ the register number you're modifying, the actual address of the whole situationmaskβ the bit mask of the bits you're clearing πsetβ the new value of the bits set inmask, which gets written toregnum
β¨ DESCRIPTION β¨
So this is an unlocked helper function (yes, unlocked, as in it doesn't do the locking for you, keep that in mind bestie π) and it lets you modify an MMD register like this:
new register value = (old register value & ~mask) | set
That's the whole vibe: mask off the bits you don't want, OR in the fresh ones, slay π
As for what you get back β it returns a negative errno, or 0 if there was literally no change, or 1 in case of a change. So yeah, that return value is doing a lil three-way thing and you should def check it fr fr π₯
π SEE ALSO π
The kernel file lives at ./drivers/net/phy/phy-core.c, and honestly the whole friend group is here, go say hi π«Ά:
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(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 π this lil legend comes from ./drivers/net/phy and the version is dated October 2026 β go forth and modify those MMD registers responsibly, mwah π§ββοΈπ
π¦ 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