Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Thomas Richter | 6812baa | 2017-01-09 16:55:15 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Shared Memory Communications over RDMA (SMC-R) and RoCE |
| 4 | * |
| 5 | * PNET table queries |
| 6 | * |
| 7 | * Copyright IBM Corp. 2016 |
| 8 | * |
| 9 | * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com> |
| 10 | */ |
| 11 | |
| 12 | #ifndef _SMC_PNET_H |
| 13 | #define _SMC_PNET_H |
| 14 | |
Ursula Braun | 0afff91 | 2018-06-28 19:05:05 +0200 | [diff] [blame] | 15 | #if IS_ENABLED(CONFIG_HAVE_PNETID) |
| 16 | #include <asm/pnet.h> |
| 17 | #endif |
| 18 | |
Thomas Richter | 6812baa | 2017-01-09 16:55:15 +0100 | [diff] [blame] | 19 | struct smc_ib_device; |
Hans Wippel | 1619f77 | 2018-06-28 19:05:08 +0200 | [diff] [blame] | 20 | struct smcd_dev; |
Thomas Richter | 6812baa | 2017-01-09 16:55:15 +0100 | [diff] [blame] | 21 | |
Ursula Braun | 0afff91 | 2018-06-28 19:05:05 +0200 | [diff] [blame] | 22 | static inline int smc_pnetid_by_dev_port(struct device *dev, |
| 23 | unsigned short port, u8 *pnetid) |
| 24 | { |
| 25 | #if IS_ENABLED(CONFIG_HAVE_PNETID) |
| 26 | return pnet_id_by_dev_port(dev, port, pnetid); |
| 27 | #else |
| 28 | return -ENOENT; |
| 29 | #endif |
| 30 | } |
| 31 | |
Thomas Richter | 6812baa | 2017-01-09 16:55:15 +0100 | [diff] [blame] | 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); |
Thomas Richter | 6812baa | 2017-01-09 16:55:15 +0100 | [diff] [blame] | 35 | void smc_pnet_find_roce_resource(struct sock *sk, |
Ursula Braun | 7005ada | 2018-07-25 16:35:31 +0200 | [diff] [blame] | 36 | struct smc_ib_device **smcibdev, u8 *ibport, |
| 37 | unsigned short vlan_id, u8 gid[]); |
Hans Wippel | 1619f77 | 2018-06-28 19:05:08 +0200 | [diff] [blame] | 38 | void smc_pnet_find_ism_resource(struct sock *sk, struct smcd_dev **smcismdev); |
Thomas Richter | 6812baa | 2017-01-09 16:55:15 +0100 | [diff] [blame] | 39 | |
| 40 | #endif |