phylink_mii_...decode_state(9)
π
phylink_mii_c22_pcs_decode_state β a Kernel API Manual moment β¨
okay so bestie, welcome to the Kernel API Manual, and today's main character is phylink_mii_c22_pcs_decode_state π like yes we're doing lowercase-and-underscores-core and it ate.
πΈ NAME πΈ
phylink_mii_c22_pcs_decode_state β literally decode the MAC PCS state from MII registers, no cap π«Ά
β¨ SYNOPSIS β¨
void phylink_mii_c22_pcs_decode_state (struct phylink_link_state *state
, unsigned int neg_mode , u16 bmsr , u16 lpa );
i'm obsessed with this signature actually π
π¦ ARGUMENTS π¦
stateβ a pointer to astruct phylink_link_state. yes queen, hand over the state πneg_modeβ the link negotiation mode, and it's givingPHYLINK_PCS_NEG_xxxenergy β¨bmsrβ The value of theMII_BMSRregister. iconic register, no notes πlpaβ The value of theMII_LPAregister. also iconic, we love a matching set π
π₯ DESCRIPTION π₯
okay so listen up: this is the helper for a MAC PCS that supports the 802.3 clause 22 register set, for clause 37 negotiation and/or SGMII control. very much a two-vibes-at-once situation and we respect it β
what it does is parse the Clause 37 or Cisco SGMII link partner negotiation word into the phylink state structure. like, it takes that word and puts it where it belongs. slay π
and here's the tea on when to use it: this is suitable for implementing the pcs_get_state member of the struct phylink_pcs_ops structure β but only if accessing bmsr and lpa cannot be done with MDIO directly π. read that again bestie, it's a whole conditional. no MDIO? then this is your girl. π§
π SEE ALSO π
the whole friend group, fr fr. the kernel file is ./drivers/net/phy/phylink.c, and then we have:
struct phylink(9)phylink_set_port_modes(9)phylink_interface_max_speed(9)phylink_caps_to_link_caps(9)phylink_caps_to_linkmodes(9)phylink_limit_mac_speed(9)phylink_cap_from_speed_duplex(9)phylink_get_capabilities(9)phylink_validate_mask_caps(9)phylink_pcs_neg_mode(9)phylink_set_fixed_link(9)phylink_create(9)phylink_destroy(9)phylink_expects_phy(9)phylink_connect_phy(9)phylink_of_phy_connect(9)phylink_fwnode_phy_connect(9)phylink_disconnect_phy(9)phylink_mac_change(9)phylink_pcs_change(9)phylink_start(9)phylink_stop(9)phylink_rx_clk_stop_block(9)phylink_rx_clk_stop_unblock(9)phylink_suspend(9)phylink_prepare_resume(9)phylink_resume(9)phylink_ethtool_get_wol(9)phylink_ethtool_set_wol(9)phylink_ethtool_ksettings_get(9)phylink_ethtool_ksettings_set(9)phylink_ethtool_nway_reset(9)phylink_ethtool_get_pauseparam(9)phylink_ethtool_set_pauseparam(9)phylink_get_eee_err(9)phylink_ethtool_get_eee(9)phylink_ethtool_set_eee(9)phylink_mii_ioctl(9)phylink_speed_down(9)phylink_speed_up(9)phylink_decode_usxgmii_word(9)phylink_decode_usgmii_word(9)β yes it's spelled different from the one above, and no i will not be merging them, they are two separate girls πphylink_mii_c22_pcs_get_state(9)phylink_mii_c22_pcs_encode_advertisement(9)phylink_mii_c22_pcs_config(9)phylink_mii_c22_pcs_an_restart(9)phylink_replay_link_begin(9)phylink_replay_link_end(9)
bestie reminder: thatbmsrandlpabit is load-bearing β this helper is the move when MDIO direct access isn't an option, okay? don't come for me if you skip it π
kay that's the whole page, mwah π this was served up from ./drivers/net/phy, dated October 2026, and it's titled phylink_mii_...decode_state(9) β and honestly? she's a whole vibe. 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