phylink_connect_phy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to the phylink_connect_phy(9) page πŸ’… this one lives in the Kernel API Manual and it's literally about introducing a PHY to its phylink bestie. matchmaker energy fr fr πŸŽ€


🌸 NAME 🌸

phylink_connect_phy β€” connect a PHY to the phylink instance 🫢


✨ SYNOPSIS ✨

int phylink_connect_phy (struct phylink *pl , struct phy_device *phy );

that's it. that's the whole signature. short and iconic πŸ‘‘


πŸ’œ ARGUMENTS πŸ’œ

  • pl β€” a pointer to a struct phylink returned from phylink_create 🌈 like, this is the phylink you already made, you're not creating a new one here, you're just handing it a friend.
  • phy β€” a pointer to a struct phy_device. πŸ¦‹ yep. that's the whole description for this one. it's a pointer to a struct phy_device. slay.

πŸ”₯ DESCRIPTION πŸ”₯

So what actually happens 😭 β€” this function connects phy to the phylink instance specified by pl by calling phy_attach_direct. that's the matchmaking moment πŸ’–

Then it configures the phy according to the MAC driver's capabilities, starts the PHYLIB state machine, and enables any interrupts that the PHY supports. it's giving full onboarding process ✨

also important bestie: this updates the phylink's ethtool supported and advertising link mode masks πŸ‘€ so the vibes (link modes) get refreshed too, no cap.

And the return value? 0 on success, or a negative errno πŸ’€ so if it's negative, something went wrong, check your errno.


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/net/phy/phylink.c, struct phylink(9), and honestly the entire phylink friend group πŸ’…:


that's the whole page bestie, go connect some PHYs πŸ§šπŸ’œ

β€” from ./drivers/net/phy, dated October 2026 πŸ“ mwah, ily, bye πŸ’‹

πŸ“¦ where this page comes from