netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] qlcnic: fail when try to setup unsupported features
@ 2010-06-28  9:31 Stanislaw Gruszka
  2010-06-28 12:36 ` Amit Salecha
  2010-06-29  7:55 ` David Miller
  0 siblings, 2 replies; 18+ messages in thread
From: Stanislaw Gruszka @ 2010-06-28  9:31 UTC (permalink / raw)
  To: netdev; +Cc: Amerigo Wang, Amit Kumar Salecha, Anirban Chakraborty

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/qlcnic/qlcnic_ethtool.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index d4e803e..b9d5acb 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -983,12 +983,19 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
 	struct qlcnic_adapter *adapter = netdev_priv(netdev);
 	int hw_lro;
 
+	if (data & ~ETH_FLAG_LRO)
+		return -EOPNOTSUPP;
+
 	if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
 		return -EINVAL;
 
-	ethtool_op_set_flags(netdev, data);
-
-	hw_lro = (data & ETH_FLAG_LRO) ? QLCNIC_LRO_ENABLED : 0;
+	if (data & ETH_FLAG_LRO) {
+		hw_lro = QLCNIC_LRO_ENABLED;
+		netdev->features |= NETIF_F_LRO;
+	} else {
+		hw_lro = 0;
+		netdev->features &= ~NETIF_F_LRO;
+	}
 
 	if (qlcnic_config_hw_lro(adapter, hw_lro))
 		return -EIO;
-- 
1.5.5.6


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-06-30 20:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-28  9:31 [PATCH -next] qlcnic: fail when try to setup unsupported features Stanislaw Gruszka
2010-06-28 12:36 ` Amit Salecha
2010-06-28 12:58   ` Stanislaw Gruszka
2010-06-28 13:09     ` Amit Salecha
2010-06-28 14:14       ` Stanislaw Gruszka
2010-06-28 14:18         ` Ben Hutchings
2010-06-29 14:41           ` Ben Hutchings
2010-06-29 15:00             ` Stanislaw Gruszka
2010-06-29 15:05               ` Ben Hutchings
2010-06-29 16:01                 ` [RFC] [PATCH] ethtool: Change ethtool_op_set_flags to validate flags Ben Hutchings
2010-06-30  5:26                   ` Jeff Garzik
2010-06-30 11:21                   ` Stanislaw Gruszka
2010-06-30 20:47                     ` David Miller
2010-06-29 16:59             ` [PATCH -next] qlcnic: fail when try to setup unsupported features David Miller
2010-06-28 13:16     ` Ben Hutchings
2010-06-28 13:30       ` Ben Hutchings
2010-06-28 14:18         ` Stanislaw Gruszka
2010-06-29  7:55 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).