aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2010-06-27 19:33:29 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-29 03:53:27 -0400
commitef2519b1dd3994074e3e438d67f2d91d07c3a5a8 (patch)
tree1fc6ccbd19d01a4b10756ea6aec28fe4be87ffd6 /drivers/net/netxen
parente0d904ffd052930504913fb105dd25764f5f0bd8 (diff)
netxen: fail when try to setup unsupported features
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 20f7c58bd092..6d94ee579466 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -887,12 +887,19 @@ static int netxen_nic_set_flags(struct net_device *netdev, u32 data)
887 struct netxen_adapter *adapter = netdev_priv(netdev); 887 struct netxen_adapter *adapter = netdev_priv(netdev);
888 int hw_lro; 888 int hw_lro;
889 889
890 if (data & ~ETH_FLAG_LRO)
891 return -EOPNOTSUPP;
892
890 if (!(adapter->capabilities & NX_FW_CAPABILITY_HW_LRO)) 893 if (!(adapter->capabilities & NX_FW_CAPABILITY_HW_LRO))
891 return -EINVAL; 894 return -EINVAL;
892 895
893 ethtool_op_set_flags(netdev, data); 896 if (data & ETH_FLAG_LRO) {
894 897 hw_lro = NETXEN_NIC_LRO_ENABLED;
895 hw_lro = (data & ETH_FLAG_LRO) ? NETXEN_NIC_LRO_ENABLED : 0; 898 netdev->features |= NETIF_F_LRO;
899 } else {
900 hw_lro = 0;
901 netdev->features &= ~NETIF_F_LRO;
902 }
896 903
897 if (netxen_config_hw_lro(adapter, hw_lro)) 904 if (netxen_config_hw_lro(adapter, hw_lro))
898 return -EIO; 905 return -EIO;