aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/en_ethtool.c
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2011-07-07 15:19:29 -0400
committerRoland Dreier <roland@purestorage.com>2011-07-19 00:04:32 -0400
commitccf863219675aa86bebdd6a2806acb8176478e37 (patch)
tree3ef252eb9b51ae6beb0ce0fbe1babdada8ceefb3 /drivers/net/mlx4/en_ethtool.c
parent52eafc68d601afd699b023201b0c6be5209f39ce (diff)
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 2e858e4dcf4d..eb096253d781 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,
104 int err = 0; 104 int err = 0;
105 u64 config = 0; 105 u64 config = 0;
106 106
107 if (!priv->mdev->dev->caps.wol) { 107 if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL)) {
108 wol->supported = 0; 108 wol->supported = 0;
109 wol->wolopts = 0; 109 wol->wolopts = 0;
110 return; 110 return;
@@ -134,7 +134,7 @@ static int mlx4_en_set_wol(struct net_device *netdev,
134 u64 config = 0; 134 u64 config = 0;
135 int err = 0; 135 int err = 0;
136 136
137 if (!priv->mdev->dev->caps.wol) 137 if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL))
138 return -EOPNOTSUPP; 138 return -EOPNOTSUPP;
139 139
140 if (wol->supported & ~WAKE_MAGIC) 140 if (wol->supported & ~WAKE_MAGIC)
@@ -170,7 +170,8 @@ static int mlx4_en_get_sset_count(struct net_device *dev, int sset)
170 return NUM_ALL_STATS + 170 return NUM_ALL_STATS +
171 (priv->tx_ring_num + priv->rx_ring_num) * 2; 171 (priv->tx_ring_num + priv->rx_ring_num) * 2;
172 case ETH_SS_TEST: 172 case ETH_SS_TEST:
173 return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.loopback_support) * 2; 173 return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags
174 & MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2;
174 default: 175 default:
175 return -EOPNOTSUPP; 176 return -EOPNOTSUPP;
176 } 177 }
@@ -220,7 +221,7 @@ static void mlx4_en_get_strings(struct net_device *dev,
220 case ETH_SS_TEST: 221 case ETH_SS_TEST:
221 for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++) 222 for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++)
222 strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]); 223 strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
223 if (priv->mdev->dev->caps.loopback_support) 224 if (priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UC_LOOPBACK)
224 for (; i < MLX4_EN_NUM_SELF_TEST; i++) 225 for (; i < MLX4_EN_NUM_SELF_TEST; i++)
225 strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]); 226 strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
226 break; 227 break;