From ec37a48d1d16c30b655ac5280209edf52a6775d4 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Thu, 21 Oct 2010 11:30:43 +0000 Subject: 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 Signed-off-by: Jesse Gross Signed-off-by: David S. Miller --- drivers/net/bnx2.c | 2 +- drivers/net/bnx2x/bnx2x_ethtool.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index bf3c830e7dd..062600be073 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -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); diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c index daefef618ef..d02ffbdc9f0 100644 --- a/drivers/net/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/bnx2x/bnx2x_ethtool.c @@ -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; -- cgit v1.2.3-18-g5258