lan937x_mdio_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… lan937x_mdio_register(9) β€” Kernel API Manual ✨

okay so bestie, welcome to the lan937x_mdio_register page from the Kernel API Manual, and no cap this one is actually kinda iconic β€” it's the function that gets the MDIO bus for the LAN937x switch up and running πŸ¦‹


🌸 NAME 🌸

lan937x_mdio_register β€” literally the function that registers and configures the MDIO bus for the LAN937x. Register it and configure it, she does both πŸ’…


✨ SYNOPSIS ✨

int lan937x_mdio_register (struct ksz_device *dev );

like that's the whole vibe. one argument. returns an int. slay πŸŽ€


🫢 ARGUMENTS 🫢

  • dev β€” pointer to the KSZ device structure. that's it. that's the whole argument. main character energy tbh πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜• β€” this function sets up and registers an MDIO bus for a LAN937x switch, which is what gives you access to its internal PHYs. very "doing the most so you can talk to your own hardware" of it.

now here's the branching part, pay attention bestie πŸ‘€ β€” if the device supports side MDIO, the function goes ahead and configures the external MDIO controller that's specified by the "mdio-parent-bus" device tree property, so that it can directly manage the internal PHYs. iconic, effortless, external controller doing the work 🧚

otherwise β€” no side MDIO for you, sadly 😭 β€” SPI or I2C access is set up for PHY access instead. still working, just a different route. we love a fallback fr fr πŸ’œ


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸ’–
  • a negative error code on failure 😭

like yes we're rooting for the 0, but be prepared for the negative, ngl.


🌈 SEE ALSO 🌈

all three are giving "you should probably look at these next" energy, so go look at them πŸ’«


okay that's the whole page bestie, hope it ate πŸ“ β€” this lil masterpiece lives in ./drivers/net/dsa/microchip, dated October 2026, and it's the lan937x_mdio_register(9) page, so like... you're welcome πŸ’…βœ¨

πŸ“¦ where this page comes from