aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/microchip/lan743x_main.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2024-04-06 15:16:00 -0500
committerDavid S. Miller <davem@davemloft.net>2024-04-08 14:04:16 +0100
commitef460a8986fa0dae1cdcb158a06127f7af27c92d (patch)
tree31ff1c4b9688f0109d9fc4235331788720abd4a6 /drivers/net/ethernet/microchip/lan743x_main.c
parentnet: usb: lan78xx: Fixup EEE (diff)
downloadwireguard-linux-ef460a8986fa0dae1cdcb158a06127f7af27c92d.tar.xz
wireguard-linux-ef460a8986fa0dae1cdcb158a06127f7af27c92d.zip
net: lan743x: Fixup EEE
The enabling/disabling of EEE in the MAC should happen as a result of auto negotiation. So move the enable/disable into lan743x_phy_link_status_change() which gets called by phylib when there is a change in link status. lan743x_ethtool_set_eee() now just programs the hardware with the LTI timer value, and passed everything else to phylib, so it can correctly setup the PHY. lan743x_ethtool_get_eee() relies on phylib doing most of the work, the MAC driver just adds the LTI timer value. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/lan743x_main.c')
-rw-r--r--drivers/net/ethernet/microchip/lan743x_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 75a988c0bd79..d37a49cd5c69 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -1462,6 +1462,13 @@ static void lan743x_phy_link_status_change(struct net_device *netdev)
phydev->interface == PHY_INTERFACE_MODE_1000BASEX ||
phydev->interface == PHY_INTERFACE_MODE_2500BASEX)
lan743x_sgmii_config(adapter);
+
+ data = lan743x_csr_read(adapter, MAC_CR);
+ if (phydev->enable_tx_lpi)
+ data |= MAC_CR_EEE_EN_;
+ else
+ data &= ~MAC_CR_EEE_EN_;
+ lan743x_csr_write(adapter, MAC_CR, data);
}
}