]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
net: stmmac: fix ethtool flow control not able to get/set
authorTan, Tee Min <tee.min.tan@intel.com>
Tue, 21 May 2019 04:55:42 +0000 (12:55 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 13 Aug 2019 12:11:36 +0000 (14:11 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837518
Currently ethtool was not able to get/set the flow control due to a
missing "!". It will always return -EOPNOTSUPP even the device is
flow control supported.

This patch fixes the condition check for ethtool flow control get/set
function for ETHTOOL_LINK_MODE_Asym_Pause_BIT.

Fixes: 3c1bcc8614db (“net: ethernet: Convert phydev advertize and supported from u32 to link mode”)
Signed-off-by: Tan, Tee Min <tee.min.tan@intel.com>
Reviewed-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Voon, Weifeng <weifeng.voon@intel.com@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index 3c749c327cbd4a0305c1833a72c60d6d2e253917..e09522c5509a92158dd6da02914c7c1e33f3b2f2 100644 (file)
@@ -460,7 +460,7 @@ stmmac_get_pauseparam(struct net_device *netdev,
        } else {
                if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
                                       netdev->phydev->supported) ||
-                   linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
+                   !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
                                      netdev->phydev->supported))
                        return;
        }
@@ -491,7 +491,7 @@ stmmac_set_pauseparam(struct net_device *netdev,
        } else {
                if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
                                       phy->supported) ||
-                   linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
+                   !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
                                      phy->supported))
                        return -EOPNOTSUPP;
        }