09d7054965b224d528aacb9f10912a4dd61c2732
[openwrt/staging/wigyori.git] /
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
5 ethtool ops
6
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.
10
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>
17 ---
18 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++-
19 1 file changed, 17 insertions(+), 1 deletion(-)
20
21 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
22 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
23 @@ -4462,6 +4462,20 @@ static int mtk_set_rxnfc(struct net_devi
24 return ret;
25 }
26
27 +static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
28 +{
29 + struct mtk_mac *mac = netdev_priv(dev);
30 +
31 + phylink_ethtool_get_pauseparam(mac->phylink, pause);
32 +}
33 +
34 +static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
35 +{
36 + struct mtk_mac *mac = netdev_priv(dev);
37 +
38 + return phylink_ethtool_set_pauseparam(mac->phylink, pause);
39 +}
40 +
41 static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
42 struct net_device *sb_dev)
43 {
44 @@ -4490,8 +4504,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,
53 };
54
55 static const struct net_device_ops mtk_netdev_ops = {