ethtool: Change ethtool_op_set_flags to validate flags
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 30 Jun 2010 02:44:32 +0000 (02:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Jun 2010 21:09:35 +0000 (14:09 -0700)
commit1437ce3983bcbc0447a0dedcd644c14fe833d266
tree073ba0dc60127b08b65fbcca4d0d7c15318c08f8
parentb3003be36a3c9215cd17182349981581de269048
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>
drivers/net/cxgb4/cxgb4_main.c
drivers/net/enic/enic_main.c
drivers/net/ixgbe/ixgbe_ethtool.c
drivers/net/mv643xx_eth.c
drivers/net/myri10ge/myri10ge.c
drivers/net/niu.c
drivers/net/sfc/ethtool.c
drivers/net/sky2.c
include/linux/ethtool.h
net/core/ethtool.c