mtk_xfi_tphy_set_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 mtk_xfi_tphy_set_mode πŸ’…

okay so bestie, real talk β€” this is a page straight out of the Kernel API Manual (section 9, the kernel-functions one, iykyk), and it's literally about telling the XFI T-PHY which interface mode it's living in. it's giving "tiny function, big responsibility" energy. let's get into it 🫢


✨ NAME ✨

mtk_xfi_tphy_set_mode β€” Setup phy for specified interface mode.

like, that's the whole job. it sets up the phy for whichever interface mode you picked. no cap, that's it πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int mtk_xfi_tphy_set_mode (struct phy *phy , enum phy_mode mode , int
submode );

(yes the line break is canon, don't come for me 😭)


πŸ’– ARGUMENTS πŸ’–

  • phy β€” the Phy instance. your main character struct, the actual phy you're configuring 🌈
  • mode β€” ngl this one's picky: only PHY_MODE_ETHERNET is supported. that's the vibe check, and only one vibe passes it πŸ’€
  • submode β€” an Ethernet interface mode. this is where you say which flavor of ethernet you want, bestie πŸ“

πŸ”₯ DESCRIPTION πŸ”₯

so what actually happens? it validates the selected mode (checks you didn't hand it something unserious), and then it calls the function mtk_xfi_tphy_setup. that's the whole flow. validate β†’ delegate. iconic delegation honestly πŸ‘‘


⭐ RETURN ⭐

  • 0 β€” OK βœ… everything slayed, we're good
  • -EINVAL β€” invalid mode 🚩 that's the "not me getting the wrong mode" error, it means whatever you passed in wasn't valid

🌸 SEE ALSO 🌸

go look at the kernel file ./drivers/phy/mediatek/phy-mtk-xfi-tphy.c β€” that's the source of truth, the mothership πŸ’œ

and then the whole friend group:

all of them are in the group chat, fr fr πŸ’…


okay and finally, the sign-off πŸŽ€ this whole thing lives in ./drivers/phy/mediatek, it's dated October 2026, and it came to you courtesy of the Kernel API Manual, page mtk_xfi_tphy_set_mode(9). that's the tea, bestie β€” go forth and set some modes βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from