#ifndef _QIB_KERNEL_H
#define _QIB_KERNEL_H
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/fs.h>
#include <linux/completion.h>
#include <linux/kref.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/xarray.h>
#include <rdma/ib_hdrs.h>
#include <rdma/rdma_vt.h>
#include "qib_common.h"
#include "qib_verbs.h"
#define QIB_CHIP_VERS_MAJ …
#define QIB_CHIP_VERS_MIN …
#define QIB_OUI …
#define QIB_OUI_LSB …
struct qlogic_ib_stats { … };
extern struct qlogic_ib_stats qib_stats;
extern const struct pci_error_handlers qib_pci_err_handler;
#define QIB_CHIP_SWVERSION …
#define QIB_TRAFFIC_ACTIVE_THRESHOLD …
#ifdef CONFIG_DEBUG_FS
struct qib_opcode_stats_perctx;
#endif
struct qib_ctxtdata { … };
struct rvt_sge_state;
struct qib_sdma_txreq { … };
struct qib_sdma_desc { … };
struct qib_verbs_txreq { … };
#define QIB_SDMA_TXREQ_F_USELARGEBUF …
#define QIB_SDMA_TXREQ_F_HEADTOHOST …
#define QIB_SDMA_TXREQ_F_INTREQ …
#define QIB_SDMA_TXREQ_F_FREEBUF …
#define QIB_SDMA_TXREQ_F_FREEDESC …
#define QIB_SDMA_TXREQ_S_OK …
#define QIB_SDMA_TXREQ_S_SENDERROR …
#define QIB_SDMA_TXREQ_S_ABORTED …
#define QIB_SDMA_TXREQ_S_SHUTDOWN …
#define QIB_IB_CFG_LIDLMC …
#define QIB_IB_CFG_LWID_ENB …
#define QIB_IB_CFG_LWID …
#define QIB_IB_CFG_SPD_ENB …
#define QIB_IB_CFG_SPD …
#define QIB_IB_CFG_RXPOL_ENB …
#define QIB_IB_CFG_LREV_ENB …
#define QIB_IB_CFG_LINKLATENCY …
#define QIB_IB_CFG_HRTBT …
#define QIB_IB_CFG_OP_VLS …
#define QIB_IB_CFG_VL_HIGH_CAP …
#define QIB_IB_CFG_VL_LOW_CAP …
#define QIB_IB_CFG_OVERRUN_THRESH …
#define QIB_IB_CFG_PHYERR_THRESH …
#define QIB_IB_CFG_LINKDEFAULT …
#define QIB_IB_CFG_PKEYS …
#define QIB_IB_CFG_MTU …
#define QIB_IB_CFG_LSTATE …
#define QIB_IB_CFG_VL_HIGH_LIMIT …
#define QIB_IB_CFG_PMA_TICKS …
#define QIB_IB_CFG_PORT …
#define IB_LINKCMD_DOWN …
#define IB_LINKCMD_ARMED …
#define IB_LINKCMD_ACTIVE …
#define IB_LINKINITCMD_NOP …
#define IB_LINKINITCMD_POLL …
#define IB_LINKINITCMD_SLEEP …
#define IB_LINKINITCMD_DISABLE …
#define QIB_IB_LINKDOWN …
#define QIB_IB_LINKARM …
#define QIB_IB_LINKACTIVE …
#define QIB_IB_LINKDOWN_ONLY …
#define QIB_IB_LINKDOWN_SLEEP …
#define QIB_IB_LINKDOWN_DISABLE …
#define QIB_IB_SDR …
#define QIB_IB_DDR …
#define QIB_IB_QDR …
#define QIB_DEFAULT_MTU …
#define QIB_MAX_IB_PORTS …
#define QIB_IB_TBL_VL_HIGH_ARB …
#define QIB_IB_TBL_VL_LOW_ARB …
#define QIB_RCVCTRL_TAILUPD_ENB …
#define QIB_RCVCTRL_TAILUPD_DIS …
#define QIB_RCVCTRL_CTXT_ENB …
#define QIB_RCVCTRL_CTXT_DIS …
#define QIB_RCVCTRL_INTRAVAIL_ENB …
#define QIB_RCVCTRL_INTRAVAIL_DIS …
#define QIB_RCVCTRL_PKEY_ENB …
#define QIB_RCVCTRL_PKEY_DIS …
#define QIB_RCVCTRL_BP_ENB …
#define QIB_RCVCTRL_BP_DIS …
#define QIB_RCVCTRL_TIDFLOW_ENB …
#define QIB_RCVCTRL_TIDFLOW_DIS …
#define QIB_SENDCTRL_DISARM …
#define QIB_SENDCTRL_DISARM_BUF(bufn) …
#define QIB_SENDCTRL_AVAIL_DIS …
#define QIB_SENDCTRL_AVAIL_ENB …
#define QIB_SENDCTRL_AVAIL_BLIP …
#define QIB_SENDCTRL_SEND_DIS …
#define QIB_SENDCTRL_SEND_ENB …
#define QIB_SENDCTRL_FLUSH …
#define QIB_SENDCTRL_CLEAR …
#define QIB_SENDCTRL_DISARM_ALL …
#define QIBPORTCNTR_PKTSEND …
#define QIBPORTCNTR_WORDSEND …
#define QIBPORTCNTR_PSXMITDATA …
#define QIBPORTCNTR_PSXMITPKTS …
#define QIBPORTCNTR_PSXMITWAIT …
#define QIBPORTCNTR_SENDSTALL …
#define QIBPORTCNTR_PKTRCV …
#define QIBPORTCNTR_PSRCVDATA …
#define QIBPORTCNTR_PSRCVPKTS …
#define QIBPORTCNTR_RCVEBP …
#define QIBPORTCNTR_RCVOVFL …
#define QIBPORTCNTR_WORDRCV …
#define QIBPORTCNTR_RXLOCALPHYERR …
#define QIBPORTCNTR_RXVLERR …
#define QIBPORTCNTR_ERRICRC …
#define QIBPORTCNTR_ERRVCRC …
#define QIBPORTCNTR_ERRLPCRC …
#define QIBPORTCNTR_BADFORMAT …
#define QIBPORTCNTR_ERR_RLEN …
#define QIBPORTCNTR_IBSYMBOLERR …
#define QIBPORTCNTR_INVALIDRLEN …
#define QIBPORTCNTR_UNSUPVL …
#define QIBPORTCNTR_EXCESSBUFOVFL …
#define QIBPORTCNTR_ERRLINK …
#define QIBPORTCNTR_IBLINKDOWN …
#define QIBPORTCNTR_IBLINKERRRECOV …
#define QIBPORTCNTR_LLI …
#define QIBPORTCNTR_RXDROPPKT …
#define QIBPORTCNTR_VL15PKTDROP …
#define QIBPORTCNTR_ERRPKEY …
#define QIBPORTCNTR_KHDROVFL …
#define QIBPORTCNTR_PSINTERVAL …
#define QIBPORTCNTR_PSSTART …
#define QIBPORTCNTR_PSSTAT …
#define ACTIVITY_TIMER …
#define MAX_NAME_SIZE …
#ifdef CONFIG_INFINIBAND_QIB_DCA
struct qib_irq_notify;
#endif
struct qib_msix_entry { … };
struct qib_chip_specific;
struct qib_chipport_specific;
enum qib_sdma_states { … };
enum qib_sdma_events { … };
struct sdma_set_state_action { … };
struct qib_sdma_state { … };
struct xmit_wait { … };
struct qib_pportdata { … };
struct diag_observer;
diag_hook;
struct diag_observer { … };
extern int qib_register_observer(struct qib_devdata *dd,
const struct diag_observer *op);
struct diag_observer_list_elt;
struct qib_devdata { … };
#define QIB_HOL_UP …
#define QIB_HOL_INIT …
#define QIB_SDMA_SENDCTRL_OP_ENABLE …
#define QIB_SDMA_SENDCTRL_OP_INTENABLE …
#define QIB_SDMA_SENDCTRL_OP_HALT …
#define QIB_SDMA_SENDCTRL_OP_CLEANUP …
#define QIB_SDMA_SENDCTRL_OP_DRAIN …
#define TXCHK_CHG_TYPE_DIS1 …
#define TXCHK_CHG_TYPE_ENAB1 …
#define TXCHK_CHG_TYPE_KERN …
#define TXCHK_CHG_TYPE_USER …
#define QIB_CHASE_TIME …
#define QIB_CHASE_DIS_TIME …
struct qib_filedata { … };
extern struct xarray qib_dev_table;
extern struct qib_devdata *qib_lookup(int unit);
extern u32 qib_cpulist_count;
extern unsigned long *qib_cpulist;
extern unsigned qib_cc_table_size;
int qib_init(struct qib_devdata *, int);
int init_chip_wc_pat(struct qib_devdata *dd, u32);
int qib_enable_wc(struct qib_devdata *dd);
void qib_disable_wc(struct qib_devdata *dd);
int qib_count_units(int *npresentp, int *nupp);
int qib_count_active_units(void);
int qib_cdev_init(int minor, const char *name,
const struct file_operations *fops,
struct cdev **cdevp, struct device **devp);
void qib_cdev_cleanup(struct cdev **cdevp, struct device **devp);
int qib_dev_init(void);
void qib_dev_cleanup(void);
int qib_diag_add(struct qib_devdata *);
void qib_diag_remove(struct qib_devdata *);
void qib_handle_e_ibstatuschanged(struct qib_pportdata *, u64);
void qib_sdma_update_tail(struct qib_pportdata *, u16);
int qib_decode_err(struct qib_devdata *dd, char *buf, size_t blen, u64 err);
void qib_bad_intrstatus(struct qib_devdata *);
void qib_handle_urcv(struct qib_devdata *, u64);
void qib_chip_cleanup(struct qib_devdata *);
void qib_chip_done(void);
int qib_unordered_wc(void);
void qib_pio_copy(void __iomem *to, const void *from, size_t count);
void qib_disarm_piobufs(struct qib_devdata *, unsigned, unsigned);
int qib_disarm_piobufs_ifneeded(struct qib_ctxtdata *);
void qib_disarm_piobufs_set(struct qib_devdata *, unsigned long *, unsigned);
void qib_cancel_sends(struct qib_pportdata *);
int qib_create_rcvhdrq(struct qib_devdata *, struct qib_ctxtdata *);
int qib_setup_eagerbufs(struct qib_ctxtdata *);
void qib_set_ctxtcnt(struct qib_devdata *);
int qib_create_ctxts(struct qib_devdata *dd);
struct qib_ctxtdata *qib_create_ctxtdata(struct qib_pportdata *, u32, int);
int qib_init_pportdata(struct qib_pportdata *, struct qib_devdata *, u8, u8);
void qib_free_ctxtdata(struct qib_devdata *, struct qib_ctxtdata *);
u32 qib_kreceive(struct qib_ctxtdata *, u32 *, u32 *);
int qib_reset_device(int);
int qib_wait_linkstate(struct qib_pportdata *, u32, int);
int qib_set_linkstate(struct qib_pportdata *, u8);
int qib_set_mtu(struct qib_pportdata *, u16);
int qib_set_lid(struct qib_pportdata *, u32, u8);
void qib_hol_down(struct qib_pportdata *);
void qib_hol_init(struct qib_pportdata *);
void qib_hol_up(struct qib_pportdata *);
void qib_hol_event(struct timer_list *);
void qib_disable_after_error(struct qib_devdata *);
int qib_set_uevent_bits(struct qib_pportdata *, const int);
#define ctxt_fp(fp) …
#define subctxt_fp(fp) …
#define tidcursor_fp(fp) …
#define user_sdma_queue_fp(fp) …
static inline struct qib_devdata *dd_from_ppd(struct qib_pportdata *ppd)
{ … }
static inline struct qib_devdata *dd_from_dev(struct qib_ibdev *dev)
{ … }
static inline struct qib_devdata *dd_from_ibdev(struct ib_device *ibdev)
{ … }
static inline struct qib_pportdata *ppd_from_ibp(struct qib_ibport *ibp)
{ … }
static inline struct qib_ibport *to_iport(struct ib_device *ibdev, u32 port)
{ … }
#define QIB_HAS_LINK_LATENCY …
#define QIB_INITTED …
#define QIB_DOING_RESET …
#define QIB_PRESENT …
#define QIB_PIO_FLUSH_WC …
#define QIB_HAS_THRESH_UPDATE …
#define QIB_HAS_SDMA_TIMEOUT …
#define QIB_USE_SPCL_TRIG …
#define QIB_NODMA_RTAIL …
#define QIB_HAS_INTX …
#define QIB_HAS_SEND_DMA …
#define QIB_HAS_VLSUPP …
#define QIB_HAS_HDRSUPP …
#define QIB_BADINTR …
#define QIB_DCA_ENABLED …
#define QIB_HAS_QSFP …
#define QIB_SHUTDOWN …
#define QIBL_LINKV …
#define QIBL_LINKDOWN …
#define QIBL_LINKINIT …
#define QIBL_LINKARMED …
#define QIBL_LINKACTIVE …
#define QIBL_IB_AUTONEG_INPROG …
#define QIBL_IB_AUTONEG_FAILED …
#define QIBL_IB_LINK_DISABLED …
#define QIBL_IB_FORCE_NOTIFY …
#define QIB_PBC_LENGTH_MASK …
#define QIB_CTXT_WAITING_RCV …
#define QIB_CTXT_MASTER_UNINIT …
#define QIB_CTXT_WAITING_URG …
void qib_free_data(struct qib_ctxtdata *dd);
void qib_chg_pioavailkernel(struct qib_devdata *, unsigned, unsigned,
u32, struct qib_ctxtdata *);
struct qib_devdata *qib_init_iba7322_funcs(struct pci_dev *,
const struct pci_device_id *);
struct qib_devdata *qib_init_iba7220_funcs(struct pci_dev *,
const struct pci_device_id *);
struct qib_devdata *qib_init_iba6120_funcs(struct pci_dev *,
const struct pci_device_id *);
void qib_free_devdata(struct qib_devdata *);
struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra);
#define QIB_TWSI_NO_DEV …
int qib_twsi_reset(struct qib_devdata *dd);
int qib_twsi_blk_rd(struct qib_devdata *dd, int dev, int addr, void *buffer,
int len);
int qib_twsi_blk_wr(struct qib_devdata *dd, int dev, int addr,
const void *buffer, int len);
void qib_get_eeprom_info(struct qib_devdata *);
void qib_dump_lookup_output_queue(struct qib_devdata *);
void qib_force_pio_avail_update(struct qib_devdata *);
void qib_clear_symerror_on_linkup(struct timer_list *t);
#define QIB_LED_PHYS …
#define QIB_LED_LOG …
void qib_set_led_override(struct qib_pportdata *ppd, unsigned int val);
int qib_setup_sdma(struct qib_pportdata *);
void qib_teardown_sdma(struct qib_pportdata *);
void __qib_sdma_intr(struct qib_pportdata *);
void qib_sdma_intr(struct qib_pportdata *);
void qib_user_sdma_send_desc(struct qib_pportdata *dd,
struct list_head *pktlist);
int qib_sdma_verbs_send(struct qib_pportdata *, struct rvt_sge_state *,
u32, struct qib_verbs_txreq *);
int qib_sdma_make_progress(struct qib_pportdata *dd);
static inline u16 qib_sdma_descq_freecnt(const struct qib_pportdata *ppd)
{ … }
static inline int __qib_sdma_running(struct qib_pportdata *ppd)
{ … }
int qib_sdma_running(struct qib_pportdata *);
void dump_sdma_state(struct qib_pportdata *ppd);
void __qib_sdma_process_event(struct qib_pportdata *, enum qib_sdma_events);
void qib_sdma_process_event(struct qib_pportdata *, enum qib_sdma_events);
#define QIB_DFLT_RCVHDRSIZE …
#define QIB_RCVHDR_ENTSIZE …
int qib_get_user_pages(unsigned long, size_t, struct page **);
void qib_release_user_pages(struct page **, size_t);
int qib_eeprom_read(struct qib_devdata *, u8, void *, int);
int qib_eeprom_write(struct qib_devdata *, u8, const void *, int);
u32 __iomem *qib_getsendbuf_range(struct qib_devdata *, u32 *, u32, u32);
void qib_sendbuf_done(struct qib_devdata *, unsigned);
static inline void qib_clear_rcvhdrtail(const struct qib_ctxtdata *rcd)
{ … }
static inline u32 qib_get_rcvhdrtail(const struct qib_ctxtdata *rcd)
{ … }
extern const struct attribute_group qib_attr_group;
extern const struct attribute_group *qib_attr_port_groups[];
int qib_device_create(struct qib_devdata *);
void qib_device_remove(struct qib_devdata *);
extern int qib_qsfp_dump(struct qib_pportdata *ppd, char *buf, int len);
int __init qib_init_qibfs(void);
int __exit qib_exit_qibfs(void);
int qibfs_add(struct qib_devdata *);
int qibfs_remove(struct qib_devdata *);
int qib_pcie_init(struct pci_dev *, const struct pci_device_id *);
int qib_pcie_ddinit(struct qib_devdata *, struct pci_dev *,
const struct pci_device_id *);
void qib_pcie_ddcleanup(struct qib_devdata *);
int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent);
void qib_free_irq(struct qib_devdata *dd);
int qib_reinit_intr(struct qib_devdata *dd);
void qib_pcie_getcmd(struct qib_devdata *, u16 *, u8 *, u8 *);
void qib_pcie_reenable(struct qib_devdata *, u16, u8, u8);
u64 qib_int_counter(struct qib_devdata *);
u64 qib_sps_ints(void);
int qib_map_page(struct pci_dev *d, struct page *p, dma_addr_t *daddr);
struct pci_dev *qib_get_pci_dev(struct rvt_dev_info *rdi);
static inline void qib_flush_wc(void)
{ … }
extern unsigned qib_ibmtu;
extern ushort qib_cfgctxts;
extern ushort qib_num_cfg_vls;
extern ushort qib_mini_init;
extern unsigned qib_n_krcv_queues;
extern unsigned qib_sdma_fetch_arb;
extern unsigned qib_compat_ddr_negotiate;
extern int qib_special_trigger;
extern unsigned qib_numa_aware;
extern struct mutex qib_mutex;
#define STATUS_TIMEOUT …
#define QIB_DRV_NAME …
#define QIB_USER_MINOR_BASE …
#define QIB_TRACE_MINOR …
#define QIB_DIAGPKT_MINOR …
#define QIB_DIAG_MINOR_BASE …
#define QIB_NMINORS …
#define PCI_VENDOR_ID_PATHSCALE …
#define PCI_VENDOR_ID_QLOGIC …
#define PCI_DEVICE_ID_QLOGIC_IB_6120 …
#define PCI_DEVICE_ID_QLOGIC_IB_7220 …
#define PCI_DEVICE_ID_QLOGIC_IB_7322 …
#define qib_early_err(dev, fmt, ...) …
#define qib_dev_err(dd, fmt, ...) …
#define qib_dev_warn(dd, fmt, ...) …
#define qib_dev_porterr(dd, port, fmt, ...) …
#define qib_devinfo(pcidev, fmt, ...) …
struct qib_hwerror_msgs { … };
#define QLOGIC_IB_HWE_MSG(a, b) …
void qib_format_hwerrors(u64 hwerrs,
const struct qib_hwerror_msgs *hwerrmsgs,
size_t nhwerrmsgs, char *msg, size_t lmsg);
void qib_stop_send_queue(struct rvt_qp *qp);
void qib_quiesce_qp(struct rvt_qp *qp);
void qib_flush_qp_waiters(struct rvt_qp *qp);
int qib_mtu_to_path_mtu(u32 mtu);
u32 qib_mtu_from_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, u32 pmtu);
void qib_notify_error_qp(struct rvt_qp *qp);
int qib_get_pmtu_from_attr(struct rvt_dev_info *rdi, struct rvt_qp *qp,
struct ib_qp_attr *attr);
#endif