diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-06-29 22:44:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-30 17:09:35 -0400 |
commit | 1437ce3983bcbc0447a0dedcd644c14fe833d266 (patch) | |
tree | 073ba0dc60127b08b65fbcca4d0d7c15318c08f8 /drivers/net/mv643xx_eth.c | |
parent | b3003be36a3c9215cd17182349981581de269048 (diff) |
ethtool: Change ethtool_op_set_flags to validate flags
ethtool_op_set_flags() does not check for unsupported flags, and has
no way of doing so. This means it is not suitable for use as a
default implementation of ethtool_ops::set_flags.
Add a 'supported' parameter specifying the flags that the driver and
hardware support, validate the requested flags against this, and
change all current callers to pass this parameter.
Change some other trivial implementations of ethtool_ops::set_flags to
call ethtool_op_set_flags().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r-- | drivers/net/mv643xx_eth.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index e345ec8cb473..82b720f29c75 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -1636,6 +1636,11 @@ static void mv643xx_eth_get_ethtool_stats(struct net_device *dev, | |||
1636 | } | 1636 | } |
1637 | } | 1637 | } |
1638 | 1638 | ||
1639 | static int mv643xx_eth_set_flags(struct net_device *dev, u32 data) | ||
1640 | { | ||
1641 | return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO); | ||
1642 | } | ||
1643 | |||
1639 | static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset) | 1644 | static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset) |
1640 | { | 1645 | { |
1641 | if (sset == ETH_SS_STATS) | 1646 | if (sset == ETH_SS_STATS) |
@@ -1661,7 +1666,7 @@ static const struct ethtool_ops mv643xx_eth_ethtool_ops = { | |||
1661 | .get_strings = mv643xx_eth_get_strings, | 1666 | .get_strings = mv643xx_eth_get_strings, |
1662 | .get_ethtool_stats = mv643xx_eth_get_ethtool_stats, | 1667 | .get_ethtool_stats = mv643xx_eth_get_ethtool_stats, |
1663 | .get_flags = ethtool_op_get_flags, | 1668 | .get_flags = ethtool_op_get_flags, |
1664 | .set_flags = ethtool_op_set_flags, | 1669 | .set_flags = mv643xx_eth_set_flags, |
1665 | .get_sset_count = mv643xx_eth_get_sset_count, | 1670 | .get_sset_count = mv643xx_eth_get_sset_count, |
1666 | }; | 1671 | }; |
1667 | 1672 | ||