Merge tag 'md/4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
[linux-2.6/btrfs-unstable.git] / net / smc / smc_pnet.h
blob8ff777636e325f126d668d38edb2f66109216333
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Shared Memory Communications over RDMA (SMC-R) and RoCE
5 * PNET table queries
7 * Copyright IBM Corp. 2016
9 * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com>
12 #ifndef _SMC_PNET_H
13 #define _SMC_PNET_H
15 #if IS_ENABLED(CONFIG_HAVE_PNETID)
16 #include <asm/pnet.h>
17 #endif
19 struct smc_ib_device;
20 struct smcd_dev;
22 static inline int smc_pnetid_by_dev_port(struct device *dev,
23 unsigned short port, u8 *pnetid)
25 #if IS_ENABLED(CONFIG_HAVE_PNETID)
26 return pnet_id_by_dev_port(dev, port, pnetid);
27 #else
28 return -ENOENT;
29 #endif
32 int smc_pnet_init(void) __init;
33 void smc_pnet_exit(void);
34 int smc_pnet_remove_by_ibdev(struct smc_ib_device *ibdev);
35 void smc_pnet_find_roce_resource(struct sock *sk,
36 struct smc_ib_device **smcibdev, u8 *ibport,
37 unsigned short vlan_id, u8 gid[]);
38 void smc_pnet_find_ism_resource(struct sock *sk, struct smcd_dev **smcismdev);
40 #endif