mac_get_caps(9)
π mac_get_caps(9) β like, the Kernel API Manual, but make it make sense
okay bestie, so we're in the mac_get_caps(9) page today β¨ it's a little kernel-API moment from the Kernel API Manual, and honestly? it's short, it's sweet, and it's gonna take you like twelve seconds to get. let's go π«Ά
πΈ NAME πΈ
mac_get_caps β get the MAC capabilities for a given interface mode, no cap π
β¨ SYNOPSIS β¨
unsigned long mac_get_caps (struct phylink_config *config ,
phy_interface_t interface );
that's it. that's the whole signature. it hands you back an unsigned long and takes exactly two things, which we're about to break down π
π ARGUMENTS π
configβ a pointer to astruct phylink_config. yeah. that one. the config struct bestie π«Άinterfaceβ your PHY interface mode. like, which mode we're talking about here π
π¦ DESCRIPTION π¦
okay so this one is an optional method β lowkey important detail, don't skip it π if it's not provided, then config->mac_capabilities gets used instead. simple as that.
but when you do implement it? it returns the MAC capabilities for the specified interface mode β specifically for the cases where the MAC driver needs some special handling π§ like, for example, not supporting half-duplex in certain interface modes. it's giving "i have exceptions and i'm not sorry" energy, and honestly? iconic π
so no, it's not just a fancy wrapper β it's the escape hatch for when the default capabilities vibe check fails π
π SEE ALSO π
buckle up, because this list is LONG and it ate π every single one of these, bestie:
- Kernel file
./include/linux/phylink.h struct phylink_link_state(9)struct phylink_config(9)struct phylink_mac_ops(9)mac_select_pcs(9)mac_prepare(9)mac_config(9)mac_finish(9)mac_link_down(9)mac_link_up(9)mac_disable_tx_lpi(9)mac_enable_tx_lpi(9)mac_wol_set(9)struct phylink_pcs(9)struct phylink_pcs_ops(9)pcs_validate(9)pcs_inband_caps(9)pcs_enable(9)pcs_disable(9)pcs_get_state(9)pcs_config(9)pcs_an_restart(9)pcs_link_up(9)pcs_disable_eee(9)pcs_enable_eee(9)pcs_pre_init(9)phylink_get_link_timer_ns(9)phylink_mac_implements_lpi(9)
like i said. a whole friend group π
ngl, if you're implementing a MAC driver and you're like "hmm do i need this one?" β it's optional, so the default isconfig->mac_capabilities, and you only reach formac_get_capswhen a specific interface mode needs special capability handling. fr fr.
and that's the page!! π this one ships out of ./include/linux, dated October 2026 β mwah, slay, periodt πβ¨ go read phylink.h and stay hydrated bestie π
π¦ 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