summaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/en_ethtool.c
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2011-07-07 19:19:29 +0000
committerRoland Dreier <roland@purestorage.com>2011-07-18 21:04:32 -0700
commitccf863219675aa86bebdd6a2806acb8176478e37 (patch)
tree3ef252eb9b51ae6beb0ce0fbe1babdada8ceefb3 /drivers/net/mlx4/en_ethtool.c
parent52eafc68d601afd699b023201b0c6be5209f39ce (diff)
downloadop-kernel-dev-ccf863219675aa86bebdd6a2806acb8176478e37.zip
op-kernel-dev-ccf863219675aa86bebdd6a2806acb8176478e37.tar.gz
mlx4_core: Read extended capabilities into the flags field
Query another dword containing up to 32 extended device capabilities and merge it into struct mlx4_caps.flags. Update the code that handles the current extended device capabilities (e.g UDP RSS, WoL, vep steering, etc) to use the extended device cap flags field instead of a field per extended capability. Initial patch done by Eli Cohen <eli@mellanox.co.il>. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.co.il> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/mlx4/en_ethtool.c')
-rw-r--r--drivers/net/mlx4/en_ethtool.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c
index 2e858e4..eb09625 100644
--- a/drivers/net/mlx4/en_ethtool.c
+++ b/drivers/net/mlx4/en_ethtool.c
@@ -104,7 +104,7 @@ static void mlx4_en_get_wol(struct net_device *netdev,
int err = 0;
u64 config = 0;
- if (!priv->mdev->dev->caps.wol) {
+ if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL)) {
wol->supported = 0;
wol->wolopts = 0;
return;
@@ -134,7 +134,7 @@ static int mlx4_en_set_wol(struct net_device *netdev,
u64 config = 0;
int err = 0;
- if (!priv->mdev->dev->caps.wol)
+ if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL))
return -EOPNOTSUPP;
if (wol->supported & ~WAKE_MAGIC)
@@ -170,7 +170,8 @@ static int mlx4_en_get_sset_count(struct net_device *dev, int sset)
return NUM_ALL_STATS +
(priv->tx_ring_num + priv->rx_ring_num) * 2;
case ETH_SS_TEST:
- return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.loopback_support) * 2;
+ return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags
+ & MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2;
default:
return -EOPNOTSUPP;
}
@@ -220,7 +221,7 @@ static void mlx4_en_get_strings(struct net_device *dev,
case ETH_SS_TEST:
for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++)
strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
- if (priv->mdev->dev->caps.loopback_support)
+ if (priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UC_LOOPBACK)
for (; i < MLX4_EN_NUM_SELF_TEST; i++)
strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
break;
OpenPOWER on IntegriCloud