Skip to content

Commit

Permalink
bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
Browse files Browse the repository at this point in the history
Some cards don't support changing vlan offloading settings.  Make
Ethtool set_flags return -EINVAL in those cases.

Reported-by: Ben Hutchings <[email protected]>
Signed-off-by: Jesse Gross <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jessegross authored and davem330 committed Oct 22, 2010
1 parent 0988c4c commit ec37a48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bnx2x/bnx2x_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ec37a48

Please sign in to comment.