net/mlx4_en: do not ignore autoneg in mlx4_en_set_pauseparam()
authorIvan Vecera <ivecera@redhat.com>
Mon, 8 Sep 2014 16:46:53 +0000 (18:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Sep 2014 22:54:26 +0000 (15:54 -0700)
The driver does not support pause autonegotiation so it should return
-EINVAL when the function is called with non-zero autoneg.

Cc: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

index e22f24f784fcead5e40102951ca6d00cbcfba2f5..35ff2925110a3f690098e62ab73a3321965be17f 100644 (file)
@@ -487,6 +487,9 @@ static int mlx4_en_set_pauseparam(struct net_device *dev,
        struct mlx4_en_dev *mdev = priv->mdev;
        int err;
 
+       if (pause->autoneg)
+               return -EINVAL;
+
        priv->prof->tx_pause = pause->tx_pause != 0;
        priv->prof->rx_pause = pause->rx_pause != 0;
        err = mlx4_SET_PORT_general(mdev->dev, priv->port,