phy_modify_mmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… phy_modify_mmd(9) πŸ’…

Okay bestie, so this is a page from the Kernel API Manual and it's literally about phy_modify_mmd β€” a convenience function for modifying a register on MMD. Yes, that's a lot of M's, no cap, and it's giving "read the register, tweak some bits, write it back" energy and honestly? We're obsessed. πŸ¦‹


✨ SYNOPSIS ✨

int phy_modify_mmd (struct phy_device *phydev , int devad , u32 regnum ,
u16 mask , u16 set );

That's the whole signature, character for character, don't come for me. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • phydev β€” the phy_device struct. Your main character, literally the whole device vibe. 🌸
  • devad β€” the MMD containing the register you wanna modify. Like, which MMD, babe. Pick one. 🎯
  • regnum β€” the register number to modify. The exact spot we're messing with. πŸ“
  • mask β€” bit mask of bits to clear. This is your "not these ones, thank you" list. βœ‚οΈ
  • set β€” the new value of the bits set in mask to write to regnum. So: mask says where, set says what goes there. Iconic duo, honestly. πŸ’–

⚠️ NOTE ⚠️

MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation.

And this one is not a vibe-optional thing, bestie β€” this is a hard MUST NOT. 😭 Like, do not do it. If you're in interrupt context and you call this, the bus read/write functions might just sit there waiting for an interrupt to conclude the operation, and next thing you know it's giving deadlock, not slay. πŸ’€ Keep this one out of interrupt context, fr fr.


πŸ”— SEE ALSO πŸ”—

Kernel file ./drivers/net/phy/phy-core.c β€” and the whole friend group, in this exact order so pls don't @ me:

That's the full squad, all 27 of them, every single one accounted for. 🫢 No one gets left behind on my watch. 🌈


So yeah, that's phy_modify_mmd(9) β€” mask the bits, set the bits, don't do it in interrupt context, and you're golden. 🧚

Big kiss from ./drivers/net/phy, dated October 2026 β€” that's the source/version and the date, all wrapped up in a cute little sign-off, mwah. πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from