STRUCT SFP_UPSTREAM_OPS(9)
π struct sfp_upstream_ops(9) β like, the upstream operations structure, bestie
Okay so picture this: you're deep in the Kernel API Manual (yes, that's the manual name, she's fancy) and you hit struct sfp_upstream_ops. This is the vibe check for everyone who lives upstream of an SFP socket. Grab a snack, we're going in π
β¨ SYNOPSIS β¨
Here's the whole squad, exactly as they appear, no cap:
struct sfp_upstream_ops {
void (*attach)(void *priv, struct sfp_bus *bus);
void (*detach)(void *priv, struct sfp_bus *bus);
int (*module_insert)(void *priv, const struct sfp_eeprom_id *id);
void (*module_remove)(void *priv);
int (*module_start)(void *priv);
void (*module_stop)(void *priv);
void (*link_down)(void *priv);
void (*link_up)(void *priv);
int (*connect_phy)(void *priv, struct phy_device *);
void (*disconnect_phy)(void *priv, struct phy_device *);
};
Like, ten whole function pointers. She's giving full roster energy π
π Members π
Every single one of these, in order, because we do not skip members in this house:
attachβ called when the sfp socket driver is bound to the upstream. Mandatory. You literally cannot skip this one, fr fr.detachβ called when the sfp socket driver is unbound from the upstream. Also mandatory π breaking up is a whole callback too.module_insertβ called after a module has been detected, to determine whether the module is supported for the upstream device. iykyk, it's the compatibility check era πmodule_removeβ called after the module has been removed. bye bestie π¦module_startβ called after the PHY probe step. iconic timing, no notes β¨module_stopβ called before the PHY is removed. like, before, okay, don't be late π«Άlink_downβ called when the link is non-operational for whatever reason. she's going through it πlink_upβ called when the link is operational. WE'RE SO BACK π₯connect_phyβ called when an I2C accessible PHY has been detected on the module. obsessed πΈdisconnect_phyβ called when a module with an I2C accessible PHY has been removed. the sad goodbye arc π
ngl the two mandatory ones areattachanddetachβ everything else is optional flair. but the mandatory ones? non-negotiable, bestie π
π¦ SEE ALSO π¦
Go give these their flowers too:
- Kernel file
./include/linux/sfp.hβstruct sfp_eeprom_id(9) struct sfp_module_caps(9)
And that's the whole page, periodt π She lives in ./include/linux, dated October 2026 β so yeah, mark your calendar, screenshot it, send it to the group chat ππ
π¦ 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