diff options
author | Guvenc Gulce <guvenc@linux.ibm.com> | 2020-12-01 20:20:48 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-01 17:56:13 -0800 |
commit | aaf95523d5824ebc2c8c185a2de51063a750c446 (patch) | |
tree | d41ca8f44a2fcc5fbef0a6d18fd1a3d65ef79057 /net/smc/smc_core.h | |
parent | 8f9dde4bf230f5c54a24c42a989dd9d88ec95695 (diff) |
net/smc: Add support for obtaining SMCD device list
Deliver SMCD device information via netlink based
diagnostic interface.
Signed-off-by: Guvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/smc/smc_core.h')
-rw-r--r-- | net/smc/smc_core.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h index 0b6899a7f634..e8e448771f85 100644 --- a/net/smc/smc_core.h +++ b/net/smc/smc_core.h @@ -13,6 +13,8 @@ #define _SMC_CORE_H #include <linux/atomic.h> +#include <linux/smc.h> +#include <linux/pci.h> #include <rdma/ib_verbs.h> #include <net/genetlink.h> @@ -380,6 +382,32 @@ static inline void smc_gid_be16_convert(__u8 *buf, u8 *gid_raw) be16_to_cpu(((__be16 *)gid_raw)[7])); } +struct smc_pci_dev { + __u32 pci_fid; + __u16 pci_pchid; + __u16 pci_vendor; + __u16 pci_device; + __u8 pci_id[SMC_PCI_ID_STR_LEN]; +}; + +static inline void smc_set_pci_values(struct pci_dev *pci_dev, + struct smc_pci_dev *smc_dev) +{ + smc_dev->pci_vendor = pci_dev->vendor; + smc_dev->pci_device = pci_dev->device; + snprintf(smc_dev->pci_id, sizeof(smc_dev->pci_id), "%s", + pci_name(pci_dev)); +#if IS_ENABLED(CONFIG_S390) + { /* Set s390 specific PCI information */ + struct zpci_dev *zdev; + + zdev = to_zpci(pci_dev); + smc_dev->pci_fid = zdev->fid; + smc_dev->pci_pchid = zdev->pchid; + } +#endif +} + struct smc_sock; struct smc_clc_msg_accept_confirm; struct smc_clc_msg_local; |