#ifndef _SMC_CORE_H
#define _SMC_CORE_H
#include <linux/atomic.h>
#include <linux/smc.h>
#include <linux/pci.h>
#include <rdma/ib_verbs.h>
#include <net/genetlink.h>
#include <net/smc.h>
#include "smc.h"
#include "smc_ib.h"
#include "smc_clc.h"
#define SMC_RMBS_PER_LGR_MAX …
#define SMC_CONN_PER_LGR_MIN …
#define SMC_CONN_PER_LGR_MAX …
#define SMC_CONN_PER_LGR_PREFER …
struct smc_lgr_list { … };
enum smc_lgr_role { … };
enum smc_link_state { … };
#define SMC_WR_BUF_SIZE …
#define SMC_WR_BUF_V2_SIZE …
struct smc_wr_buf { … };
struct smc_wr_v2_buf { … };
#define SMC_WR_REG_MR_WAIT_TIME …
enum smc_wr_reg_state { … };
struct smc_rdma_sge { … };
#define SMC_MAX_RDMA_WRITES …
struct smc_rdma_sges { … };
struct smc_rdma_wr { … };
#define SMC_LGR_ID_SIZE …
struct smc_link { … };
#define SMC_LINKS_PER_LGR_MAX …
#define SMC_SINGLE_LINK …
#define SMC_LINKS_ADD_LNK_MIN …
#define SMC_LINKS_ADD_LNK_MAX …
#define SMC_LINKS_PER_LGR_MAX_PREFER …
struct smc_buf_desc { … };
struct smc_rtoken { … };
#define SMC_BUF_MIN_SIZE …
#define SMC_RMBE_SIZES …
struct smcd_dev;
enum smc_lgr_type { … };
enum smcr_buf_type { … };
enum smc_llc_flowtype { … };
struct smc_llc_qentry;
struct smc_llc_flow { … };
struct smc_link_group { … };
struct smc_clc_msg_local;
#define GID_LIST_SIZE …
struct smc_gidlist { … };
struct smc_init_info_smcrv2 { … };
#define SMC_MAX_V2_ISM_DEVS …
struct smc_init_info { … };
static inline struct smc_connection *smc_lgr_find_conn(
u32 token, struct smc_link_group *lgr)
{ … }
static inline bool smc_conn_lgr_valid(struct smc_connection *conn)
{ … }
static inline bool smc_link_usable(struct smc_link *lnk)
{ … }
static inline bool smc_link_sendable(struct smc_link *lnk)
{ … }
static inline bool smc_link_active(struct smc_link *lnk)
{ … }
static inline void smc_gid_be16_convert(__u8 *buf, u8 *gid_raw)
{ … }
struct smc_pci_dev { … };
static inline void smc_set_pci_values(struct pci_dev *pci_dev,
struct smc_pci_dev *smc_dev)
{ … }
struct smc_sock;
struct smc_clc_msg_accept_confirm;
void smc_lgr_cleanup_early(struct smc_link_group *lgr);
void smc_lgr_terminate_sched(struct smc_link_group *lgr);
void smc_lgr_hold(struct smc_link_group *lgr);
void smc_lgr_put(struct smc_link_group *lgr);
void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport);
void smcr_port_err(struct smc_ib_device *smcibdev, u8 ibport);
void smc_smcd_terminate(struct smcd_dev *dev, struct smcd_gid *peer_gid,
unsigned short vlan);
void smc_smcd_terminate_all(struct smcd_dev *dev);
void smc_smcr_terminate_all(struct smc_ib_device *smcibdev);
int smc_buf_create(struct smc_sock *smc, bool is_smcd);
int smcd_buf_attach(struct smc_sock *smc);
int smc_uncompress_bufsize(u8 compressed);
int smc_rmb_rtoken_handling(struct smc_connection *conn, struct smc_link *link,
struct smc_clc_msg_accept_confirm *clc);
int smc_rtoken_add(struct smc_link *lnk, __be64 nw_vaddr, __be32 nw_rkey);
int smc_rtoken_delete(struct smc_link *lnk, __be32 nw_rkey);
void smc_rtoken_set(struct smc_link_group *lgr, int link_idx, int link_idx_new,
__be32 nw_rkey_known, __be64 nw_vaddr, __be32 nw_rkey);
void smc_rtoken_set2(struct smc_link_group *lgr, int rtok_idx, int link_id,
__be64 nw_vaddr, __be32 nw_rkey);
void smc_sndbuf_sync_sg_for_device(struct smc_connection *conn);
void smc_rmb_sync_sg_for_cpu(struct smc_connection *conn);
int smc_vlan_by_tcpsk(struct socket *clcsock, struct smc_init_info *ini);
void smc_conn_free(struct smc_connection *conn);
int smc_conn_create(struct smc_sock *smc, struct smc_init_info *ini);
int smc_core_init(void);
void smc_core_exit(void);
int smcr_link_init(struct smc_link_group *lgr, struct smc_link *lnk,
u8 link_idx, struct smc_init_info *ini);
void smcr_link_clear(struct smc_link *lnk, bool log);
void smcr_link_hold(struct smc_link *lnk);
void smcr_link_put(struct smc_link *lnk);
void smc_switch_link_and_count(struct smc_connection *conn,
struct smc_link *to_lnk);
int smcr_buf_map_lgr(struct smc_link *lnk);
int smcr_buf_reg_lgr(struct smc_link *lnk);
void smcr_lgr_set_type(struct smc_link_group *lgr, enum smc_lgr_type new_type);
void smcr_lgr_set_type_asym(struct smc_link_group *lgr,
enum smc_lgr_type new_type, int asym_lnk_idx);
int smcr_link_reg_buf(struct smc_link *link, struct smc_buf_desc *rmb_desc);
struct smc_link *smc_switch_conns(struct smc_link_group *lgr,
struct smc_link *from_lnk, bool is_dev_err);
void smcr_link_down_cond(struct smc_link *lnk);
void smcr_link_down_cond_sched(struct smc_link *lnk);
int smc_nl_get_sys_info(struct sk_buff *skb, struct netlink_callback *cb);
int smcr_nl_get_lgr(struct sk_buff *skb, struct netlink_callback *cb);
int smcr_nl_get_link(struct sk_buff *skb, struct netlink_callback *cb);
int smcd_nl_get_lgr(struct sk_buff *skb, struct netlink_callback *cb);
static inline struct smc_link_group *smc_get_lgr(struct smc_link *link)
{ … }
#endif