STRUCT PHYLINK_PCS_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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_config method (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_config method (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