__phy_modify_changed(9)
π __phy_modify_changed(9) β Kernel API Manual, but make it make sense π
okay bestie, sit down, because today we're reading a page from the Kernel API Manual and honestly? she's short but she's iconic. this is __phy_modify_changed, and yes the double underscore is doing main character energy, it's part of the name, don't touch it π
β¨ NAME β¨
__phy_modify_changed β the convenience function for modifying a PHY register π
like, she's the girl who does one job and does it well. no cap.
πΈ SYNOPSIS πΈ
int __phy_modify_changed (struct phy_device *phydev , u32 regnum , u16
mask , u16 set );
that's the whole signature, character for character, go off π
π¦ ARGUMENTS π¦
phydevβ a pointer to astruct phy_deviceπ«Ά (your PHY, your bestie, the whole reason we're here)regnumβ register number π literally just which register we're messing withmaskβ bit mask of bits to clear π§Ή the ones getting yeetedsetβ bit mask of bits to set β the ones getting their moment
π DESCRIPTION π
so here's the thing: she's an unlocked helper function, which means the locking is not her problem, she said not today π but what she does do is let a PHY register be modified, and the math is literally this:
new register value = (old register value & ~mask) | set
read it slowly bestie, it slaps: take the old value, AND it with ~mask so everything in mask gets wiped, then OR in set so those bits go up. clear then set. that's the whole vibe check π§
and the returns? listen:
- negative errno β something went wrong π
0β there was no change1β in case of change π
yes, zero means "nothing happened" and one means "we moved", do not mix them up i'm begging π
π SEE ALSO π
Kernel file ./include/linux/phy.h
okay this list is long but she ate and we're listing every single one, no skipping, periodt π₯
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(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_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)
like i said. every. single. one. π β¨
ngl bestie, quick reminder: this page lives in the kernel API docs, so if the kernel changes and the docs say otherwise, the kernel wins. always. ππ
π and that's the whole page!! sourced from ./include/linux, dated October 2026, filed under the manual as __phy_modify_changed(9) β mwah, go read a register, ily, bye π«Άππ
π¦ 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