aboutsummaryrefslogtreecommitdiffstats
path: root/net/smc/smc_ism.h
diff options
context:
space:
mode:
authorWe-unite <3205135446@qq.com>2025-03-08 22:04:20 +0800
committerWe-unite <3205135446@qq.com>2025-03-08 22:04:20 +0800
commita07bb8fd1299070229f0e8f3dcb57ffd5ef9870a (patch)
tree84f21bd0bf7071bc5fc7dd989e77d7ceb5476682 /net/smc/smc_ism.h
downloadohosKernel-a07bb8fd1299070229f0e8f3dcb57ffd5ef9870a.tar.gz
ohosKernel-a07bb8fd1299070229f0e8f3dcb57ffd5ef9870a.zip
Initial commit: OpenHarmony-v4.0-ReleaseOpenHarmony-v4.0-Release
Diffstat (limited to 'net/smc/smc_ism.h')
-rw-r--r--net/smc/smc_ism.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/net/smc/smc_ism.h b/net/smc/smc_ism.h
new file mode 100644
index 000000000..8048e09dd
--- /dev/null
+++ b/net/smc/smc_ism.h
@@ -0,0 +1,56 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Shared Memory Communications Direct over ISM devices (SMC-D)
3 *
4 * SMC-D ISM device structure definitions.
5 *
6 * Copyright IBM Corp. 2018
7 */
8
9#ifndef SMCD_ISM_H
10#define SMCD_ISM_H
11
12#include <linux/uio.h>
13#include <linux/mutex.h>
14
15#include "smc.h"
16
17struct smcd_dev_list { /* List of SMCD devices */
18 struct list_head list;
19 struct mutex mutex; /* Protects list of devices */
20};
21
22extern struct smcd_dev_list smcd_dev_list; /* list of smcd devices */
23extern bool smc_ism_v2_capable; /* HW supports ISM V2 and thus
24 * System EID is defined
25 */
26
27struct 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 */
31};
32
33struct 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 */
38};
39
40struct smcd_dev;
41
42int smc_ism_cantalk(u64 peer_gid, unsigned short vlan_id, struct smcd_dev *dev);
43void smc_ism_set_conn(struct smc_connection *conn);
44void smc_ism_unset_conn(struct smc_connection *conn);
45int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
46int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
47int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
48 struct smc_buf_desc *dmb_desc);
49int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
50int smc_ism_write(struct smcd_dev *dev, const struct smc_ism_position *pos,
51 void *data, size_t len);
52int smc_ism_signal_shutdown(struct smc_link_group *lgr);
53void smc_ism_get_system_eid(struct smcd_dev *dev, u8 **eid);
54u16 smc_ism_get_chid(struct smcd_dev *dev);
55void smc_ism_init(void);
56#endif