diff options
author | Yishai Hadas <yishaih@mellanox.com> | 2018-06-17 11:59:58 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-06-19 18:53:02 +0200 |
commit | e502a864c3526aa93b983d4b14e9615b3da430e6 (patch) | |
tree | 3b5fa3a8cf0bfecc984b144374bd0ab22fe06b27 /include/rdma/uverbs_named_ioctl.h | |
parent | IB/uverbs: Allow an empty namespace in ioctl() framework (diff) | |
download | linux-e502a864c3526aa93b983d4b14e9615b3da430e6.tar.xz linux-e502a864c3526aa93b983d4b14e9615b3da430e6.zip |
IB/core: Introduce DECLARE_UVERBS_GLOBAL_METHODS
Introduce a new macro to be used for global methods on a singleton
object.
This macros sets internally the type_attrs to be NULL as such an object
can't be created.
Downstream patches from this series will use this macro.
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_named_ioctl.h')
-rw-r--r-- | include/rdma/uverbs_named_ioctl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/rdma/uverbs_named_ioctl.h b/include/rdma/uverbs_named_ioctl.h index c5bb4ebdb0b0..228421f2a427 100644 --- a/include/rdma/uverbs_named_ioctl.h +++ b/include/rdma/uverbs_named_ioctl.h @@ -43,6 +43,7 @@ #define _UVERBS_NAME(x, y) _UVERBS_PASTE(x, y) #define UVERBS_METHOD(id) _UVERBS_NAME(UVERBS_MODULE_NAME, _method_##id) #define UVERBS_HANDLER(id) _UVERBS_NAME(UVERBS_MODULE_NAME, _handler_##id) +#define UVERBS_OBJECT(id) _UVERBS_NAME(UVERBS_MOUDLE_NAME, _object_##id) #define DECLARE_UVERBS_NAMED_METHOD(id, ...) \ DECLARE_UVERBS_METHOD(UVERBS_METHOD(id), id, UVERBS_HANDLER(id), ##__VA_ARGS__) @@ -56,6 +57,9 @@ #define DECLARE_UVERBS_NAMED_OBJECT(id, ...) \ DECLARE_UVERBS_OBJECT(UVERBS_OBJECT(id), id, ##__VA_ARGS__) +#define DECLARE_UVERBS_GLOBAL_METHODS(_name, ...) \ + DECLARE_UVERBS_NAMED_OBJECT(_name, NULL, ##__VA_ARGS__) + #define _UVERBS_COMP_NAME(x, y, z) _UVERBS_NAME(_UVERBS_NAME(x, y), z) #define UVERBS_NO_OVERRIDE NULL |