#ifndef __PVRDMA_H__
#define __PVRDMA_H__
#include <linux/compiler.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/pci.h>
#include <linux/semaphore.h>
#include <linux/workqueue.h>
#include <rdma/ib_umem.h>
#include <rdma/ib_verbs.h>
#include <rdma/vmw_pvrdma-abi.h>
#include "pvrdma_ring.h"
#include "pvrdma_dev_api.h"
#include "pvrdma_verbs.h"
#define PVRDMA_MASK(n) …
#define PCI_DEVICE_ID_VMWARE_PVRDMA …
#define PVRDMA_NUM_RING_PAGES …
#define PVRDMA_QP_NUM_HEADER_PAGES …
struct pvrdma_dev;
struct pvrdma_page_dir { … };
struct pvrdma_cq { … };
struct pvrdma_id_table { … };
struct pvrdma_uar_map { … };
struct pvrdma_uar_table { … };
struct pvrdma_ucontext { … };
struct pvrdma_pd { … };
struct pvrdma_mr { … };
struct pvrdma_user_mr { … };
struct pvrdma_wq { … };
struct pvrdma_ah { … };
struct pvrdma_srq { … };
struct pvrdma_qp { … };
struct pvrdma_dev { … };
struct pvrdma_netdevice_work { … };
static inline struct pvrdma_dev *to_vdev(struct ib_device *ibdev)
{ … }
static inline struct
pvrdma_ucontext *to_vucontext(struct ib_ucontext *ibucontext)
{ … }
static inline struct pvrdma_pd *to_vpd(struct ib_pd *ibpd)
{ … }
static inline struct pvrdma_cq *to_vcq(struct ib_cq *ibcq)
{ … }
static inline struct pvrdma_srq *to_vsrq(struct ib_srq *ibsrq)
{ … }
static inline struct pvrdma_user_mr *to_vmr(struct ib_mr *ibmr)
{ … }
static inline struct pvrdma_qp *to_vqp(struct ib_qp *ibqp)
{ … }
static inline struct pvrdma_ah *to_vah(struct ib_ah *ibah)
{ … }
static inline void pvrdma_write_reg(struct pvrdma_dev *dev, u32 reg, u32 val)
{ … }
static inline u32 pvrdma_read_reg(struct pvrdma_dev *dev, u32 reg)
{ … }
static inline void pvrdma_write_uar_cq(struct pvrdma_dev *dev, u32 val)
{ … }
static inline void pvrdma_write_uar_qp(struct pvrdma_dev *dev, u32 val)
{ … }
static inline void *pvrdma_page_dir_get_ptr(struct pvrdma_page_dir *pdir,
u64 offset)
{ … }
static inline enum pvrdma_mtu ib_mtu_to_pvrdma(enum ib_mtu mtu)
{ … }
static inline enum ib_mtu pvrdma_mtu_to_ib(enum pvrdma_mtu mtu)
{ … }
static inline enum pvrdma_port_state ib_port_state_to_pvrdma(
enum ib_port_state state)
{ … }
static inline enum ib_port_state pvrdma_port_state_to_ib(
enum pvrdma_port_state state)
{ … }
static inline int pvrdma_port_cap_flags_to_ib(int flags)
{ … }
static inline enum pvrdma_port_width ib_port_width_to_pvrdma(
enum ib_port_width width)
{ … }
static inline enum ib_port_width pvrdma_port_width_to_ib(
enum pvrdma_port_width width)
{ … }
static inline enum pvrdma_port_speed ib_port_speed_to_pvrdma(
enum ib_port_speed speed)
{ … }
static inline enum ib_port_speed pvrdma_port_speed_to_ib(
enum pvrdma_port_speed speed)
{ … }
static inline int ib_qp_attr_mask_to_pvrdma(int attr_mask)
{ … }
static inline enum pvrdma_mig_state ib_mig_state_to_pvrdma(
enum ib_mig_state state)
{ … }
static inline enum ib_mig_state pvrdma_mig_state_to_ib(
enum pvrdma_mig_state state)
{ … }
static inline int ib_access_flags_to_pvrdma(int flags)
{ … }
static inline int pvrdma_access_flags_to_ib(int flags)
{ … }
static inline enum pvrdma_qp_type ib_qp_type_to_pvrdma(enum ib_qp_type type)
{ … }
static inline enum pvrdma_qp_state ib_qp_state_to_pvrdma(enum ib_qp_state state)
{ … }
static inline enum ib_qp_state pvrdma_qp_state_to_ib(enum pvrdma_qp_state state)
{ … }
static inline enum pvrdma_wr_opcode ib_wr_opcode_to_pvrdma(enum ib_wr_opcode op)
{ … }
static inline enum ib_wc_status pvrdma_wc_status_to_ib(
enum pvrdma_wc_status status)
{ … }
static inline int pvrdma_wc_opcode_to_ib(unsigned int opcode)
{ … }
static inline int pvrdma_wc_flags_to_ib(int flags)
{ … }
static inline int ib_send_flags_to_pvrdma(int flags)
{ … }
static inline int pvrdma_network_type_to_ib(enum pvrdma_network_type type)
{ … }
void pvrdma_qp_cap_to_ib(struct ib_qp_cap *dst,
const struct pvrdma_qp_cap *src);
void ib_qp_cap_to_pvrdma(struct pvrdma_qp_cap *dst,
const struct ib_qp_cap *src);
void pvrdma_gid_to_ib(union ib_gid *dst, const union pvrdma_gid *src);
void ib_gid_to_pvrdma(union pvrdma_gid *dst, const union ib_gid *src);
void pvrdma_global_route_to_ib(struct ib_global_route *dst,
const struct pvrdma_global_route *src);
void ib_global_route_to_pvrdma(struct pvrdma_global_route *dst,
const struct ib_global_route *src);
void pvrdma_ah_attr_to_rdma(struct rdma_ah_attr *dst,
const struct pvrdma_ah_attr *src);
void rdma_ah_attr_to_pvrdma(struct pvrdma_ah_attr *dst,
const struct rdma_ah_attr *src);
u8 ib_gid_type_to_pvrdma(enum ib_gid_type gid_type);
int pvrdma_uar_table_init(struct pvrdma_dev *dev);
void pvrdma_uar_table_cleanup(struct pvrdma_dev *dev);
int pvrdma_uar_alloc(struct pvrdma_dev *dev, struct pvrdma_uar_map *uar);
void pvrdma_uar_free(struct pvrdma_dev *dev, struct pvrdma_uar_map *uar);
void _pvrdma_flush_cqe(struct pvrdma_qp *qp, struct pvrdma_cq *cq);
int pvrdma_page_dir_init(struct pvrdma_dev *dev, struct pvrdma_page_dir *pdir,
u64 npages, bool alloc_pages);
void pvrdma_page_dir_cleanup(struct pvrdma_dev *dev,
struct pvrdma_page_dir *pdir);
int pvrdma_page_dir_insert_dma(struct pvrdma_page_dir *pdir, u64 idx,
dma_addr_t daddr);
int pvrdma_page_dir_insert_umem(struct pvrdma_page_dir *pdir,
struct ib_umem *umem, u64 offset);
dma_addr_t pvrdma_page_dir_get_dma(struct pvrdma_page_dir *pdir, u64 idx);
int pvrdma_page_dir_insert_page_list(struct pvrdma_page_dir *pdir,
u64 *page_list, int num_pages);
int pvrdma_cmd_post(struct pvrdma_dev *dev, union pvrdma_cmd_req *req,
union pvrdma_cmd_resp *rsp, unsigned resp_code);
#endif