1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Shared Memory Communications Direct over ISM devices (SMC-D)
4 * SMC-D ISM device structure definitions.
6 * Copyright IBM Corp. 2018
12 #include <linux/uio.h>
13 #include <linux/mutex.h>
17 struct smcd_dev_list { /* List of SMCD devices */
18 struct list_head list;
19 struct mutex mutex; /* Protects list of devices */
22 extern struct smcd_dev_list smcd_dev_list; /* list of smcd devices */
23 extern bool smc_ism_v2_capable; /* HW supports ISM V2 and thus
24 * System EID is defined
27 struct smc_ism_vlanid { /* VLAN id set on ISM device */
28 struct list_head list;
29 unsigned short vlanid; /* Vlan id */
30 refcount_t refcnt; /* Reference count */
33 struct smc_ism_position { /* ISM device position to write to */
34 u64 token; /* Token of DMB */
35 u32 offset; /* Offset into DMBE */
36 u8 index; /* Index of DMBE */
37 u8 signal; /* Generate interrupt on owner side */
42 int smc_ism_cantalk(u64 peer_gid, unsigned short vlan_id, struct smcd_dev *dev);
43 void smc_ism_set_conn(struct smc_connection *conn);
44 void smc_ism_unset_conn(struct smc_connection *conn);
45 int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
46 int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
47 int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
48 struct smc_buf_desc *dmb_desc);
49 int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
50 int smc_ism_write(struct smcd_dev *dev, const struct smc_ism_position *pos,
51 void *data, size_t len);
52 int smc_ism_signal_shutdown(struct smc_link_group *lgr);
53 void smc_ism_get_system_eid(struct smcd_dev *dev, u8 **eid);
54 u16 smc_ism_get_chid(struct smcd_dev *dev);
55 void smc_ism_init(void);