lan78xx_mac_prepare_for_phy(9)
π lan78xx_mac_prepare_for_phy(9)
okay so this is a page straight out of the Kernel API Manual, and bestie, it's literally about preconfiguring the MAC-side interface settings before the PHY stuff happens. tiny function, big main character energy. let's get into it π«Ά
β¨ NAME β¨
lan78xx_mac_prepare_for_phy β preconfigure MAC-side interface settings β¨
π¦ SYNOPSIS π¦
int lan78xx_mac_prepare_for_phy (struct lan78xx_net *dev );
π ARGUMENTS π
devβ the LAN78xx device, obvs π
πΈ DESCRIPTION πΈ
So what this does is configure the MAC-side registers according to dev->interface, and ngl that field should already be set by lan78xx_get_phy. like, that's the whole vibe check here π
Here's the tea, per interface mode:
- For
PHY_INTERFACE_MODE_RGMII: it enables MAC-side TXC delay. no cap, this mode seems to be used in a special setup without a real PHY β likely on EVB-KSZ9897-1. in that design, LAN7801 is connected to the KSZ9897 switch, and the link timing is expected to be hardwired (e.g. via strapping or board layout). and no devicetree support is assumed here either. that's just how it is π€·ββοΈ - For
PHY_INTERFACE_MODE_RGMII_ID: it disables the MAC-side delay and relies on the PHY driver to provide the delay instead. handing off the job, iconic behavior π - For GMII: no MAC-specific config is needed. nothing to do, we love a low-effort moment β¨
β RETURN β
0 on success, or a negative error code π (so like, check the return value, bestie, pls)
π¦ SEE ALSO π¦
Kernel file ./drivers/net/usb/lan78xx.c plus all these lil friends:
lan78xx_phy_int_ack(9)lan78xx_configure_usb(9)lan78xx_configure_flowcontrol(9)lan78xx_mac_eee_enable(9)lan78xx_set_fixed_link(9)lan78xx_get_phy(9)lan78xx_configure_leds_from_dt(9)
lowkey go read those too, iykyk π
and that's the whole page fr fr π this lil gem lives in ./drivers/net/usb and the version/date on it is October 2026 β so yeah, future-coded docs, slay πβ¨
π¦ 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