From 6884c6c4bd09fb35b79a3967d15821cdfcbe77a3 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Mon, 12 Nov 2018 22:59:55 +0200 Subject: 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 Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/rdma_core.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/infiniband/core/rdma_core.h') 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 * -- cgit v1.2.3-59-g8ed1b