pcs_pre_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a struct 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:


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