ksz_mdio_register(9)
π ksz_mdio_register(9) β the kernel API manual, but make it make sense
okay so bestie, welcome to ksz_mdio_register(9), straight out of the Kernel API Manual. this is the one that gets your KSZ device's MDIO bus living its best life β¨
β¨ NAME β¨
ksz_mdio_register β register and configure the MDIO bus for the KSZ device. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
int ksz_mdio_register (struct ksz_device *dev );
yeah, one argument. one. we love a low-effort signature π
π¦ ARGUMENTS π¦
devβ pointer to thestruct ksz_devicestructure. this is the KSZ device in question, the main character of the function, hand it over and let it cook π«Ά
π DESCRIPTION π
so what does this actually do? it sets up and registers an MDIO bus for the KSZ switch device, which is the whole point β that bus is how you get access to the device's internal PHYs. no bus, no PHY access, no slay. π
here's the tea though: the behaviour forks depending on your hardware. if the device supports side MDIO, the function configures the external MDIO controller β the one specified by the "mdio-parent-bus" device tree property β so it directly manages the internal PHYs. iconic delegation, honestly. π
otherwise? if side MDIO isn't a thing for your device, it sets up SPI or I2C access for PHY access instead. different route, same destination. lowkey flexible of it π
π₯ RETURN π₯
0on success π- a negative error code on failure π (yes it's negative, no we're not elaborating, that's the deal)
π SEE ALSO π
the kernel file, in case you wanna go read the source like the academic weapon you are:
./drivers/net/dsa/microchip/ksz_common.c
and the whole friend group of related calls, fr fr:
ksz_phylink_mac_disable_tx_lpi(9)ksz_phylink_mac_enable_tx_lpi(9)ksz_update_port_member(9)ksz_parent_mdio_read(9)ksz_parent_mdio_write(9)ksz_phy_addr_to_port(9)ksz_irq_phy_setup(9)ksz_irq_phy_free(9)ksz_parse_dt_phy_config(9)ksz_handle_wake_reason(9)ksz_is_port_mac_global_usable(9)ksz_get_wol(9)ksz_set_wol(9)ksz_wol_pre_shutdown(9)ksz_switch_macaddr_get(9)ksz_switch_shutdown(9)ksz_drive_strength_to_reg(9)ksz_drive_strength_error(9)ksz_drive_strength_write(9)
no cap, that's a lot of see-alsos. read them all or don't, but they're there for you bestie π
and that's the page!! π this gem came out of ./drivers/net/dsa/microchip, dated October 2026 β so yeah, mark your calendar, the future is already here. stay hydrated, go register a bus, mwah π
π¦ 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