mii_nway_result(9)
โจ mii_nway_result(9) โจ
okay so this is a page from the Kernel API Manual and honestly? it's a little icon of a function ๐ it takes a bunch of MII abilities and tells you which media type you actually get. let's get into it ๐ซถ
๐ธ NAME ๐ธ
mii_nway_result โ
and yes bestie, the one-liner is genuinely blank upstream ๐ญ the manpage just... doesn't finish the sentence. not me leaving it exactly as I found it, no cap. the description below is where the tea is โ
๐ SYNOPSIS ๐
unsigned int mii_nway_result (unsigned int negotiated );
๐ฆ ARGUMENTS ๐ฆ
negotiatedโ this is the value of MIIANARand'd withANLPAR. like, the two auto-negotiation registers smooshed together with a bitwise AND. that's the whole input, periodt ๐ฅ
๐ DESCRIPTION ๐
so here's the vibe: you hand it a set of MII abilities, it checks each bit, and it returns the currently supported media โ in the priority order defined by IEEE 802.3u. iconic. โญ
it uses LPA_xxx constants, but heads up bestie ๐ซถ this is not the value of LPA solely โ as described above (ANAR AND'd with ANLPAR), remember?
there's exactly one exception to IEEE 802.3u, and it's lowkey important ngl: 100baseT4 is placed between 100T-full and 100T-half. if your phy doesn't support 100T4, that's totally fine, no drama ๐ but if your phy places 100T4 elsewhere in the priority order, then the built-in one won't match your phy and you will need to roll your own function. not me telling you to write your own ๐ญ but like, fr fr, you gotta.
๐จ tl;dr on the caveat: the ordering is hardcoded to IEEE 802.3u + that one 100T4 tweak. if your hardware disagrees with that ordering, this function isn't it for you.
๐ฎ SEE ALSO ๐ฎ
oh you want the whole friend group? say less ๐
- Kernel file
./include/linux/mii.h mii_duplex(9)ethtool_adv_to_mii_adv_t(9)linkmode_adv_to_mii_adv_t(9)mii_adv_to_ethtool_adv_t(9)ethtool_adv_to_mii_ctrl1000_t(9)linkmode_adv_to_mii_ctrl1000_t(9)mii_ctrl1000_to_ethtool_adv_t(9)mii_lpa_to_ethtool_lpa_t(9)mii_stat1000_to_ethtool_lpa_t(9)mii_stat1000_mod_linkmode_lpa_t(9)ethtool_adv_to_mii_adv_x(9)mii_adv_to_ethtool_adv_x(9)mii_adv_mod_linkmode_adv_t(9)mii_adv_to_linkmode_adv_t(9)mii_lpa_to_linkmode_lpa_t(9)mii_lpa_mod_linkmode_lpa_t(9)linkmode_adv_to_lcl_adv_t(9)mii_lpa_mod_linkmode_x(9)linkmode_adv_to_mii_adv_x(9)mii_advertise_flowctrl(9)mii_resolve_flowctrl_fdx(9)mii_bmcr_encode_fixed(9)
and that's the whole page bestie! ๐ง this one's from ./include/linux, dated October 2026 โ mwah, go forth and negotiate your link at the highest priority available ๐๐
#mii_nway_result #iykyk #slay
๐ฆ 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