__phy_package_read_mmd(9)
π __phy_package_read_mmd
ok so real talk, this is a page from the Kernel API Manual and honestly? it's a little guy that does one job and does it cute. bestie, let's get into it π«Ά
β¨ NAME β¨
__phy_package_read_mmd β read an MMD reg, but like... relative to the PHY package base addr π«
πΈ SYNOPSIS πΈ
int __phy_package_read_mmd (struct phy_device *phydev , unsigned int
addr_offset , int devad , u32 regnum );
like, it takes four things and gives you back an int. no cap. π
π¦ ARGUMENTS π¦
phydevβ thephy_devicestruct π the main character of this whole situation, honestly.addr_offsetβ the offset that gets added onto the PHY packagebase_addr. yes, added. math is happening. iykyk π₯devadβ which MMD you're reading from. pick your fighter β¨regnumβ the register on that MMD you wanna read. this isu32, respect the width π
π DESCRIPTION π
okay so picture this: it's a convenience helper for reading a register of an MMD on a given PHY, and it does it using the PHY package base address. iconic behaviour, truly. π
the base address gets added to the addr_offset value β so base_addr + addr_offset, every single time, that's the whole vibe. π§
and here's the part where i need you to pay attention bestie: same calling rules as for __phy_read β literally fr fr, don't get creative with it π
β NOTE β
it's assumed that the entire PHY package is either C22 or C45. one or the other, queen. don't be messy about it π
no cap, this is an assumption β so if your package is some cursed mix, that's on you, not on the helper π
π₯ SEE ALSO π₯
kernel file ./drivers/net/phy/phy_package.c (yes, the struct lives there, go look π), plus the whole squad:
phy_package_shared(9)phy_package_lock(9)phy_package_unlock(9)__phy_package_write_mmd(9)β the write-flavoured sibling, obsessed with her πphy_package_join(9)of_phy_package_join(9)phy_package_leave(9)devm_phy_package_join(9)devm_of_phy_package_join(9)
and that's the page!! sourced from ./drivers/net/phy, dated October 2026, and honestly this doc ate and left no crumbs π mwah π
π¦ 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