mdiobus_modify(9)
π¦ 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β themii_busstruct π like, the actual bus you're messing withaddrβ the phy address πregnumβ register number to write βοΈ the one you're targetingmaskβ bit mask of bits to clear π§Ή these bits get wipedsetβ 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:
__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_read(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_c45_modify(9)mdiobus_modify_changed(9)mdiobus_c45_modify_changed(9)
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
- 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