phy_id_compare(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« phy_id_compare (9) β€” Kernel API Manual ✨

okay so bestie, welcome to phy_id_compare(9), straight out of the Kernel API Manual πŸ’– this one is short, sweet, and honestly kind of a little legend β€” it's the "do these two PHY IDs match under this mask" girlie, and she ate πŸŽ€


🌸 NAME 🌸

phy_id_compare β€” compare @id1 with @id2 taking account of @mask πŸ’…


✨ SYNOPSIS ✨

bool phy_id_compare (u32 id1 , u32 id2 , u32 mask );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • id1 β€” the first PHY ID, bestie. One of the two we're matching 🫢
  • id2 β€” the second PHY ID. The other half of the vibe check ✨
  • mask β€” the PHY ID mask, and here's the tea: the set bits are the significant ones in matching πŸ‘‘ like, those are the bits that actually matter, the rest are just background noise

πŸ’œ DESCRIPTION πŸ’œ

So here's the whole plot: it returns true if the bits from id1 and id2 specified by mask match. That's it. That's the function. Slay πŸŽ€

Under the hood it's using an equivalent test to this:

(id & mask) == (phy_id & mask)

literally the same energy, no cap πŸ’…


🌈 SEE ALSO 🌈

not me listing every single sibling in the phy.h family though 😭 main character energy is strong in this header file

Kernel file ./include/linux/phy.h πŸ‘‘


and that's the whole page, bestie πŸ’– it lives in ./include/linux, and it says October 2026 on the tin β€” so go forth, mask your bits, compare your IDs, and remember: if the bits that mask cares about line up, you return true and you absolutely deserve it πŸ§šβ€β™€οΈπŸŒΈπŸ’… periodt

πŸ“¦ where this page comes from