STRUCT PHYLINK_PCS_OPS(9)
π struct phylink_pcs_ops(9) β like, the MAC PCS operations structure, bestie
okay so this is a page from the Kernel API Manual, and honestly? it's giving "backstage pass to the PHY link layer" energy. sit down, grab a π, and let's get into it.
β¨ NAME β¨
struct phylink_pcs_ops β the MAC PCS operations structure. that's it, that's the vibe. it's the little bundle of function pointers that tells phylink how to talk to your PCS. iconic behavior, no cap.
π¦ SYNOPSIS π¦
struct phylink_pcs_ops {
int (*pcs_validate)(struct phylink_pcs *pcs, unsigned long
*supported, const struct phylink_link_state *state);
unsigned int (*pcs_inband_caps)(struct phylink_pcs *pcs,
phy_interface_t interface);
int (*pcs_enable)(struct phylink_pcs *pcs);
void (*pcs_disable)(struct phylink_pcs *pcs);
void (*pcs_pre_config)(struct phylink_pcs *pcs, phy_interface_t
interface);
int (*pcs_post_config)(struct phylink_pcs *pcs, phy_interface_t
interface);
void (*pcs_get_state)(struct phylink_pcs *pcs, unsigned int
neg_mode, struct phylink_link_state *state);
int (*pcs_config)(struct phylink_pcs *pcs, unsigned int neg_mode,
phy_interface_t interface, const unsigned long *advertising, bool
permit_pause_to_mac);
void (*pcs_an_restart)(struct phylink_pcs *pcs);
void (*pcs_link_up)(struct phylink_pcs *pcs, unsigned int neg_mode,
phy_interface_t interface, int speed, int duplex);
void (*pcs_disable_eee)(struct phylink_pcs *pcs);
void (*pcs_enable_eee)(struct phylink_pcs *pcs);
int (*pcs_pre_init)(struct phylink_pcs *pcs);
};
like, look at all those function pointers. so many little slots to fill in. main character energy fr fr π
πΈ Members πΈ
pcs_validateβ validate the link configuration. vibe check for your link config, basically β is this even allowed, bestie?pcs_inband_capsβ query inband support for interface mode. asks the hardware "do you do inband here or not" and reports back.pcs_enableβ enable the PCS. wake it up, it's time to slay β¨pcs_disableβ disable the PCS. nap time, gorgeous π΄pcs_pre_configβ pre-mac_configmethod (for errata). runs before the mac config, and it exists specifically to work around errata. yes, silicon is messy, we deal.pcs_post_configβ post-mac_configmethod (for arrata). runs after the mac config. (the original page literally spells it "arrata" here β keeping it character for character, iykyk π)pcs_get_stateβ read the current MAC PCS link state from the hardware. literally just peeking at what the hardware thinks is going on right now.pcs_configβ configure the MAC PCS for the selected mode and state. set it up to match whatever mode/state we've landed on.pcs_an_restartβ restart 802.3z BaseX autonegotiation. give the autoneg a little reboot, king πpcs_link_upβ program the PCS for the resolved link configuration (where necessary). note the "where necessary" β only bother when it actually matters.pcs_disable_eeeβ optional notification to PCS that EEE has been disabled at the MAC. just a heads-up, bestie, not mandatory.pcs_enable_eeeβ optional notification to PCS that EEE will be enabled at the MAC. same deal, future-tense heads-up. also optional.pcs_pre_initβ configure PCS components necessary for MAC hardware initialization e.g. RX clock for stmmac. get the PCS bits ready so the MAC can actually boot up properly.
π 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), 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)
π reminder: this page lives at ./include/linux in the source tree β that's where the real source of truth is. go read it if you need the full lore.
and that's the whole page, bestie π«Ά this one's from the Kernel API Manual, out of ./include/linux, dated October 2026, and it's the struct phylink_pcs_ops(9) page β periodt. πβ¨
π¦ 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