bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
authorJesse Gross <jesse@nicira.com>
Thu, 21 Oct 2010 11:30:43 +0000 (11:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Oct 2010 02:59:32 +0000 (19:59 -0700)
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>
drivers/net/bnx2.c
drivers/net/bnx2x/bnx2x_ethtool.c

index bf3c830e7dda314ea4f5025f85d0698213a236c1..062600be073b91b47a70b0d65edb8824b941c1f8 100644 (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);
index daefef618ef7d40743d97d3345796bb60058c50e..d02ffbdc9f0ef551d4f17ba384f2d32a683c7ab2 100644 (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;