phy_caps_lookup_by_linkmode(9)
β¨ phy_caps_lookup_by_linkmode β¨
okay so bestie, welcome to the phy_caps_lookup_by_linkmode(9) era β it's a kernel API manual page and honestly it's giving "small function, big main character energy" π
Let's get into it.
π NAME π
phy_caps_lookup_by_linkmode β look up the fastest matching link_capabilities ποΈβ¨
π¦ SYNOPSIS π¦
const struct link_capabilities * phy_caps_lookup_by_linkmode (const
unsigned long *linkmodes );
so it takes a pointer to some linkmodes and hands you back a const struct link_capabilities * β no cap, that's the whole vibe π
πΈ ARGUMENTS πΈ
linkmodesβ the linkmodes you wanna match against π« that's literally it, that's the whole argument, she's lowkey uncomplicated.
π RETURN π
It returns the highest-speed link_capabilities that intersects the given linkmodes π₯ like, fastest wins, periodt.
And here's the cute little tiebreaker detail, iykyk: in case several DUPLEX_ options exist at that speed, DUPLEX_FULL is matched first π so full duplex gets first dibs at that speed level.
If there's no match at all? You getNULLback π not me getting rejected by a lookup function. fr fr, no match meansNULL.
π SEE ALSO π
Kernel file ./drivers/net/phy/phy_caps.c β go read the source, bestie, it's right there π«Ά
phy_caps_init(9)phy_caps_speeds(9)phy_caps_lookup_by_linkmode_rev(9)phy_caps_lookup(9)phy_caps_linkmode_max_speed(9)phy_caps_valid(9)phy_caps_linkmodes(9)phy_caps_from_interface(9)phy_caps_medium_get_supported(9)phy_caps_mediums_from_linkmodes(9)
that's the whole friend group, go say hi to all of them π
annnnd that's the page!! brought to you by ./drivers/net/phy π dated October 2026 β a whole little time capsule, iconic of her honestly. hope this helped bestie, 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