]> git.ipfire.org Git - thirdparty/linux.git/commit
net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management
authorOleksij Rempel <o.rempel@pengutronix.de>
Wed, 18 Jun 2025 12:25:57 +0000 (14:25 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Jun 2025 22:37:06 +0000 (15:37 -0700)
commite110bc82589752909e283ba5cbc160e0ab56c085
treef6097b2b785c5e8fe561e986b95a46174607fee6
parent64f37cd57d7a32e3a768870d12bec81bec426419
net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management

Convert the LAN78xx USB Ethernet driver to use the PHYLINK framework for
managing PHY and MAC interactions. This improves consistency with other
network drivers, simplifies pause frame handling, and enables cleaner
suspend/resume support.

Key changes:
- Replace all PHYLIB-based logic with PHYLINK equivalents:
  - Replace phy_connect()/phy_disconnect() with phylink_connect_phy()
  - Replace phy_start()/phy_stop() with phylink_start()/phylink_stop()
  - Replace pauseparam handling with phylink_ethtool_get/set_pauseparam()
- Introduce lan78xx_phylink_setup() to configure PHYLINK
- Add phylink MAC operations:
  - lan78xx_mac_config()
  - lan78xx_mac_link_up()
  - lan78xx_mac_link_down()
- Remove legacy link state handling:
  - lan78xx_link_status_change()
  - lan78xx_link_reset()
- Handle fixed-link fallback for LAN7801 using phylink_set_fixed_link()
- Replace deprecated flow control handling with phylink-managed logic

Power management:
- Switch suspend/resume paths to use phylink_suspend()/phylink_resume()
- Ensure proper use of rtnl_lock() where required
- Note: full runtime testing of power management is currently limited
  due to hardware setup constraints

Note: Conversion of EEE (Energy Efficient Ethernet) handling to the
PHYLINK-managed API will be done in a follow-up patch. For now, the
legacy EEE enable logic is preserved in mac_link_up().

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20250618122602.3156678-2-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/Kconfig
drivers/net/usb/lan78xx.c