mdiobus_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

mdiobus_write β€” bestie, it's literally the convenience function for writing a given MII mgmt register. That's the whole vibe. ✨

This is the mdiobus_write(9) page from the Kernel API Manual, and we're gonna make it make sense. πŸ’–


✨ SYNOPSIS ✨

Here's the exact signature, no cap:

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

πŸŽ€ ARGUMENTS πŸŽ€

  • bus β€” the mii_bus struct.
  • addr β€” the phy address.
  • regnum β€” register number to write.
  • val β€” value to write to regnum.

πŸ’– RETURN πŸ’–

Zero if successful, negative error code on failure. So 0 is the slay outcome, and a negative number means something went sideways 😭.


⚠️ NOTE ⚠️

MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation. This is not a drill, bestie β€” interrupt context is a hard no πŸ’€.

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./drivers/net/phy/mdio_bus.c is where this lives, and the related squad is:


Okay that's the whole page, bestie 🫢 β€” source/version path ./drivers/net/phy, dated October 2026, and yes, it's the mdiobus_write(9) manual page. Periodt. πŸ’…

πŸ“¦ where this page comes from