mdiobus_c45_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ mdiobus_c45_write(9) ✨

okay so bestie, welcome to the mdiobus_c45_write(9) page from the Kernel API Manual β€” yes that manual, the one we all live in πŸ’…. This is the whole vibe: a lil convenience wrapper for writing a given MII mgmt register. Convenience!! We love a function that exists purely to make your life easier 🫢


🌸 NAME 🌸

mdiobus_c45_write β€” convenience function for writing a given MII mgmt register ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

int mdiobus_c45_write (struct mii_bus *bus , int addr , int devad , u32
regnum , u16 val );

like, that's the whole signature, no cap πŸŽ€


πŸ’– ARGUMENTS πŸ’–

  • bus β€” the mii_bus struct 🚌 (the bus bestie in question)
  • addr β€” the phy address πŸ“
  • devad β€” device address to read πŸ‘€ (yes, "read" β€” that's literally what the manpage says, I'm not gonna gaslight you, keeping it 100 fr fr)
  • regnum β€” register number to write ✍️
  • val β€” value to write to regnum πŸ’Œ

⭐ RETURN ⭐

Zero if successful, negative error code on failure β€” so 0 is your slay outcome, anything negative is the ick 😭


πŸ”₯ NOTE πŸ”₯

MUST NOT be called from interrupt context πŸ’€ β€” because the bus read/write functions may wait for an interrupt to conclude the operation. like it literally has to wait around for an interrupt, so no, you cannot do this from interrupt context, absolutely not, do not even try it πŸ”₯

🌈 SEE ALSO 🌈

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


and that's the page!! 🧚 source path ./drivers/net/phy, dated October 2026, from your fav kernel manual bestie β€” go write that register, icon behavior only πŸ‘‘βœ¨πŸ“

πŸ“¦ where this page comes from