__phy_modify_mmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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 β€” the phy_device struct. 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 in mask to write to regnum. so like, set only lands where mask says 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:


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