pcs_validate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, so we're in the kernel API manual today and the page is literally called pcs_validate(9) β€” say it with me, pcs_validate, section 9, we love a numbered section 🫢


✨ NAME ✨

pcs_validate β€” validate the link configuration. that's it, that's the whole vibe check πŸ’…


🌸 SYNOPSIS 🌸

int pcs_validate (struct phylink_pcs *pcs , unsigned long *supported ,
const struct phylink_link_state *state );

no cap, it returns an int, takes a pointer to a struct phylink_pcs, an unsigned long * for supported, and a const struct phylink_link_state * for state. three args, one function, iconic πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • pcs β€” a pointer to a struct phylink_pcs. like, the actual PCS thing we're checking, bestie 🌸
  • supported β€” the ethtool bitmask for supported link modes. this is the mask that's gonna get edited, so pay attention πŸ‘€
  • state β€” a const pointer to a struct phylink_link_state. const means hands off, we're just reading her 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's what she does: she validates the interface mode, and she validates the advertising's autoneg bit, and then she removes any media ethtool link modes that would not be supportable from the supported mask. literally a little cleanup fairy 🧚

and then β€” this is the cute part β€” Phylink will propagate the changes to the advertising mask. she doesn't just tidy up, she tells everyone else about it. main character energy fr fr πŸ‘‘

also go see the struct phylink_mac_ops validate method, it's giving sibling energy.

now the return values, because this is where it gets real:

  • Returns -EINVAL if the interface mode/autoneg mode is not supported. so like, invalid, rejected, not today πŸ’€
  • Returns non-zero positive if the link state can be supported. slay, she ate, we move 🌈
ngl bestie, remember which is which β€” negative means no, positive means yes. do not mix those up, that's a whole mess 😭

πŸ’œ SEE ALSO πŸ’œ

and now the group chat roll call, everybody's here, all of them, no one gets left out:

Kernel file ./include/linux/phylink.h plus 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), struct phylink_pcs_ops(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)

like I said. every single one. the whole squad πŸ«ΆπŸ’–


⭐ sign-off ⭐

she lives in ./include/linux, the date on the page is October 2026, and she's part of the Kernel API Manual β€” that's the source, that's the version, that's the date, all accounted for, no details dropped periodt πŸ’…βœ¨

go read your phylink.h and hydrate bestie πŸ“πŸ’œ

πŸ“¦ where this page comes from