1 From 064fbc4e9b5a6dbda7fe7b67dc7e9e95d31f8d75 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Thu, 4 Jul 2024 11:14:55 +0100
4 Subject: [PATCH] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam
7 Implement operations to get and set flow-control link parameters.
8 Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
9 Fix whitespace in mtk_ethtool_ops while at it.
11 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
13 Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
14 Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
15 Link: https://patch.msgid.link/e3ece47323444631d6cb479f32af0dfd6d145be0.1720088047.git.daniel@makrotopia.org
16 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
18 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++-
19 1 file changed, 17 insertions(+), 1 deletion(-)
21 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
22 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
23 @@ -4361,6 +4361,20 @@ static int mtk_set_rxnfc(struct net_devi
27 +static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
29 + struct mtk_mac *mac = netdev_priv(dev);
31 + phylink_ethtool_get_pauseparam(mac->phylink, pause);
34 +static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
36 + struct mtk_mac *mac = netdev_priv(dev);
38 + return phylink_ethtool_set_pauseparam(mac->phylink, pause);
41 static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
42 struct net_device *sb_dev)
44 @@ -4389,8 +4403,10 @@ static const struct ethtool_ops mtk_etht
45 .get_strings = mtk_get_strings,
46 .get_sset_count = mtk_get_sset_count,
47 .get_ethtool_stats = mtk_get_ethtool_stats,
48 + .get_pauseparam = mtk_get_pauseparam,
49 + .set_pauseparam = mtk_set_pauseparam,
50 .get_rxnfc = mtk_get_rxnfc,
51 - .set_rxnfc = mtk_set_rxnfc,
52 + .set_rxnfc = mtk_set_rxnfc,
55 static const struct net_device_ops mtk_netdev_ops = {