phy_sfp_detach(9)
β¨ phy_sfp_detach(9) β¨
okay so we're in the Kernel API Manual bestie, and today's main character is phy_sfp_detach(9) π
no cap, she's a tiny little cleanup function but she MATTERS.
πΈ NAME πΈ
phy_sfp_detach β detach the SFP bus from the PHY upstream network device π«Ά
π SYNOPSIS π
void phy_sfp_detach (void *upstream , struct sfp_bus *bus );
literally that's the whole signature. she takes two things and returns nothing (void), and yes she's one of those functions that exists purely to be a callback. iconic behavior honestly π
π¦ ARGUMENTS π¦
upstreamβ pointer to the phy device β¨ (this is the dev you're passing in, the one on the upstream side β you know the one)busβ sfp bus representing cage being attached π (yep, that's what the manpage says, cage being attached β keep that energy, iykyk)
π DESCRIPTION π
So what does she do? She's the designated filler-upper for the sfp_upstream_ops .detach member π₯. That's it. That's the job. You plug her into that struct member and she handles the detach side of things when the SFP bus needs to come off the PHY upstream network device.
like she's not out here doing the most β she's a callback, she shows up, she does the detach, she leaves π periodt.
ngl this is one of those functions where the manpage description is shorter than this rewrite, so don't go expecting extra lore. everything she does is up in that one sentence π
π SEE ALSO π
okay bestie this list is LONG, so buckle up π’ β first the kernel file involved:
- Kernel file
./drivers/net/phy/phy_device.c
and then the whole friend group π (yes, all of them, in order, no skipping):
phy_uses_state_machine(9)phy_register_fixup(9)genphy_match_phy_device(9)get_phy_c45_ids(9)get_phy_c22_id(9)get_phy_device(9)phy_device_register(9)phy_device_remove(9)phy_get_c45_ids(9)phy_find_next(9)phy_prepare_link(9)phy_connect_direct(9)phy_connect(9)phy_disconnect(9)phy_poll_reset(9)phy_sfp_connect_phy(9)phy_sfp_disconnect_phy(9)phy_sfp_attach(9)phy_sfp_probe(9)phy_attach_direct(9)phy_detach(9)phy_reset_after_clk_enable(9)genphy_config_advert(9)genphy_c37_config_advert(9)genphy_setup_forced(9)genphy_restart_aneg(9)genphy_check_and_restart_aneg(9)__genphy_config_aneg(9)genphy_c37_config_aneg(9)genphy_aneg_done(9)genphy_update_link(9)genphy_read_status_fixed(9)genphy_read_status(9)genphy_c37_read_status(9)genphy_soft_reset(9)genphy_read_abilities(9)phy_remove_link_mode(9)phy_advertise_supported(9)phy_advertise_eee_all(9)phy_support_eee(9)phy_disable_eee(9)phy_support_sym_pause(9)phy_support_asym_pause(9)phy_set_sym_pause(9)phy_set_asym_pause(9)phy_validate_pause(9)phy_get_pause(9)phy_get_internal_delay(9)phy_get_tx_amplitude_gain(9)phy_get_mac_termination(9)phy_get_sfp_port(9)fwnode_mdio_find_device(9)fwnode_phy_find_device(9)fwnode_get_phy_node(9)phy_probe(9)phy_driver_register(9)
and that's the whole page bestie, she's short but she's serving π
go read phy_sfp_attach(9) next, they're literally a matching set π«Ά
source: ./drivers/net/phy Β· dated October 2026 Β· the Kernel API Manual said slay and honestly? she did πβ¨π
π¦ 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