Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277977
b: refs/heads/master
c: 559a9f1
h: refs/heads/master
i:
  277975: faf0b9b
v: v3
  • Loading branch information
Oren Duer authored and David S. Miller committed Nov 27, 2011
1 parent 6e33183 commit abed046
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0ab34f011d805ce5b1a341409c9c26f0fc8252b
refs/heads/master: 559a9f1d354b577af28f84181751820ff7d29feb
20 changes: 18 additions & 2 deletions trunk/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,17 @@ static void mlx4_en_get_wol(struct net_device *netdev,
struct mlx4_en_priv *priv = netdev_priv(netdev);
int err = 0;
u64 config = 0;
u64 mask;

if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL)) {
if ((priv->port < 1) || (priv->port > 2)) {
en_err(priv, "Failed to get WoL information\n");
return;
}

mask = (priv->port == 1) ? MLX4_DEV_CAP_FLAG_WOL_PORT1 :
MLX4_DEV_CAP_FLAG_WOL_PORT2;

if (!(priv->mdev->dev->caps.flags & mask)) {
wol->supported = 0;
wol->wolopts = 0;
return;
Expand Down Expand Up @@ -136,8 +145,15 @@ static int mlx4_en_set_wol(struct net_device *netdev,
struct mlx4_en_priv *priv = netdev_priv(netdev);
u64 config = 0;
int err = 0;
u64 mask;

if ((priv->port < 1) || (priv->port > 2))
return -EOPNOTSUPP;

mask = (priv->port == 1) ? MLX4_DEV_CAP_FLAG_WOL_PORT1 :
MLX4_DEV_CAP_FLAG_WOL_PORT2;

if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL))
if (!(priv->mdev->dev->caps.flags & mask))
return -EOPNOTSUPP;

if (wol->supported & ~WAKE_MAGIC)
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/mlx4/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ enum {
MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30,
MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32,
MLX4_DEV_CAP_FLAG_FCS_KEEP = 1LL << 34,
MLX4_DEV_CAP_FLAG_WOL = 1LL << 38,
MLX4_DEV_CAP_FLAG_WOL_PORT1 = 1LL << 37,
MLX4_DEV_CAP_FLAG_WOL_PORT2 = 1LL << 38,
MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40,
MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42,
Expand Down

0 comments on commit abed046

Please sign in to comment.