net: phylink: remove pause mode ethtool setting for fixed links
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 15 Feb 2020 15:49:37 +0000 (15:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Feb 2020 03:39:45 +0000 (19:39 -0800)
Remove the ability for ethtool -A to change the pause settings for
fixed links; if this is really required, we can reinstate it later.

Andrew Lunn agrees: "So I think it is safe to not implement ethtool
-A, at least until somebody has a real use case for it."

Lets avoid making things too complex for use cases that aren't being
used.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c

index 70b9a143db84afb8e7cc114942354f961084b696..de7b7499ae38f4e92f8fd6daaa16d664165c9462 100644 (file)
@@ -1373,6 +1373,9 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl,
 
        ASSERT_RTNL();
 
+       if (pl->cur_link_an_mode == MLO_AN_FIXED)
+               return -EOPNOTSUPP;
+
        if (!phylink_test(pl->supported, Pause) &&
            !phylink_test(pl->supported, Asym_Pause))
                return -EOPNOTSUPP;
@@ -1399,18 +1402,8 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl,
                                   pause->tx_pause);
        } else if (!test_bit(PHYLINK_DISABLE_STOPPED,
                             &pl->phylink_disable_state)) {
-               switch (pl->cur_link_an_mode) {
-               case MLO_AN_FIXED:
-                       /* Should we allow fixed links to change against the config? */
-                       phylink_resolve_flow(pl, config);
-                       phylink_mac_config(pl, config);
-                       break;
-
-               case MLO_AN_INBAND:
-                       phylink_mac_config(pl, config);
-                       phylink_mac_an_restart(pl);
-                       break;
-               }
+               phylink_mac_config(pl, &pl->link_config);
+               phylink_mac_an_restart(pl);
        }
 
        return 0;