lan78xx_get_phy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ lan78xx_get_phy(9) πŸŽ€

okay bestie, welcome to the Kernel API Manual page for lan78xx_get_phy(9) β€” it's giving β€œfind the PHY, register the fallback, set the interface mode” and honestly it's iconic. πŸ’…

🌸 NAME 🌸

lan78xx_get_phy β€” Probe or register PHY device and set interface mode, periodt. ✨

✨ SYNOPSIS ✨

struct phy_device * lan78xx_get_phy (struct lan78xx_net *dev );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the LAN78xx device structure. that's the whole argument, bestie, and it's lowkey the main character here. πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

So this function is on a mission: it attempts to find a PHY on the MDIO bus. Literally searching for its PHY bestie. πŸ‘€

If no PHY is found and the chip is LAN7801, it registers a fixed PHY as fallback β€” no cap, that's the backup plan. 🫢

It also sets dev->interface based on the chip ID and the detected PHY type. So yes: chip identity and PHY type are both pulling strings here. πŸ’…

⭐ RETURN ⭐

On success it gives you a valid PHY device pointer. On failure it gives you ERR_PTR. That's the contract, fr fr. 😭

🌈 SEE ALSO 🌈


k bye bestie! source/version: ./drivers/net/usb; date: October 2026; page: lan78xx_get_phy(9) πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from