Blame view

net/smc/smc_ism.h 1.76 KB
c6ba7c9ba   Hans Wippel   net/smc: add base...
1
2
3
4
5
6
7
8
9
10
11
12
  /* SPDX-License-Identifier: GPL-2.0 */
  /* Shared Memory Communications Direct over ISM devices (SMC-D)
   *
   * SMC-D ISM device structure definitions.
   *
   * Copyright IBM Corp. 2018
   */
  
  #ifndef SMCD_ISM_H
  #define SMCD_ISM_H
  
  #include <linux/uio.h>
82087c033   Ursula Braun   net/smc: switch s...
13
  #include <linux/mutex.h>
c6ba7c9ba   Hans Wippel   net/smc: add base...
14
15
16
17
18
  
  #include "smc.h"
  
  struct smcd_dev_list {	/* List of SMCD devices */
  	struct list_head list;
82087c033   Ursula Braun   net/smc: switch s...
19
  	struct mutex mutex;	/* Protects list of devices */
c6ba7c9ba   Hans Wippel   net/smc: add base...
20
  };
201091ebb   Ursula Braun   net/smc: introduc...
21
22
23
24
  extern struct smcd_dev_list	smcd_dev_list;	/* list of smcd devices */
  extern bool	smc_ism_v2_capable;	/* HW supports ISM V2 and thus
  					 * System EID is defined
  					 */
c6ba7c9ba   Hans Wippel   net/smc: add base...
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  
  struct smc_ism_vlanid {			/* VLAN id set on ISM device */
  	struct list_head list;
  	unsigned short vlanid;		/* Vlan id */
  	refcount_t refcnt;		/* Reference count */
  };
  
  struct smc_ism_position {	/* ISM device position to write to */
  	u64 token;		/* Token of DMB */
  	u32 offset;		/* Offset into DMBE */
  	u8 index;		/* Index of DMBE */
  	u8 signal;		/* Generate interrupt on owner side */
  };
  
  struct smcd_dev;
  
  int smc_ism_cantalk(u64 peer_gid, unsigned short vlan_id, struct smcd_dev *dev);
  void smc_ism_set_conn(struct smc_connection *conn);
  void smc_ism_unset_conn(struct smc_connection *conn);
  int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
  int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
  int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
  			 struct smc_buf_desc *dmb_desc);
  int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
  int smc_ism_write(struct smcd_dev *dev, const struct smc_ism_position *pos,
  		  void *data, size_t len);
0512f69e3   Hans Wippel   net/smc: add SMC-...
51
  int smc_ism_signal_shutdown(struct smc_link_group *lgr);
201091ebb   Ursula Braun   net/smc: introduc...
52
  void smc_ism_get_system_eid(struct smcd_dev *dev, u8 **eid);
8caaccf52   Ursula Braun   net/smc: introduc...
53
  u16 smc_ism_get_chid(struct smcd_dev *dev);
201091ebb   Ursula Braun   net/smc: introduc...
54
  void smc_ism_init(void);
c6ba7c9ba   Hans Wippel   net/smc: add base...
55
  #endif