smc_ism.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifndef SMCD_ISM_H
  9. #define SMCD_ISM_H
  10. #include <linux/uio.h>
  11. #include "smc.h"
  12. struct smcd_dev_list { /* List of SMCD devices */
  13. struct list_head list;
  14. spinlock_t lock; /* Protects list of devices */
  15. };
  16. extern struct smcd_dev_list smcd_dev_list; /* list of smcd devices */
  17. struct smc_ism_vlanid { /* VLAN id set on ISM device */
  18. struct list_head list;
  19. unsigned short vlanid; /* Vlan id */
  20. refcount_t refcnt; /* Reference count */
  21. };
  22. struct smc_ism_position { /* ISM device position to write to */
  23. u64 token; /* Token of DMB */
  24. u32 offset; /* Offset into DMBE */
  25. u8 index; /* Index of DMBE */
  26. u8 signal; /* Generate interrupt on owner side */
  27. };
  28. struct smcd_dev;
  29. int smc_ism_cantalk(u64 peer_gid, unsigned short vlan_id, struct smcd_dev *dev);
  30. void smc_ism_set_conn(struct smc_connection *conn);
  31. void smc_ism_unset_conn(struct smc_connection *conn);
  32. int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
  33. int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
  34. int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
  35. struct smc_buf_desc *dmb_desc);
  36. int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
  37. int smc_ism_write(struct smcd_dev *dev, const struct smc_ism_position *pos,
  38. void *data, size_t len);
  39. #endif