mdiobus_modify(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ mdiobus_modify(9) β€” the Kernel API Manual, but make it make sense πŸ’…

okay so bestie, this is mdiobus_modify from the Kernel API Manual, and honestly? it's giving "little helper function that does exactly what it says on the tin" ✨


🌸 NAME 🌸

mdiobus_modify β€” a convenience function for modifying a given mdio device register πŸŽ€

like, it's literally right there in the name. modify. mdio. bus. slay.


✨ SYNOPSIS ✨

int mdiobus_modify (struct mii_bus *bus , int addr , u32 regnum , u16
mask , u16 set );

that's the whole vibe check πŸ‘‘ five args, one int back. no cap.


πŸ’– ARGUMENTS πŸ’–

  • bus β€” the mii_bus struct 🚌 like, the actual bus you're messing with
  • addr β€” the phy address πŸ“
  • regnum β€” register number to write ✍️ the one you're targeting
  • mask β€” bit mask of bits to clear 🧹 these bits get wiped
  • set β€” bit mask of bits to set 🌟 these bits get lit up

so it's mask-then-set, clear-then-set, classic read-modify-write energy fr fr πŸ’…


πŸ”₯ RETURN πŸ”₯

0 on success, negative on any error condition 😭

bestie pls check the return value. negative means something went wrong. do NOT ignore it, i'm begging πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./drivers/net/phy/mdio_bus.c β€” and the whole friend group:

yeah that's a lot of siblings. it's giving big family energy 🫢 iykyk.


anyway that's the page!! go forth and modify your registers responsibly πŸ’œ

okay and before i go β€” this lil masterpiece lives in ./drivers/net/phy, dated October 2026, straight out of the Kernel API Manual. mwah πŸ’‹ see u in the next manpage bestie β­πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from