netdev: Make ethtool_ops::set_flags() return -EINVAL for unsupported flags
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 30 Jun 2010 02:46:56 +0000 (02:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Jun 2010 21:09:36 +0000 (14:09 -0700)
The documented error code for attempts to set unsupported flags (or
to clear flags that cannot be disabled) is EINVAL, not EOPNOTSUPP.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2x_main.c
drivers/net/netxen/netxen_nic_ethtool.c
drivers/net/qlcnic/qlcnic_ethtool.c
drivers/net/s2io.c

index 0809f6cfbd1ac7e2259aa81c8de15a92079668e4..29e293f97dba6a5ad06e97ae05c7be95c6bb81bd 100644 (file)
@@ -10983,7 +10983,7 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)
        int rc = 0;
 
        if (data & ~(ETH_FLAG_LRO | ETH_FLAG_RXHASH))
-               return -EOPNOTSUPP;
+               return -EINVAL;
 
        if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
                printk(KERN_ERR "Handling parity error recovery. Try again later\n");
index 6d94ee57946648e76aa9dfa8c302e9f1f92e8db3..b30de24f4a520683d4502a83ea11939d775ecefb 100644 (file)
@@ -888,7 +888,7 @@ static int netxen_nic_set_flags(struct net_device *netdev, u32 data)
        int hw_lro;
 
        if (data & ~ETH_FLAG_LRO)
-               return -EOPNOTSUPP;
+               return -EINVAL;
 
        if (!(adapter->capabilities & NX_FW_CAPABILITY_HW_LRO))
                return -EINVAL;
index b9d5acbaf5408966ede6cc01d7b78909ac0d1244..f8e39e4cfe0fdc2752c40967034992c939720850 100644 (file)
@@ -984,7 +984,7 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
        int hw_lro;
 
        if (data & ~ETH_FLAG_LRO)
-               return -EOPNOTSUPP;
+               return -EINVAL;
 
        if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
                return -EINVAL;
index a032d726d640a372fe12bacdddcbf24ec5c0bb35..22371f1dca58c60cddad1da73becb471ed59a08f 100644 (file)
@@ -6692,7 +6692,7 @@ static int s2io_ethtool_set_flags(struct net_device *dev, u32 data)
        int changed = 0;
 
        if (data & ~ETH_FLAG_LRO)
-               return -EOPNOTSUPP;
+               return -EINVAL;
 
        if (data & ETH_FLAG_LRO) {
                if (lro_enable) {