]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.1.7/net-stmmac-fix-ethtool-flow-control-not-able-to-get-set.patch
Linux 5.1.7
[thirdparty/kernel/stable-queue.git] / releases / 5.1.7 / net-stmmac-fix-ethtool-flow-control-not-able-to-get-set.patch
1 From foo@baz Fri 31 May 2019 03:16:39 PM PDT
2 From: "Tan, Tee Min" <tee.min.tan@intel.com>
3 Date: Tue, 21 May 2019 12:55:42 +0800
4 Subject: net: stmmac: fix ethtool flow control not able to get/set
5
6 From: "Tan, Tee Min" <tee.min.tan@intel.com>
7
8 Currently ethtool was not able to get/set the flow control due to a
9 missing "!". It will always return -EOPNOTSUPP even the device is
10 flow control supported.
11
12 This patch fixes the condition check for ethtool flow control get/set
13 function for ETHTOOL_LINK_MODE_Asym_Pause_BIT.
14
15 Fixes: 3c1bcc8614db (“net: ethernet: Convert phydev advertize and supported from u32 to link mode”)
16 Signed-off-by: Tan, Tee Min <tee.min.tan@intel.com>
17 Reviewed-by: Ong Boon Leong <boon.leong.ong@intel.com>
18 Signed-off-by: Voon, Weifeng <weifeng.voon@intel.com@intel.com>
19 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
20 Signed-off-by: David S. Miller <davem@davemloft.net>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
25
26 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
27 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
28 @@ -460,7 +460,7 @@ stmmac_get_pauseparam(struct net_device
29 } else {
30 if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
31 netdev->phydev->supported) ||
32 - linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
33 + !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
34 netdev->phydev->supported))
35 return;
36 }
37 @@ -491,7 +491,7 @@ stmmac_set_pauseparam(struct net_device
38 } else {
39 if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
40 phy->supported) ||
41 - linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
42 + !linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
43 phy->supported))
44 return -EOPNOTSUPP;
45 }