aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/cmd.c
diff options
context:
space:
mode:
authorYonatan Cohen <yonatanc@mellanox.com>2018-06-19 08:47:22 +0300
committerLeon Romanovsky <leonro@mellanox.com>2018-07-04 21:51:07 +0300
commit4d4fb5dc988a36307711be292bde6e39b8bdbceb (patch)
tree58d181b991bc744bf390098238209fd2cacf4f28 /drivers/infiniband/hw/mlx5/cmd.c
parentnet/mlx5: Rate limit errors in command interface (diff)
downloadlinux-dev-4d4fb5dc988a36307711be292bde6e39b8bdbceb.tar.xz
linux-dev-4d4fb5dc988a36307711be292bde6e39b8bdbceb.zip
net/mlx5: Limit scope of dump_fill_mkey function
mlx5_core_dump_fill_mkey() is going to be used in next patch in IB and doesn't need to be visible to whole mlx5_core. Move that command to mlx5_ib. Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/cmd.c')
-rw-r--r--drivers/infiniband/hw/mlx5/cmd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/cmd.c b/drivers/infiniband/hw/mlx5/cmd.c
index 188512bf46e6..ccc0b5d06a7d 100644
--- a/drivers/infiniband/hw/mlx5/cmd.c
+++ b/drivers/infiniband/hw/mlx5/cmd.c
@@ -32,6 +32,21 @@
#include "cmd.h"
+int mlx5_cmd_dump_fill_mkey(struct mlx5_core_dev *dev, u32 *mkey)
+{
+ u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {0};
+ u32 in[MLX5_ST_SZ_DW(query_special_contexts_in)] = {0};
+ int err;
+
+ MLX5_SET(query_special_contexts_in, in, opcode,
+ MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
+ err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
+ if (!err)
+ *mkey = MLX5_GET(query_special_contexts_out, out,
+ dump_fill_mkey);
+ return err;
+}
+
int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey)
{
u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {};