From: Stanislaw Gruszka Date: Sun, 27 Jun 2010 23:29:42 +0000 (+0000) Subject: vmxnet3: fail when try to setup unsupported features X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d92be4b1661be0cef5f277f10078c71c166f16ad;p=linux-beck.git vmxnet3: fail when try to setup unsupported features Return EOPNOTSUPP in ethtool_ops->set_flags. Fix coding style while at it. Signed-off-by: Stanislaw Gruszka Signed-off-by: David S. Miller --- diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c index 3935c4493fb7..8a71a21d53ec 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c @@ -276,16 +276,21 @@ vmxnet3_get_strings(struct net_device *netdev, u32 stringset, u8 *buf) } static u32 -vmxnet3_get_flags(struct net_device *netdev) { +vmxnet3_get_flags(struct net_device *netdev) +{ return netdev->features; } static int -vmxnet3_set_flags(struct net_device *netdev, u32 data) { +vmxnet3_set_flags(struct net_device *netdev, u32 data) +{ struct vmxnet3_adapter *adapter = netdev_priv(netdev); u8 lro_requested = (data & ETH_FLAG_LRO) == 0 ? 0 : 1; u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1; + if (data & ~ETH_FLAG_LRO) + return -EOPNOTSUPP; + if (lro_requested ^ lro_present) { /* toggle the LRO feature*/ netdev->features ^= NETIF_F_LRO;