aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/fw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mlx4/fw.c')
-rw-r--r--drivers/net/mlx4/fw.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index 5de1db897835..fd1c51b6197a 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -276,6 +276,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
276 dev_cap->udp_rss = field & 0x1; 276 dev_cap->udp_rss = field & 0x1;
277 MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET); 277 MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET);
278 dev_cap->loopback_support = field & 0x1; 278 dev_cap->loopback_support = field & 0x1;
279 dev_cap->wol = field & 0x40;
279 MLX4_GET(dev_cap->flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET); 280 MLX4_GET(dev_cap->flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET);
280 MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET); 281 MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET);
281 dev_cap->reserved_uars = field >> 4; 282 dev_cap->reserved_uars = field >> 4;
@@ -908,3 +909,22 @@ int mlx4_NOP(struct mlx4_dev *dev)
908 /* Input modifier of 0x1f means "finish as soon as possible." */ 909 /* Input modifier of 0x1f means "finish as soon as possible." */
909 return mlx4_cmd(dev, 0, 0x1f, 0, MLX4_CMD_NOP, 100); 910 return mlx4_cmd(dev, 0, 0x1f, 0, MLX4_CMD_NOP, 100);
910} 911}
912
913#define MLX4_WOL_SETUP_MODE (5 << 28)
914int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port)
915{
916 u32 in_mod = MLX4_WOL_SETUP_MODE | port << 8;
917
918 return mlx4_cmd_imm(dev, 0, config, in_mod, 0x3,
919 MLX4_CMD_MOD_STAT_CFG, MLX4_CMD_TIME_CLASS_A);
920}
921EXPORT_SYMBOL_GPL(mlx4_wol_read);
922
923int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port)
924{
925 u32 in_mod = MLX4_WOL_SETUP_MODE | port << 8;
926
927 return mlx4_cmd(dev, config, in_mod, 0x1, MLX4_CMD_MOD_STAT_CFG,
928 MLX4_CMD_TIME_CLASS_A);
929}
930EXPORT_SYMBOL_GPL(mlx4_wol_write);