phy_loopback(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… phy_loopback β€” Kernel API Manual πŸ’…

okay bestie, welcome to phy_loopback(9), straight out of the Kernel API Manual ✨ this one's all about making your PHY do the loopback thing. it's giving "networking but make it self-referential" πŸŒ€


🌸 NAME 🌸

phy_loopback β€” configure loopback mode of PHY πŸ’«

like literally, that's the whole vibe. you point it at a PHY and you turn loopback on or off. iconic behavior, no notes πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

int phy_loopback (struct phy_device *phydev , bool enable , int speed );

there she is. three args, one int coming back at you 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • phydev β€” the target phy_device struct, aka the PHY you're doing all this to πŸ’– it's the main character here, honestly.
  • enable β€” a bool that says whether you're turning loopback mode on or off. flip the switch, bestie πŸ”˜
  • speed β€” turn on loopback mode with a speed. yes, speed is part of the whole situation 🏎️✨

🌈 DESCRIPTION 🌈

so here's the tea β˜•: this function configures loopback mode of the PHY β€” that's the core job, that's the assignment, she ate πŸ’…

and also β€” and this is the part people forget β€” it signals link down and link up if the speed is changing 😭 like if you're switching speeds mid-loopback, the link gets the whole dramatic down-then-up moment. it's giving main character entrance, honestly 🎬


⭐ RETURN ⭐

  • 0 on success πŸŽ‰ slay, you did it
  • negative error code on failure πŸ˜­πŸ’€ something went sideways, go read the code
fr fr, check that return value. a negative number means it did not work, no cap.

πŸ’œ SEE ALSO πŸ’œ

all the siblings and cousins live in the kernel file ./drivers/net/phy/phy.c 🧚 and here's the whole family reunion, every single one of them:


and that's the whole page, bestie 🫢 this little gem lives in ./drivers/net/phy and it's dated October 2026 ⭐ so yeah, future-coded of her. go forth, configure some loopback, and remember: link down, link up, speed changing β€” she contains multitudes πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from