~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/smc/smc_ism.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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/types.h>
 14 #include <linux/mutex.h>
 15 
 16 #include "smc.h"
 17 
 18 #define SMC_EMULATED_ISM_CHID_MASK      0xFF00
 19 #define SMC_ISM_IDENT_MASK              0x00FFFF
 20 
 21 struct smcd_dev_list {  /* List of SMCD devices */
 22         struct list_head list;
 23         struct mutex mutex;     /* Protects list of devices */
 24 };
 25 
 26 extern struct smcd_dev_list     smcd_dev_list;  /* list of smcd devices */
 27 
 28 struct smc_ism_vlanid {                 /* VLAN id set on ISM device */
 29         struct list_head list;
 30         unsigned short vlanid;          /* Vlan id */
 31         refcount_t refcnt;              /* Reference count */
 32 };
 33 
 34 struct smc_ism_seid {
 35         u8 seid_string[24];
 36         u8 serial_number[4];
 37         u8 type[4];
 38 };
 39 
 40 struct smcd_dev;
 41 
 42 int smc_ism_cantalk(struct smcd_gid *peer_gid, unsigned short vlan_id,
 43                     struct smcd_dev *dev);
 44 void smc_ism_set_conn(struct smc_connection *conn);
 45 void smc_ism_unset_conn(struct smc_connection *conn);
 46 int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
 47 int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
 48 int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
 49                          struct smc_buf_desc *dmb_desc);
 50 int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
 51 bool smc_ism_support_dmb_nocopy(struct smcd_dev *smcd);
 52 int smc_ism_attach_dmb(struct smcd_dev *dev, u64 token,
 53                        struct smc_buf_desc *dmb_desc);
 54 int smc_ism_detach_dmb(struct smcd_dev *dev, u64 token);
 55 int smc_ism_signal_shutdown(struct smc_link_group *lgr);
 56 void smc_ism_get_system_eid(u8 **eid);
 57 u16 smc_ism_get_chid(struct smcd_dev *dev);
 58 bool smc_ism_is_v2_capable(void);
 59 void smc_ism_set_v2_capable(void);
 60 int smc_ism_init(void);
 61 void smc_ism_exit(void);
 62 int smcd_nl_get_device(struct sk_buff *skb, struct netlink_callback *cb);
 63 
 64 static inline int smc_ism_write(struct smcd_dev *smcd, u64 dmb_tok,
 65                                 unsigned int idx, bool sf, unsigned int offset,
 66                                 void *data, size_t len)
 67 {
 68         int rc;
 69 
 70         rc = smcd->ops->move_data(smcd, dmb_tok, idx, sf, offset, data, len);
 71         return rc < 0 ? rc : 0;
 72 }
 73 
 74 static inline bool __smc_ism_is_emulated(u16 chid)
 75 {
 76         /* CHIDs in range of 0xFF00 to 0xFFFF are reserved
 77          * for Emulated-ISM device.
 78          *
 79          * loopback-ism:        0xFFFF
 80          * virtio-ism:          0xFF00 ~ 0xFFFE
 81          */
 82         return ((chid & 0xFF00) == 0xFF00);
 83 }
 84 
 85 static inline bool smc_ism_is_emulated(struct smcd_dev *smcd)
 86 {
 87         u16 chid = smcd->ops->get_chid(smcd);
 88 
 89         return __smc_ism_is_emulated(chid);
 90 }
 91 
 92 static inline bool smc_ism_is_loopback(struct smcd_dev *smcd)
 93 {
 94         return (smcd->ops->get_chid(smcd) == 0xFFFF);
 95 }
 96 
 97 #endif
 98 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php