mac_prepare(9)
π mac_prepare(9) β from the Kernel API Manual, bestie π
okay so picture this: it's mac_prepare(9), it lives in the Kernel API Manual, and it is literally the "get ready bestie, we're about to switch things up" function. no cap.
β¨ NAME β¨
mac_prepare β prepare to change the PHY interface mode π¦
πΈ SYNOPSIS πΈ
int mac_prepare (struct phylink_config *config , unsigned int mode ,
phy_interface_t iface );
π«Ά ARGUMENTS π«Ά
configβ a pointer to astruct phylink_config. yes, that struct. πmodeβ one ofMLO_AN_FIXED,MLO_AN_PHY,MLO_AN_INBAND. pick your fighter πifaceβ the interface mode to switch to. the glow-up destination β¨
π DESCRIPTION π
so here's the tea: phylink will call this method at the beginning of a full initialisation of the link β that's the whole reset-and-redo moment, and it includes changing the interface mode, or it can happen at initial startup time. it may even be called for the current mode, like, no change at all, just vibes. π
the MAC driver should perform whatever actions are required at that point β for example, disabling the Serdes PHY. do what you gotta do, babe. π§
this is gonna be the first call in the sequence, and the sequence slays in this exact order:
mac_preparemac_configpcs_config- possible
pcs_an_restart mac_finish
and the return situation: it returns zero on success, or a negative errno on failure β and ngl, if you fail, that errno gets reported to the kernel log. so everyone will know. π no pressure tho π₯
π SEE ALSO π
Kernel file ./include/linux/phylink.h, plus the whole 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_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) π
that's the whole page, bestie β sourced from ./include/linux, dated October 2026, filed under mac_prepare(9). mwah π π
π¦ 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