summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/wangxun/ngbe
diff options
context:
space:
mode:
authorJiawen Wu <jiawenwu@trustnetic.com>2024-01-03 03:08:50 +0100
committerDavid S. Miller <davem@davemloft.net>2024-01-04 11:49:35 +0100
commit2fe2ca09da953bac778eab5dfb309b4e7d274b1a (patch)
tree7823a004fcf36e244dff24ae02be78956db5547a /drivers/net/ethernet/wangxun/ngbe
parentnet: ngbe: convert phylib to phylink (diff)
downloadlinux-2fe2ca09da953bac778eab5dfb309b4e7d274b1a.tar.xz
linux-2fe2ca09da953bac778eab5dfb309b4e7d274b1a.zip
net: wangxun: add flow control support
Add support to set pause params with ethtool -A and get pause params with ethtool -a, for ethernet driver txgbe and ngbe. Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/wangxun/ngbe')
-rw-r--r--drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c2
-rw-r--r--drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c
index 0f87898a55b2..9a89f9576180 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c
@@ -54,6 +54,8 @@ static const struct ethtool_ops ngbe_ethtool_ops = {
.get_ethtool_stats = wx_get_ethtool_stats,
.get_eth_mac_stats = wx_get_mac_stats,
.get_pause_stats = wx_get_pause_stats,
+ .get_pauseparam = wx_get_pauseparam,
+ .set_pauseparam = wx_set_pauseparam,
};
void ngbe_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
index cc75856f231a..ec54b18c5fe7 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
@@ -75,6 +75,8 @@ static void ngbe_mac_link_up(struct phylink_config *config,
struct wx *wx = phylink_to_wx(config);
u32 lan_speed, reg;
+ wx_fc_enable(wx, tx_pause, rx_pause);
+
switch (speed) {
case SPEED_10:
lan_speed = 0;