diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-08-16 14:02:11 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-05-09 18:17:21 +0100 |
commit | bb34461c832aea08d1415badb59c2dc44b871805 (patch) | |
tree | 417086631908f088a0d673480fdc4808ac1564a8 /net/dsa/port.c | |
parent | c0c39b8e2be2ab8fd37c16e6493a4366e80f6d7a (diff) |
net: dsa: add support for phylink managed EEE
Add support to allow DSA drivers to use phylink managed EEE, with only
needing support for controlling the LPI state.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'net/dsa/port.c')
-rw-r--r-- | net/dsa/port.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/dsa/port.c b/net/dsa/port.c index 9a249d4ac3a5..f37389b58c95 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -1622,6 +1622,26 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config, speed, duplex, tx_pause, rx_pause); } +static void dsa_port_phylink_mac_disable_tx_lpi(struct phylink_config *config) +{ + struct dsa_port *dp = dsa_phylink_to_port(config); + struct dsa_switch *ds = dp->ds; + + if (ds->ops->phylink_mac_disable_tx_lpi) + ds->ops->phylink_mac_disable_tx_lpi(ds, dp->index); + +} + +static void dsa_port_phylink_mac_enable_tx_lpi(struct phylink_config *config, + u32 timer) +{ + struct dsa_port *dp = dsa_phylink_to_port(config); + struct dsa_switch *ds = dp->ds; + + if (ds->ops->phylink_mac_enable_tx_lpi) + ds->ops->phylink_mac_enable_tx_lpi(ds, dp->index, timer); +} + static const struct phylink_mac_ops dsa_port_phylink_mac_ops = { .mac_select_pcs = dsa_port_phylink_mac_select_pcs, .mac_prepare = dsa_port_phylink_mac_prepare, @@ -1629,6 +1649,8 @@ static const struct phylink_mac_ops dsa_port_phylink_mac_ops = { .mac_finish = dsa_port_phylink_mac_finish, .mac_link_down = dsa_port_phylink_mac_link_down, .mac_link_up = dsa_port_phylink_mac_link_up, + .mac_disable_tx_lpi = dsa_port_phylink_mac_disable_tx_lpi, + .mac_enable_tx_lpi = dsa_port_phylink_mac_enable_tx_lpi, }; int dsa_port_phylink_create(struct dsa_port *dp) |