aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/rdma_core.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-11-12 22:59:55 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-11-22 11:57:33 -0700
commit6884c6c4bd09fb35b79a3967d15821cdfcbe77a3 (patch)
tree3ffcf0458bde9b98536bcb979f1c96b0d0a402d5 /drivers/infiniband/core/rdma_core.h
parentRDMA/uverbs: Require all objects to have a driver destroy function (diff)
downloadlinux-dev-6884c6c4bd09fb35b79a3967d15821cdfcbe77a3.tar.xz
linux-dev-6884c6c4bd09fb35b79a3967d15821cdfcbe77a3.zip
RDMA/verbs: Store the write/write_ex uapi entry points in the uverbs_api
Bringing all uapi entry points into one place lets us deal with them consistently. For instance the write, write_ex and ioctl paths can be disabled when an API is not supported by the driver. This will replace the uverbs_cmd_table static arrays. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/rdma_core.h')
-rw-r--r--drivers/infiniband/core/rdma_core.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/infiniband/core/rdma_core.h b/drivers/infiniband/core/rdma_core.h
index 93da02c12c38..d36a0573c5e4 100644
--- a/drivers/infiniband/core/rdma_core.h
+++ b/drivers/infiniband/core/rdma_core.h
@@ -136,6 +136,15 @@ struct uverbs_api_ioctl_method {
u8 destroy_bkey;
};
+struct uverbs_api_write_method {
+ ssize_t (*handler)(struct ib_uverbs_file *file, const char __user *buf,
+ int in_len, int out_len);
+ int (*handler_ex)(struct ib_uverbs_file *file, struct ib_udata *ucore,
+ struct ib_udata *uhw);
+ u8 disabled:1;
+ u8 is_ex:1;
+};
+
struct uverbs_api_attr {
struct uverbs_attr_spec spec;
};
@@ -144,6 +153,12 @@ struct uverbs_api {
/* radix tree contains struct uverbs_api_* pointers */
struct radix_tree_root radix;
enum rdma_driver_id driver_id;
+
+ unsigned int num_write;
+ unsigned int num_write_ex;
+ struct uverbs_api_write_method notsupp_method;
+ const struct uverbs_api_write_method **write_methods;
+ const struct uverbs_api_write_method **write_ex_methods;
};
static inline const struct uverbs_api_object *