stmmac_of_get_mdio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:

  1. the compatible is "snps,dwc-qos-ethernet-4.10" && a child node named "mdio" exists
  2. 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:

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