Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97d1935a authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller
Browse files

netdev: Make ethtool_ops::set_flags() return -EINVAL for unsupported flags



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: default avatarBen Hutchings <bhutchings@solarflare.com>
Acked-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1437ce39
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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");
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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) {