net: ethernet: mediatek: add ethtool EEE callbacks
Subsystems (4)
PATCH 1/1 net: ethernet: mediatek: add ethtool EEE callbacks
Allow users to adjust the EEE settings of an attached PHY.
--- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +16 -0
@@ -4474,6 +4474,20 @@ static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparamreturn phylink_ethtool_set_pauseparam (mac->phylink, pause); } +static int mtk_get_eee (struct net_device *dev,struct ethtool_keee *edata) +{ +struct mtk_mac *mac =netdev_priv (dev); + +return phylink_ethtool_get_eee (mac->phylink, edata); +} + +static int mtk_set_eee (struct net_device *dev,struct ethtool_keee *edata) +{ +struct mtk_mac *mac =netdev_priv (dev); + +return phylink_ethtool_set_eee (mac->phylink, edata); +} +static u16 mtk_select_queue (struct net_device *dev,struct sk_buff *skb,struct net_device *sb_dev) {
@@ -4506,6 +4520,8 @@ static const struct ethtool_ops mtk_ethtool_ops = { .set_pauseparam = mtk_set_pauseparam, .get_rxnfc = mtk_get_rxnfc, .set_rxnfc = mtk_set_rxnfc, + .get_eee = mtk_get_eee, + .set_eee = mtk_set_eee, };static const struct net_device_ops mtk_netdev_ops = {
Signature · 1 line
2.43.0
Quoted 1 line · Qingfang Deng
Allow users to adjust the EEE settings of an attached PHY.
Why do you need to do this? Does the MAC support EEE?
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Quoted 5 lines · Russell King (Oracle)
Quoted 1 line · Qingfang Deng
Allow users to adjust the EEE settings of an attached PHY.
Why do you need to do this? Does the MAC support EEE?
Yes, the MAC supports EEE.
Quoted 4 lines
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Quoted 9 lines · Qingfang Deng
Quoted 5 lines · Russell King (Oracle)
Quoted 1 line · Qingfang Deng
Allow users to adjust the EEE settings of an attached PHY.
Why do you need to do this? Does the MAC support EEE?
Yes, the MAC supports EEE.
Doesn't it need a bit more code to configure the MAC?
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Quoted 1 line · Russell King (Oracle)
Doesn't it need a bit more code to configure the MAC?
I think you're right. The MT7622 reference manual does not mention the EEE configuration register so I assumed it would be automatically enabled.
I just checked the mtk_eth_soc.h and found two unused defs "MAC_MSR_EEE1G" and "MAC_MSR_EEE100M". I will use those to enable EEE.
Quoted 4 lines
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!