__phy_modify(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

__phy_modify β€” the convenience function for modifying a PHY register, bestie. That's it, that's the whole vibe. Like, it's literally right there in the name: modify. A register. Conveniently. Slay.

✨ SYNOPSIS ✨

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

πŸŽ€ ARGUMENTS πŸŽ€

  • phydev β€” the phy_device struct, aka the main character of this whole operation. It's your PHY. You gotta hand it over. 🫢
  • regnum β€” the register number to modify. Which register are we messing with? This one. Point at it. πŸ‘‰
  • mask β€” bit mask of bits to clear. Yes bestie, clear. Read that twice. 🧼
  • set β€” the new value of bits set in mask to write to regnum. So whatever bits you flagged in mask, this is the fresh new value they get. ✨

πŸ’€ NOTE πŸ’€

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

Okay so like, this is the part where you do NOT try to be cute and call this from interrupt context. Fr fr. The bus read/write functions might sit there waiting for an interrupt to conclude, and you cannot be doing that inside interrupt context β€” that's the whole problem. Not it. Do not. πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./drivers/net/phy/phy-core.c β€” plus the whole group chat of related functions, all of them, in order, no cap:


And that's the whole page, babe! πŸ¦‹ This lil beauty lives in ./drivers/net/phy, dated October 2026 β€” so go forth, modify those registers, and keep it out of interrupt context. Periodt. πŸ’–πŸ‘‘

πŸ“¦ where this page comes from