diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-06-27 23:33:29 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-29 00:53:27 -0700 |
commit | ef2519b1dd3994074e3e438d67f2d91d07c3a5a8 (patch) | |
tree | 1fc6ccbd19d01a4b10756ea6aec28fe4be87ffd6 /drivers/net/netxen | |
parent | e0d904ffd052930504913fb105dd25764f5f0bd8 (diff) | |
download | kernel_samsung_smdk4412-ef2519b1dd3994074e3e438d67f2d91d07c3a5a8.tar.gz kernel_samsung_smdk4412-ef2519b1dd3994074e3e438d67f2d91d07c3a5a8.tar.bz2 kernel_samsung_smdk4412-ef2519b1dd3994074e3e438d67f2d91d07c3a5a8.zip |
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.c | 13 |
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 20f7c58bd09..6d94ee57946 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) struct netxen_adapter *adapter = netdev_priv(netdev); int hw_lro; + if (data & ~ETH_FLAG_LRO) + return -EOPNOTSUPP; + if (!(adapter->capabilities & NX_FW_CAPABILITY_HW_LRO)) return -EINVAL; - ethtool_op_set_flags(netdev, data); - - hw_lro = (data & ETH_FLAG_LRO) ? NETXEN_NIC_LRO_ENABLED : 0; + if (data & ETH_FLAG_LRO) { + hw_lro = NETXEN_NIC_LRO_ENABLED; + netdev->features |= NETIF_F_LRO; + } else { + hw_lro = 0; + netdev->features &= ~NETIF_F_LRO; + } if (netxen_config_hw_lro(adapter, hw_lro)) return -EIO; |