pcs_get_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pcs_get_state(9) β€” the Kernel API Manual, but make it make sense πŸ’–

okay so bestie, we're deep in phylink territory today and this one is literally the vibe check for your MAC PCS πŸ’… it's the call that goes "hey hardware, what's your deal right now?" and reports back. no cap, it's giving main character energy in the inband link state department.


✨ NAME ✨

pcs_get_state β€” read the current inband link state straight from the hardware 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

void pcs_get_state (struct phylink_pcs *pcs , unsigned int neg_mode ,
struct phylink_link_state *state );

three args, one void return, zero drama. slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • pcs β€” a pointer to a struct phylink_pcs. yes, the PCS itself. the whole point πŸͺž
  • neg_mode β€” the link negotiation mode, and it's one of the PHYLINK_PCS_NEG_xxx values. remember that, it comes back later πŸ‘€
  • state β€” a pointer to a struct phylink_link_state. this is the lil report card you're filling in πŸ“

🌸 DESCRIPTION 🌸

So what does it actually do? It reads the current inband link state from the MAC PCS and fills in your state struct like the world's most responsible bestie πŸ’– specifically:

  • current speed goes in state->speed
  • duplex mode goes in state->duplex
  • pause mode goes in state->pause, using the MLO_PAUSE_RX and MLO_PAUSE_TX bits
  • negotiation completion state goes in state->an_complete
  • link up state goes in state->link

and if it's possible? you should also populate state->lp_advertising. like, if you can. it's the polite thing to do ✨

⚠️ okay important heads up bestie: the neg_mode parameter is always the PHYLINK_PCS_NEG_xxx state, not MLO_AN_xxx. do not mix those up, i'm literally begging 😭 it's a whole different enum, iykyk.

πŸ”₯ SEE ALSO πŸ”₯

like, that's the whole friend group right there πŸ‘‘ go read them, they all ate πŸ’…


aaaand that's the page!! this one lives under ./include/linux, dated October 2026, and it's pcs_get_state(9) β€” go forth and read your link state, queen πŸ§šπŸ’œ

πŸ“¦ where this page comes from