stmmac_mdio_setup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 bestie
  • np β€” 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:


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