mdiobus_read(9)
π mdiobus_read π
hey bestie!! welcome to the mdiobus_read(9) page from the Kernel API Manual β yes that manual, the one with the good stuff in it π this one is basically a lil convenience wrapper for reading a given MII mgmt register and honestly? she's iconic for it β¨
πΈ SYNOPSIS πΈ
int mdiobus_read (struct mii_bus *bus , int addr , u32 regnum );
ok so three things go in, one int comes out, no cap π
π¦ ARGUMENTS π¦
busβ themii_busstruct, aka the bus you're doing all this on πaddrβ the phy address, like the little home address of the phy you're talking to π‘regnumβ register number to read, the exact spot you're peeking at π
β RETURN β
The register value if successful, negative error code on failure π so like... good vibes means you get your number back, bad vibes means negative error code, and you should fr fr check for that negative before you start celebrating π«Ά
π NOTE π
MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation. π¨
not me emphasizing this β it's literally in all caps in the original, so it's serious serious. interrupt context is not the vibe here, bestie. she needs to wait, and waiting inside an interrupt is a no π
π SEE ALSO π
get into it, this whole friend group is listed under Kernel file ./drivers/net/phy/mdio_bus.c π
__mdiobus_read(9)__mdiobus_write(9)__mdiobus_modify_changed(9)__mdiobus_c45_read(9)__mdiobus_c45_write(9)__mdiobus_c45_modify_changed(9)mdiobus_read_nested(9)mdiobus_c45_read(9)mdiobus_c45_read_nested(9)mdiobus_write_nested(9)mdiobus_write(9)mdiobus_c45_write(9)mdiobus_c45_write_nested(9)mdiobus_modify(9)mdiobus_c45_modify(9)mdiobus_modify_changed(9)mdiobus_c45_modify_changed(9)
the way there are so many of them and every single one ate π the C45 ones especially, iykyk π
ok that's the whole page, go read your registers responsibly πβ¨
from ./drivers/net/phy, dated October 2026 β mwah, xoxo, your girl mdiobus_read(9) ππ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms