aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/core_priv.h
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2017-06-19 14:04:56 +0300
committerLeon Romanovsky <leon@kernel.org>2017-08-10 13:21:54 +0300
commit8030c8357a94ce6397dd8df6296925f0f4b1f9b7 (patch)
treecf311a3832440d76f745c72842ae03633d18552c /drivers/infiniband/core/core_priv.h
parentRDMA/netlink: Rename netlink callback struct (diff)
downloadlinux-dev-8030c8357a94ce6397dd8df6296925f0f4b1f9b7.tar.xz
linux-dev-8030c8357a94ce6397dd8df6296925f0f4b1f9b7.zip
RDMA/core: Add iterator over ib_devices
The coming nldev needs to iterate over all IB devices in the system and in order to not expose the ib_devices list outside the devices.c, it is necessary to provide function iterator. Current version is written explicitly for nldev callback to avoid over-engineering at this stage, but it can be easily extended for other types. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/core/core_priv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index e759c27113cd..0c175590cf92 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -102,6 +102,14 @@ void ib_enum_all_roce_netdevs(roce_netdev_filter filter,
roce_netdev_callback cb,
void *cookie);
+typedef int (*nldev_callback)(struct ib_device *device,
+ struct sk_buff *skb,
+ struct netlink_callback *cb,
+ unsigned int idx);
+
+int ib_enum_all_devs(nldev_callback nldev_cb, struct sk_buff *skb,
+ struct netlink_callback *cb);
+
enum ib_cache_gid_default_mode {
IB_CACHE_GID_DEFAULT_MODE_SET,
IB_CACHE_GID_DEFAULT_MODE_DELETE