#include <rdma/ib_mad.h>
#include <rdma/ib_user_verbs.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/utsname.h>
#include <linux/rculist.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <rdma/rdma_vt.h>
#include "qib.h"
#include "qib_common.h"
static unsigned int ib_qib_qp_table_size = …;
module_param_named(qp_table_size, ib_qib_qp_table_size, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned int qib_lkey_table_size = …;
module_param_named(lkey_table_size, qib_lkey_table_size, uint,
S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned int ib_qib_max_pds = …;
module_param_named(max_pds, ib_qib_max_pds, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned int ib_qib_max_ahs = …;
module_param_named(max_ahs, ib_qib_max_ahs, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_cqes = …;
module_param_named(max_cqes, ib_qib_max_cqes, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_cqs = …;
module_param_named(max_cqs, ib_qib_max_cqs, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_qp_wrs = …;
module_param_named(max_qp_wrs, ib_qib_max_qp_wrs, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_qps = …;
module_param_named(max_qps, ib_qib_max_qps, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_sges = …;
module_param_named(max_sges, ib_qib_max_sges, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_mcast_grps = …;
module_param_named(max_mcast_grps, ib_qib_max_mcast_grps, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_mcast_qp_attached = …;
module_param_named(max_mcast_qp_attached, ib_qib_max_mcast_qp_attached,
uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_srqs = …;
module_param_named(max_srqs, ib_qib_max_srqs, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_srq_sges = …;
module_param_named(max_srq_sges, ib_qib_max_srq_sges, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
unsigned int ib_qib_max_srq_wrs = …;
module_param_named(max_srq_wrs, ib_qib_max_srq_wrs, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned int ib_qib_disable_sma;
module_param_named(disable_sma, ib_qib_disable_sma, uint, S_IWUSR | S_IRUGO);
MODULE_PARM_DESC(…) …;
const enum ib_wc_opcode ib_qib_wc_opcode[] = …;
__be64 ib_qib_sys_image_guid;
static u32 qib_count_sge(struct rvt_sge_state *ss, u32 length)
{ … }
static void qib_copy_from_sge(void *data, struct rvt_sge_state *ss, u32 length)
{ … }
static void qib_qp_rcv(struct qib_ctxtdata *rcd, struct ib_header *hdr,
int has_grh, void *data, u32 tlen, struct rvt_qp *qp)
{ … }
void qib_ib_rcv(struct qib_ctxtdata *rcd, void *rhdr, void *data, u32 tlen)
{ … }
static void mem_timer(struct timer_list *t)
{ … }
#ifdef __LITTLE_ENDIAN
static inline u32 get_upper_bits(u32 data, u32 shift)
{ … }
static inline u32 set_upper_bits(u32 data, u32 shift)
{ … }
static inline u32 clear_upper_bytes(u32 data, u32 n, u32 off)
{ … }
#else
static inline u32 get_upper_bits(u32 data, u32 shift)
{
return data << shift;
}
static inline u32 set_upper_bits(u32 data, u32 shift)
{
return data >> shift;
}
static inline u32 clear_upper_bytes(u32 data, u32 n, u32 off)
{
data >>= ((sizeof(u32) - n) * BITS_PER_BYTE);
data <<= ((sizeof(u32) - n - off) * BITS_PER_BYTE);
return data;
}
#endif
static void qib_copy_io(u32 __iomem *piobuf, struct rvt_sge_state *ss,
u32 length, unsigned flush_wc)
{ … }
static noinline struct qib_verbs_txreq *__get_txreq(struct qib_ibdev *dev,
struct rvt_qp *qp)
{ … }
static inline struct qib_verbs_txreq *get_txreq(struct qib_ibdev *dev,
struct rvt_qp *qp)
{ … }
void qib_put_txreq(struct qib_verbs_txreq *tx)
{ … }
void qib_verbs_sdma_desc_avail(struct qib_pportdata *ppd, unsigned avail)
{ … }
static void sdma_complete(struct qib_sdma_txreq *cookie, int status)
{ … }
static int wait_kmem(struct qib_ibdev *dev, struct rvt_qp *qp)
{ … }
static int qib_verbs_send_dma(struct rvt_qp *qp, struct ib_header *hdr,
u32 hdrwords, struct rvt_sge_state *ss, u32 len,
u32 plen, u32 dwords)
{ … }
static int no_bufs_available(struct rvt_qp *qp)
{ … }
static int qib_verbs_send_pio(struct rvt_qp *qp, struct ib_header *ibhdr,
u32 hdrwords, struct rvt_sge_state *ss, u32 len,
u32 plen, u32 dwords)
{ … }
int qib_verbs_send(struct rvt_qp *qp, struct ib_header *hdr,
u32 hdrwords, struct rvt_sge_state *ss, u32 len)
{ … }
int qib_snapshot_counters(struct qib_pportdata *ppd, u64 *swords,
u64 *rwords, u64 *spkts, u64 *rpkts,
u64 *xmit_wait)
{ … }
int qib_get_counters(struct qib_pportdata *ppd,
struct qib_verbs_counters *cntrs)
{ … }
void qib_ib_piobufavail(struct qib_devdata *dd)
{ … }
static int qib_query_port(struct rvt_dev_info *rdi, u32 port_num,
struct ib_port_attr *props)
{ … }
static int qib_modify_device(struct ib_device *device,
int device_modify_mask,
struct ib_device_modify *device_modify)
{ … }
static int qib_shut_down_port(struct rvt_dev_info *rdi, u32 port_num)
{ … }
static int qib_get_guid_be(struct rvt_dev_info *rdi, struct rvt_ibport *rvp,
int guid_index, __be64 *guid)
{ … }
int qib_check_ah(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr)
{ … }
static void qib_notify_new_ah(struct ib_device *ibdev,
struct rdma_ah_attr *ah_attr,
struct rvt_ah *ah)
{ … }
struct ib_ah *qib_create_qp0_ah(struct qib_ibport *ibp, u16 dlid)
{ … }
unsigned qib_get_npkeys(struct qib_devdata *dd)
{ … }
unsigned qib_get_pkey(struct qib_ibport *ibp, unsigned index)
{ … }
static void init_ibport(struct qib_pportdata *ppd)
{ … }
static void qib_fill_device_attr(struct qib_devdata *dd)
{ … }
static const struct ib_device_ops qib_dev_ops = …;
int qib_register_ib_device(struct qib_devdata *dd)
{ … }
void qib_unregister_ib_device(struct qib_devdata *dd)
{ … }
bool _qib_schedule_send(struct rvt_qp *qp)
{ … }
bool qib_schedule_send(struct rvt_qp *qp)
{ … }