Skip to content

Commit bd1ce01

Browse files
committed
net: cadence: macb: add ethtool EEE support
commit 61332b7 upstream Implement get_eee and set_eee ethtool ops for GEM as simple passthroughs to phylink_ethtool_get_eee() and phylink_ethtool_set_eee(). No MACB_CAPS_EEE guard is needed: phylink returns -EOPNOTSUPP from both ops when mac_supports_eee is false, which is the case when lpi_capabilities and lpi_interfaces are not populated. Those fields are only set when MACB_CAPS_EEE is present (previous patch), so phylink already handles the unsupported case correctly. Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
1 parent e978c03 commit bd1ce01

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4186,6 +4186,20 @@ static const struct ethtool_ops macb_ethtool_ops = {
41864186
.set_ringparam = macb_set_ringparam,
41874187
};
41884188

4189+
static int macb_get_eee(struct net_device *dev, struct ethtool_keee *eee)
4190+
{
4191+
struct macb *bp = netdev_priv(dev);
4192+
4193+
return phylink_ethtool_get_eee(bp->phylink, eee);
4194+
}
4195+
4196+
static int macb_set_eee(struct net_device *dev, struct ethtool_keee *eee)
4197+
{
4198+
struct macb *bp = netdev_priv(dev);
4199+
4200+
return phylink_ethtool_set_eee(bp->phylink, eee);
4201+
}
4202+
41894203
static const struct ethtool_ops gem_ethtool_ops = {
41904204
.supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS |
41914205
ETHTOOL_COALESCE_TX_USECS,
@@ -4210,6 +4224,8 @@ static const struct ethtool_ops gem_ethtool_ops = {
42104224
.set_ringparam = macb_set_ringparam,
42114225
.get_rxnfc = gem_get_rxnfc,
42124226
.set_rxnfc = gem_set_rxnfc,
4227+
.get_eee = macb_get_eee,
4228+
.set_eee = macb_set_eee,
42134229
};
42144230

42154231
static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)

0 commit comments

Comments
 (0)