mac_link_up(9)
π mac_link_up (9) β the kernel API manual glow-up π
Okay bestie, welcome to mac_link_up from the Kernel API Manual β this is the lil notification that the link has come up, and we are gonna understand it fr fr. β¨
πΈ NAME πΈ
mac_link_up β notification that the link has come up π
π¦ SYNOPSIS π¦
void mac_link_up (struct phylink_config *config , struct phy_device *phy
, unsigned int mode , phy_interface_t interface , int speed , int duplex
, bool tx_pause , bool rx_pause );
β¨ ARGUMENTS β¨
configβ a pointer to astruct phylink_config. πphyβ any attached phy. Deprecated, bestie β please use LPI interfaces. πmodeβ link autonegotiation mode.interfaceβ linktypedef phy_interface_tmode.speedβ link speed.duplexβ link duplex.tx_pauseβ link transmit pause enablement status.rx_pauseβ link receive pause enablement status.
π DESCRIPTION π
So this function tells the MAC that the link has come up, plus all the link parameters as seen from the MAC's point of view. Iconic. π
If mac_link_up has been called before, there will be an intervening call to mac_link_down before this method gets called again. No skipping the down part, okay? π
The speed, duplex, tx_pause and rx_pause args indicate the finalised link settings, and you should use them to configure the MAC block appropriately when those settings are not automatically conveyed from the PCS block, or if in-band negotiation β as defined by phylink_autoneg_inband(mode) β is disabled. π«Ά
Also lowkey important: when 802.3z in-band negotiation is in use, it's possible that the user wants to override the pause settings, and that should be allowed when you're thinking about how to implement this method. π
Once it's configured, the MAC may begin to process packets for transmission and reception. Main character energy, literally. π₯
Interface type selection must be done in mac_config. Not here. Periodt. π
π SEE ALSO π
Kernel file ./include/linux/phylink.h 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_down(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)
β¨ cute lil sign-off β¨
This masterpiece lives under ./include/linux, it's dated October 2026, and yes β it's still mac_link_up(9), slaying in the manual pages. ππ¦π
π¦ 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