mii_adv_to_linkmode_adv_t(9)
π mii_adv_to_linkmode_adv_t β kernel API manual, but make it make sense
okay so bestie, welcome to the mii_adv_to_linkmode_adv_t(9) page. yes that's the whole name. the NAME section literally gives you the function name and then dips β no little summary, no nothing. iconic of it honestly. π
β¨ SYNOPSIS β¨
void mii_adv_to_linkmode_adv_t (unsigned long *advertising , u32 adv );
that's the whole signature, no cap. returns void, so don't go looking for a return value, it's not coming. π¦
πΈ ARGUMENTS πΈ
advertisingβ pointer to the destination link mode. this is where the translated stuff lands, so pls make sure it points somewhere real. π«Άadvβ the value of theMII_ADVERTISEregister. raw bits, coming in hot, about to get translated.
π DESCRIPTION π
so what does this little guy do? it's a small helper function β lowercase s small β that translates MII_ADVERTISE bits into linkmode advertisement settings. that's the whole job. it takes the register bits and rehomes them into linkmode-speak. π₯
and the important bit, literally: it clears the old value of advertising. so whatever was chilling in that destination before? gone. wiped. not me accidentally assuming it'd merge with what's already there π β it does not merge, it clears first. so don't pass it a buffer you were still emotionally attached to.
π SEE ALSO π
the kernel file itself lives at ./include/linux/mii.h β go say hi. π
and here's the whole friend group, all of them (9) pages, all of them part of this saga:
mii_nway_result(9)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_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)
that's twenty-two whole cross-references, bestie, we are thorough here. π
lowkey reminder:mii_adv_mod_linkmode_adv_t(9)is a different function from this one. the_to_one clears, the_mod_one modifies. don't mix them up, that's how you get bugs. π
and that's the page!! source dir was ./include/linux, dated October 2026, and it's the mii_adv_to_linkmode_adv_t(9) manual β slay, go translate some register bits, you've got this βπ§π
π¦ 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