__phy_modify(9)
π NAME π
__phy_modify β the convenience function for modifying a PHY register, bestie. That's it, that's the whole vibe. Like, it's literally right there in the name: modify. A register. Conveniently. Slay.
β¨ SYNOPSIS β¨
int __phy_modify (struct phy_device *phydev , u32 regnum , u16 mask ,
u16 set );
π ARGUMENTS π
phydevβ thephy_devicestruct, aka the main character of this whole operation. It's your PHY. You gotta hand it over. π«Άregnumβ the register number to modify. Which register are we messing with? This one. Point at it. πmaskβ bit mask of bits to clear. Yes bestie, clear. Read that twice. π§Όsetβ the new value of bits set inmaskto write toregnum. So whatever bits you flagged inmask, this is the fresh new value they get. β¨
π NOTE π
MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation. π¨
Okay so like, this is the part where you do NOT try to be cute and call this from interrupt context. Fr fr. The bus read/write functions might sit there waiting for an interrupt to conclude, and you cannot be doing that inside interrupt context β that's the whole problem. Not it. Do not. π
π SEE ALSO π
Kernel file ./drivers/net/phy/phy-core.c β plus the whole group chat of related functions, all of them, in order, no cap:
phy_speed_to_str(9)phy_duplex_to_str(9)phy_rate_matching_to_str(9)phy_fix_phy_mode_for_mac_delays(9)phy_interface_num_ports(9)phy_set_max_speed(9)of_set_phy_timing_role(9)phy_resolve_aneg_pause(9)phy_resolve_aneg_linkmode(9)phy_check_downshift(9)__phy_read_mmd(9)phy_read_mmd(9)__phy_write_mmd(9)phy_write_mmd(9)phy_modify_changed(9)phy_modify(9)__phy_modify_mmd_changed(9)phy_modify_mmd_changed(9)__phy_modify_mmd(9)phy_modify_mmd(9)phy_save_page(9)phy_select_page(9)phy_restore_page(9)phy_read_paged(9)phy_write_paged(9)phy_modify_paged_changed(9)phy_modify_paged(9)
And that's the whole page, babe! π¦ This lil beauty lives in ./drivers/net/phy, dated October 2026 β so go forth, modify those registers, and keep it out of interrupt context. 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