lan937x_mdio_register(9)
π 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 π₯
0on success π- a negative error code on failure π
like yes we're rooting for the 0, but be prepared for the negative, ngl.
π SEE ALSO π
- Kernel file
./drivers/net/dsa/microchip/lan937x_main.cβ go read it, iykyk π lan937x_create_phy_addr_map(9)lan937x_mdio_bus_preinit(9)
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
- 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