pcs_pre_init(9)
π pcs_pre_init(9) β like, the Kernel API Manual, but make it make sense
Okay bestie, so this one is from the Kernel API Manual, and it's literally called pcs_pre_init β the little pre-game ritual your PCS has to do before the MAC can even think about waking up. π«Ά
β¨ NAME β¨
pcs_pre_init β configure the PCS components that are, like, necessary for MAC initialization. No PCS prep, no MAC glow-up. π
πΈ SYNOPSIS πΈ
int pcs_pre_init (struct phylink_pcs *pcs );
π ARGUMENTS π
pcsβ a pointer to astruct phylink_pcs. That's it. That's the whole vibe check. β¨
π¦ DESCRIPTION π¦
So here's the tea: MAC drivers can call this through the phylink_pcs_pre_init wrapper, and they have to do it before their hardware gets initialized. Like, before. β°
π¨ Not me telling you this: do not call it after the link is brought up. Reconfiguring the PCS at that point could literally break the link. It's giving chaos, and not the cute kind. π
Some MAC devices need their associated PCS device to do a very specific hardware initialization first, because otherwise they can't properly initialize their own hardware. Real example: initializing stmmac controllers requires an active REF_CLK signal served up by the PHY/PCS. Iconic of them, honestly. π
So by calling phylink_pcs_pre_init, MAC drivers can make sure the PCS is set up in a way that lets hardware initialization actually succeed. Slay. β
Now β the specific configuration that pcs_pre_init performs depends on the model of PCS and on the requirements of the MAC device attached to it. So if you're a PCS driver author, lowkey consider whether your target device is going to be used together with a MAC device whose driver calls phylink_pcs_pre_init. And if you're a MAC driver author, please document your requirements for the PCS pre-initialization. Do it for the girls. ππ
π 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_prepare(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)phylink_get_link_timer_ns(9)phylink_mac_implements_lpi(9)
And that's the whole page, bestie! π§ββοΈ This one lives under ./include/linux, dated October 2026, and it answers to the name pcs_pre_init(9). Go forth and pre-init responsibly. πβ¨π
π¦ 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