bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.

Some cards don't support changing vlan offloading settings.  Make
Ethtool set_flags return -EINVAL in those cases.

Reported-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jesse Gross 2010-10-21 11:30:43 +00:00 committed by David S. Miller
parent 0988c4c7fb
commit ec37a48d1d
2 changed files with 2 additions and 2 deletions

View file

@ -7528,7 +7528,7 @@ bnx2_set_flags(struct net_device *dev, u32 data)
if (!(bp->flags & BNX2_FLAG_CAN_KEEP_VLAN) &&
!(data & ETH_FLAG_RXVLAN))
return -EOPNOTSUPP;
return -EINVAL;
rc = ethtool_op_set_flags(dev, data, ETH_FLAG_RXHASH | ETH_FLAG_RXVLAN |
ETH_FLAG_TXVLAN);

View file

@ -1123,7 +1123,7 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)
}
if (!(data & ETH_FLAG_RXVLAN))
return -EOPNOTSUPP;
return -EINVAL;
if ((data & ETH_FLAG_LRO) && bp->rx_csum && bp->disable_tpa)
return -EINVAL;