Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6/btrfs-unstable.git] / net / smc / smc_ism.h
blobaee45b860b799856c80862bc36160618af17610b
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
7 */
9 #ifndef SMCD_ISM_H
10 #define SMCD_ISM_H
12 #include <linux/uio.h>
14 #include "smc.h"
16 struct smcd_dev_list { /* List of SMCD devices */
17 struct list_head list;
18 spinlock_t lock; /* Protects list of devices */
21 extern struct smcd_dev_list smcd_dev_list; /* list of smcd devices */
23 struct smc_ism_vlanid { /* VLAN id set on ISM device */
24 struct list_head list;
25 unsigned short vlanid; /* Vlan id */
26 refcount_t refcnt; /* Reference count */
29 struct smc_ism_position { /* ISM device position to write to */
30 u64 token; /* Token of DMB */
31 u32 offset; /* Offset into DMBE */
32 u8 index; /* Index of DMBE */
33 u8 signal; /* Generate interrupt on owner side */
36 struct smcd_dev;
38 int smc_ism_cantalk(u64 peer_gid, unsigned short vlan_id, struct smcd_dev *dev);
39 void smc_ism_set_conn(struct smc_connection *conn);
40 void smc_ism_unset_conn(struct smc_connection *conn);
41 int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
42 int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
43 int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
44 struct smc_buf_desc *dmb_desc);
45 int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
46 int smc_ism_write(struct smcd_dev *dev, const struct smc_ism_position *pos,
47 void *data, size_t len);
48 #endif