phy_package_join(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so welcome to phy_package_join(9) from the Kernel API Manual β€” bestie, we’re joining a PHY group and it’s giving shared-storage excellence ✨

🌸 NAME 🌸

phy_package_join β€” join a common PHY group 🫢

✨ SYNOPSIS ✨

int phy_package_join (struct phy_device *phydev , int base_addr , size_t
       priv_size );

πŸŽ€ ARGUMENTS πŸŽ€

  • phydev β€” the target phy_device struct πŸ’…
  • base_addr β€” the cookie and base PHY address of the PHY package for offset calculation of global register access. no cap, it’s doing double duty.
  • priv_size β€” if it’s non-zero, allocate this amount of bytes for private data.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here’s the tea: this joins a PHY group and provides a shared storage for all phydevs in this group. It’s intended for packages which contain more than one PHY β€” for example a quad PHY transceiver. iconic multi-PHY behavior, honestly 😌

The base_addr parameter serves as cookie which has to have the same values for all members of one group, and as the base PHY address of the PHY package for offset calculation to access generic registers of a PHY package. Usually, one of the PHY addresses of the different PHYs in the package provides access to these global registers. The address which is given here will be used in the __phy_package_read and __phy_package_write convenience functions as base and added to the passed offset in those functions πŸ”₯

This will set the shared pointer of the phydev to the shared storage. If this is the first call for this cookie, the shared storage will be allocated. If priv_size is non-zero, the given amount of bytes are allocated for the priv member πŸŽ€

Return vibe check: Returns < 1 on error, 0 on success.

🚨 error watch: Esp. calling phy_package_join with the same cookie but a different priv_size is an error. don’t do that, bestie 😭

🌈 SEE ALSO 🌈


mwah πŸ’‹ source/version ./drivers/net/phy, date October 2026, page phy_package_join(9) β€” slay and goodbye πŸ«ΆπŸ’–

πŸ“¦ where this page comes from