pcs_config(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pcs_config β€” the kernel API manual, bestie edition ✨

okay so you're here for pcs_config(9) from the Kernel API Manual and honestly? good choice. this is the little function that tells your PCS how to behave and what to advertise, and we're gonna go through it together, no cap 🫢


🌸 NAME 🌸

pcs_config β€” configure the PCS mode and advertisement ✨


πŸŽ€ SYNOPSIS πŸŽ€

int pcs_config (struct phylink_pcs *pcs , unsigned int neg_mode ,
phy_interface_t interface , const unsigned long *advertising , bool
permit_pause_to_mac );

like, she takes five things and returns an int, periodt πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • pcs β€” a pointer to a struct phylink_pcs. yes bestie, a pointer, we're doing kernel things now πŸ”₯
  • neg_mode β€” the link negotiation mode (full breakdown below, keep reading πŸ‘€)
  • interface β€” the interface mode you want to use
  • advertising β€” the "adertisement" ethtool link mode mask (that spelling is literally what the doc says, we don't edit history, we just vibe with it πŸ˜­πŸ’€)
  • permit_pause_to_mac β€” says whether it's okay to forward the pause resolution to the MAC 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does she actually do? She configures the PCS for the operating mode and for the interface mode, and she sets the advertisement mask. That's the whole errand. permit_pause_to_mac is there to tell you whether the hardware is allowed to forward the pause mode resolution to the MAC. simple as πŸ’…

When you're operating in MLO_AN_INBAND, inband should always be enabled β€” otherwise inband should be disabled. no in-between, bestie, we love a binary 🌈

For SGMII, there's no advertisement coming from the MAC side, so the PCS should be programmed to acknowledge the inband word from the PHY. that's her job, she's got it πŸ‘‘

For 1000BASE-X, the advertisement should be programmed into the PCS. put it in there, fr fr ✨

For most 10GBASE-R, there is no advertisement. none. zero. nada. that's just how it is πŸ“

The neg_mode argument should be tested via the phylink_mode_*() family of functions β€” or, for PCS that set pcs->neg_mode true, it should be tested against the PHYLINK_PCS_NEG_* definitions. pick your lane, both are valid iykyk πŸ’œ

pcs_config will be called when configuration of the PCS is required, or when the advertisement is possibly updated. And here's the important bit: it must not unnecessarily disrupt an established link. like, do not come for a link that's already living its best life, that's so rude πŸ˜­πŸ™ˆ

When an autonegotiation restart is required for 802.3z modes, .pcs_config should return a positive non-zero integer (e.g. 1) to indicate to phylink to call the pcs_an_restart method. so returning 1 here is literally you tapping phylink on the shoulder like "hey bestie, restart time" πŸ‘‘πŸ”₯

⭐ SEE ALSO ⭐

the whole friend group, gathered for you πŸ’–:


and that's the page, bestie πŸ’…βœ¨ this lil gem lives in ./include/linux, it's from October 2026, and it's filed under pcs_config(9). go configure something iconic πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from