phy_id_compare(9)
π« 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 π
enum phy_interface_t(9)phy_modes(9)rgmii_clock(9)struct mdio_bus_stats(9)struct mii_bus(9)mdiobus_alloc(9)enum phy_state(9)struct phy_c45_device_ids(9)struct phy_oatc14_sqi_capability(9)struct phy_device(9)struct phy_tdr_config(9)enum link_inband_signalling(9)struct phy_plca_cfg(9)struct phy_plca_status(9)struct phy_led(9)struct phy_mse_capability(9)struct phy_mse_snapshot(9)struct phy_driver(9)phy_id_compare_vendor(9)phy_id_compare_model(9)phydev_id_compare(9)phy_is_started(9)phy_driver_is_genphy(9)phy_disable_eee_mode(9)phy_can_wakeup(9)phy_may_wakeup(9)phy_read(9)__phy_read(9)phy_write(9)__phy_write(9)__phy_modify_changed(9)phy_read_mmd_poll_timeout(9)__phy_set_bits(9)__phy_clear_bits(9)phy_set_bits(9)phy_clear_bits(9)__phy_set_bits_mmd(9)__phy_clear_bits_mmd(9)phy_set_bits_mmd(9)phy_clear_bits_mmd(9)phy_interrupt_is_valid(9)phy_polling_mode(9)phy_has_hwtstamp(9)phy_has_rxtstamp(9)phy_has_tsinfo(9)phy_has_txtstamp(9)phy_is_default_hwtstamp(9)phy_on_sfp(9)phy_interface_mode_is_rgmii(9)phy_interface_mode_is_8023z(9)phy_interface_is_rgmii(9)phy_is_pseudo_fixed_link(9)phy_module_driver(9)
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
- 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