stmmac_of_get_mdio(9)
π stmmac_of_get_mdio π
okay so bestie, this is a page from the Kernel API Manual (the stmmac_of_get_mdio(9) one, yes the whole thing is named after the function, iconic) and it's literally just about grabbing the MDIO bus out of the devicetree. tiny function, big "where is it though" energy. let's get into it π«Ά
β¨ SYNOPSIS β¨
struct device_node * stmmac_of_get_mdio (struct device_node *np );
that's it. that's the whole vibe check. one argument, returns a struct device_node *. slay.
πΈ ARGUMENTS πΈ
npβ the devicetree node. like, the node you're poking at to find the MDIO stuff. that's the whole argument, no notes π
π¦ DESCRIPTION π¦
so the MDIO bus is gonna get searched for, and there are exactly two ways this hunt goes down β think of it like checking two places for your keys and hoping one of them hits:
- the compatible is
"snps,dwc-qos-ethernet-4.10"&& a child node named"mdio"exists - a child node with the
"snps,dwmac-mdio"compatible is present
that's the algorithm. no cap, that's genuinely it. it checks route 1, and route 1 needs both the compatible match and the "mdio"-named child node β it's an &&, not an ||, so don't get it twisted β
π RETURN π
- the MDIO node β if it's there π
NULLβ if it isn't π
literally "found it or didn't." binary. main character energy fr fr.
π₯ SEE ALSO π₯
kernel file, in all its glory:
./drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
and the whole friend group of related functions β go read them, they're all doing their little part:
dwmac1000_validate_mcast_bins(9)dwmac1000_validate_ucast_entries(9)stmmac_axi_setup(9)stmmac_mtl_setup(9)stmmac_mdio_setup(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)
ngl, that cross-reference list is giving "the entire platform file" β but that's the source, bestie, so we list it all π
and that's the page!! courtesy of the Kernel API Manual, source file ./drivers/net/ethernet/stmicro/..., dated October 2026, and like always it's signed stmmac_of_get_mdio(9). bye bestie, go find that MDIO node π§πΈπ
π¦ 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