mac_link_down(9)
π mac_link_down(9) β Kernel API Manual π«Ά
okay bestie, welcome to mac_link_down(9) from the Kernel API Manual β this is the little notification function that tells your MAC "hey girl, the link went down" ππ and honestly? she's short, she's sweet, she's iconic.
β¨ NAME β¨
mac_link_down β notification that the link has gone down π§οΈ
π¦ SYNOPSIS π¦
void mac_link_down (struct phylink_config *config , unsigned int mode ,
phy_interface_t interface );
likeβ¦ that's the whole call. no cap, that's it π
π ARGUMENTS π
configβ a pointer to astruct phylink_config. just a lil pointer, minding her business π«Άmodeβ link autonegotiation mode. this one matters later, trust π₯interfaceβ link typedefphy_interface_tmode. yes the original says "typedef" and "mode", we're not editing the queen's words π
πΈ DESCRIPTION πΈ
So the whole vibe: this function notifies the MAC that the link has gone down ππ§οΈ
β οΈ Big caveat bestie β this will not be called unlessmac_link_uphas been previously called. so ifmac_link_upnever ran, don't expect this one to show up. it's giving "you can't break up if you never dated" π
The MAC should stop processing packets for transmission and reception. both. at the same time. no half measures, periodt β
And here's the part where you gotta not do too much: phylink will have called netif_carrier_off to notify the networking stack that the link has gone down β so MAC drivers should not make this call themselves. like, stay in your lane, the phylink girlies already handled it π
β¨
One more thing, and this is important: if mode is MLO_AN_INBAND, then this function must not prevent the link coming up. do not sabotage the comeback. the link is allowed to rise again like a phoenix π¦π₯
π SEE ALSO π
Kernel file ./include/linux/phylink.h β and the whole extended friend group:
struct phylink_link_state(9)struct phylink_config(9)struct phylink_mac_ops(9)mac_get_caps(9)mac_select_pcs(9)mac_prepare(9)mac_config(9)mac_finish(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)
and that's the page, bestie πβ¨ this lil icon lives in the kernel file ./include/linux, stamped October 2026 β so go forth, notify that MAC, and remember: <pink>don't call netif_carrier_off yourself, phylink already ate π</pink> ππ¦
π¦ 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