__phy_modify_mmd_changed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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 β€” the phy_device struct, your main character of the hour πŸ‘‘
  • devad β€” the MMD that's holding the register you wanna modify
  • regnum β€” the register number you're modifying, the actual address of the whole situation
  • mask β€” the bit mask of the bits you're clearing 🌈
  • set β€” the new value of the bits set in mask, which gets written to regnum

✨ 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 🫢:


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