lan78xx_get_phy(9)
π 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 π
- Kernel file
./drivers/net/usb/lan78xx.cπ lan78xx_phy_int_ack(9)lan78xx_configure_usb(9)lan78xx_configure_flowcontrol(9)lan78xx_mac_eee_enable(9)lan78xx_set_fixed_link(9)lan78xx_mac_prepare_for_phy(9)lan78xx_configure_leds_from_dt(9)
k bye bestie! source/version: ./drivers/net/usb; date: October 2026; page: lan78xx_get_phy(9) π«Άπβ¨
π¦ 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