forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generic: 6.6: mtk_eth_soc: add support for flow-control settings
Add patch implementing operations to get and set flow-control link parameters of mtk_eth_soc via ethtool. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...nux/generic/pending-6.6/739-06-net-ethernet-mtk_eth_soc-implement-.-get-set-_pausep.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
From c418a6dc9ae0d4b0732ac9d6812d75d62077d9cd Mon Sep 17 00:00:00 2001 | ||
From: Daniel Golle <daniel@makrotopia.org> | ||
Date: Tue, 26 Mar 2024 10:35:09 +0000 | ||
Subject: [PATCH] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam | ||
ethtool ops | ||
|
||
Implement operations to get and set flow-control link parameters. | ||
Both is done by simply calling phylink_ethtool_{get,set}_pauseparam(). | ||
|
||
Signed-off-by: Daniel Golle <daniel@makrotopia.org> | ||
--- | ||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++- | ||
1 file changed, 17 insertions(+), 1 deletion(-) | ||
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -4644,6 +4644,20 @@ static int mtk_set_rxnfc(struct net_devi | ||
return ret; | ||
} | ||
|
||
+static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause) | ||
+{ | ||
+ struct mtk_mac *mac = netdev_priv(dev); | ||
+ | ||
+ phylink_ethtool_get_pauseparam(mac->phylink, pause); | ||
+} | ||
+ | ||
+static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause) | ||
+{ | ||
+ struct mtk_mac *mac = netdev_priv(dev); | ||
+ | ||
+ return phylink_ethtool_set_pauseparam(mac->phylink, pause); | ||
+} | ||
+ | ||
static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb, | ||
struct net_device *sb_dev) | ||
{ | ||
@@ -4672,8 +4686,10 @@ static const struct ethtool_ops mtk_etht | ||
.get_strings = mtk_get_strings, | ||
.get_sset_count = mtk_get_sset_count, | ||
.get_ethtool_stats = mtk_get_ethtool_stats, | ||
+ .get_pauseparam = mtk_get_pauseparam, | ||
+ .set_pauseparam = mtk_set_pauseparam, | ||
.get_rxnfc = mtk_get_rxnfc, | ||
- .set_rxnfc = mtk_set_rxnfc, | ||
+ .set_rxnfc = mtk_set_rxnfc, | ||
}; | ||
|
||
static const struct net_device_ops mtk_netdev_ops = { |