stmmac_mdio_setup(9)
πΈ stmmac_mdio_setup(9) πΈ
okay bestie, welcome to the Kernel API Manual β¨ today's main character is stmmac_mdio_setup(9), and it's literally the function that populates platform related MDIO structures so your ethernet driver can find its PHY. it's giving matchmaker-for-hardware and honestly? iconic π
β¨ NAME β¨
stmmac_mdio_setup β Populate platform related MDIO structures. (yep, that's the whole job, and it ate)
π SYNOPSIS π
int stmmac_mdio_setup (struct plat_stmmacenet_data *plat , struct device_node *np , struct device *dev );
π ARGUMENTS π
platβ the driver data platform structure, aka your platform data bestienpβ the devicetree node, iykyk π³devβ the device pointer, the device in question
π DESCRIPTION π
so here's the tea: this one searches for MDIO information from the devicetree π If an MDIO node is found, it's assigned to plat->mdio_node and plat->mdio_bus_data is allocated. If no connection can be determined, then just plat->mdio_bus_data is allocated, to indicate a bus should be created and scanned for a phy. And if it's determined that there's no MDIO bus needed? both are left NULL. periodt. π
β οΈ heads-up bestie: this expects that plat->phy_node has already been searched for. so like, do that first, don't skip steps π
π« RETURN π«
0 on success, errno otherwise. that's it, that's the vibe β¨
π¦ SEE ALSO π¦
Kernel file: ./drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
and the whole friend group, fr fr:
dwmac1000_validate_mcast_bins(9)dwmac1000_validate_ucast_entries(9)stmmac_axi_setup(9)stmmac_mtl_setup(9)stmmac_of_get_mdio(9)stmmac_of_get_mac_mode(9)stmmac_probe_config_dt(9)devm_stmmac_probe_config_dt(9)stmmac_pltfr_get_irq_array(9)stmmac_pltfr_init(9)stmmac_pltfr_exit(9)stmmac_pltfr_probe(9)devm_stmmac_pltfr_probe(9)stmmac_pltfr_remove(9)
and that's the whole page bestie π it came from ./drivers/net/ethernet/stmicro..., dated October 2026, and it's stmmac_mdio_setup(9) β go off and set up those MDIO structures, you've absolutely got this π«ΆπΈ
π¦ 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