phy_modify_mmd(9)
π phy_modify_mmd(9) π
Okay bestie, so this is a page from the Kernel API Manual and it's literally about phy_modify_mmd β a convenience function for modifying a register on MMD. Yes, that's a lot of M's, no cap, and it's giving "read the register, tweak some bits, write it back" energy and honestly? We're obsessed. π¦
β¨ SYNOPSIS β¨
int phy_modify_mmd (struct phy_device *phydev , int devad , u32 regnum ,
u16 mask , u16 set );
That's the whole signature, character for character, don't come for me. π
π ARGUMENTS π
phydevβ thephy_devicestruct. Your main character, literally the whole device vibe. πΈdevadβ the MMD containing the register you wanna modify. Like, which MMD, babe. Pick one. π―regnumβ the register number to modify. The exact spot we're messing with. πmaskβ bit mask of bits to clear. This is your "not these ones, thank you" list. βοΈsetβ the new value of the bits set inmaskto write toregnum. So:masksays where,setsays what goes there. Iconic duo, honestly. π
β οΈ NOTE β οΈ
MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation.
And this one is not a vibe-optional thing, bestie β this is a hard MUST NOT. π Like, do not do it. If you're in interrupt context and you call this, the bus read/write functions might just sit there waiting for an interrupt to conclude the operation, and next thing you know it's giving deadlock, not slay. π Keep this one out of interrupt context, fr fr.
π SEE ALSO π
Kernel file ./drivers/net/phy/phy-core.c β and the whole friend group, in this exact order so pls don't @ me:
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(9)__phy_modify_mmd_changed(9)phy_modify_mmd_changed(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)
That's the full squad, all 27 of them, every single one accounted for. π«Ά No one gets left behind on my watch. π
So yeah, that's phy_modify_mmd(9) β mask the bits, set the bits, don't do it in interrupt context, and you're golden. π§
Big kiss from ./drivers/net/phy, dated October 2026 β that's the source/version and the date, all wrapped up in a cute little sign-off, 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