linux/include/rdma/rdma_vt.h

/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright(c) 2016 - 2019 Intel Corporation.
 */

#ifndef DEF_RDMA_VT_H
#define DEF_RDMA_VT_H

/*
 * Structure that low level drivers will populate in order to register with the
 * rdmavt layer.
 */

#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/hash.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_mad.h>
#include <rdma/rdmavt_mr.h>

#define RVT_MAX_PKEY_VALUES

#define RVT_MAX_TRAP_LEN
#define RVT_MAX_TRAP_LISTS
#define RVT_TRAP_TIMEOUT

struct trap_list {};

struct rvt_qp;
struct rvt_qpn_table;
struct rvt_ibport {};

#define RVT_CQN_MAX

#define RVT_SGE_COPY_MEMCPY
#define RVT_SGE_COPY_CACHELESS
#define RVT_SGE_COPY_ADAPTIVE

/*
 * Things that are driver specific, module parameters in hfi1 and qib
 */
struct rvt_driver_params {};

/* User context */
struct rvt_ucontext {};

/* Protection domain */
struct rvt_pd {};

/* Address handle */
struct rvt_ah {};

/*
 * This structure is used by rvt_mmap() to validate an offset
 * when an mmap() request is made.  The vm_area_struct then uses
 * this as its vm_private_data.
 */
struct rvt_mmap_info {};

/* memory working set size */
struct rvt_wss {};

struct rvt_dev_info;
struct rvt_swqe;
struct rvt_driver_provided {};

struct rvt_dev_info {};

/**
 * rvt_set_ibdev_name - Craft an IB device name from client info
 * @rdi: pointer to the client rvt_dev_info structure
 * @name: client specific name
 * @unit: client specific unit number.
 */
static inline void rvt_set_ibdev_name(struct rvt_dev_info *rdi,
				      const char *fmt, const char *name,
				      const int unit)
{}

/**
 * rvt_get_ibdev_name - return the IB name
 * @rdi: rdmavt device
 *
 * Return the registered name of the device.
 */
static inline const char *rvt_get_ibdev_name(const struct rvt_dev_info *rdi)
{}

static inline struct rvt_pd *ibpd_to_rvtpd(struct ib_pd *ibpd)
{}

static inline struct rvt_ah *ibah_to_rvtah(struct ib_ah *ibah)
{}

static inline struct rvt_dev_info *ib_to_rvt(struct ib_device *ibdev)
{}

static inline unsigned rvt_get_npkeys(struct rvt_dev_info *rdi)
{}

/*
 * Return the max atomic suitable for determining
 * the size of the ack ring buffer in a QP.
 */
static inline unsigned int rvt_max_atomic(struct rvt_dev_info *rdi)
{}

static inline unsigned int rvt_size_atomic(struct rvt_dev_info *rdi)
{}

/*
 * Return the indexed PKEY from the port PKEY table.
 */
static inline u16 rvt_get_pkey(struct rvt_dev_info *rdi,
			       int port_index,
			       unsigned index)
{}

struct rvt_dev_info *rvt_alloc_device(size_t size, int nports);
void rvt_dealloc_device(struct rvt_dev_info *rdi);
int rvt_register_device(struct rvt_dev_info *rvd);
void rvt_unregister_device(struct rvt_dev_info *rvd);
int rvt_check_ah(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr);
int rvt_init_port(struct rvt_dev_info *rdi, struct rvt_ibport *port,
		  int port_index, u16 *pkey_table);
int rvt_fast_reg_mr(struct rvt_qp *qp, struct ib_mr *ibmr, u32 key,
		    int access);
int rvt_invalidate_rkey(struct rvt_qp *qp, u32 rkey);
int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,
		u32 len, u64 vaddr, u32 rkey, int acc);
int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
		struct rvt_sge *isge, struct rvt_sge *last_sge,
		struct ib_sge *sge, int acc);
struct rvt_mcast *rvt_mcast_find(struct rvt_ibport *ibp, union ib_gid *mgid,
				 u16 lid);

#endif          /* DEF_RDMA_VT_H */