sfp_get_name(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ sfp_get_name ✨

okay so bestie, this is a page from the Kernel API Manual β€” yes, the kernel kernel, the big one πŸ’… β€” and it's all about one teeny tiny function that tells you the name of your SFP device. it's giving "small but iconic", fr fr.


🌸 NAME 🌸

sfp_get_name β€” Get the SFP device name πŸŽ€

like, literally that's the whole job. it gets the name. and it does it so well.


✨ SYNOPSIS ✨

const char * sfp_get_name (struct sfp_bus *bus );

that's it. one function, one arg, one const char * coming back at you. no cap. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bus β€” a pointer to the struct sfp_bus structure for the sfp module. basically the little handle that says "hey, this is the bus we're talking about" πŸ’–

πŸ’œ DESCRIPTION πŸ’œ

so the way that this works is: sfp_get_name gets the SFP device's name, if bus has a registered socket. that "if" is doing a lot of heavy lifting there, so pay attention πŸ‘‘

⚠️ okay important part, don't skip this β€” callers must hold RTNL. that's not a suggestion, that's the rules. and the returned name is only valid until RTNL is released. so like... grab it, use it, don't get attached. it is not yours forever. 😭

🌈 RETURN 🌈

  • the name of the SFP device registered with sfp_register_socket ✨
  • NULL if no device was registered on bus πŸ’€

so either you get a name or you get nothing. vibe check either way. πŸ“


🧚 SEE ALSO 🧚

the kernel file ./drivers/net/phy/sfp-bus.c and these absolute legends of the SFP universe:

okay that's a whole friend group right there and honestly? obsessed. go read them too, iykyk πŸ’…


πŸŽ€ sign-off πŸŽ€

this little gem lives in ./drivers/net/phy, and it's dated October 2026 ⭐ β€” so yeah, mark your calendars bestie. mwah, go hold RTNL and stay safe out there πŸ’–πŸ”₯πŸ‘‘πŸ™ˆ


πŸ“¦ where this page comes from