#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_smi.h>
#ifdef CONFIG_INFINIBAND_QIB_DCA
#include <linux/dca.h>
#endif
#include "qib.h"
#include "qib_7322_regs.h"
#include "qib_qsfp.h"
#include "qib_mad.h"
#include "qib_verbs.h"
#undef pr_fmt
#define pr_fmt(fmt) …
static void qib_setup_7322_setextled(struct qib_pportdata *, u32);
static void qib_7322_handle_hwerrors(struct qib_devdata *, char *, size_t);
static void sendctrl_7322_mod(struct qib_pportdata *ppd, u32 op);
static irqreturn_t qib_7322intr(int irq, void *data);
static irqreturn_t qib_7322bufavail(int irq, void *data);
static irqreturn_t sdma_intr(int irq, void *data);
static irqreturn_t sdma_idle_intr(int irq, void *data);
static irqreturn_t sdma_progress_intr(int irq, void *data);
static irqreturn_t sdma_cleanup_intr(int irq, void *data);
static void qib_7322_txchk_change(struct qib_devdata *, u32, u32, u32,
struct qib_ctxtdata *rcd);
static u8 qib_7322_phys_portstate(u64);
static u32 qib_7322_iblink_state(u64);
static void qib_set_ib_7322_lstate(struct qib_pportdata *ppd, u16 linkcmd,
u16 linitcmd);
static void force_h1(struct qib_pportdata *);
static void adj_tx_serdes(struct qib_pportdata *);
static u32 qib_7322_setpbc_control(struct qib_pportdata *, u32, u8, u8);
static void qib_7322_mini_pcs_reset(struct qib_pportdata *);
static u32 ahb_mod(struct qib_devdata *, int, int, int, u32, u32);
static void ibsd_wr_allchans(struct qib_pportdata *, int, unsigned, unsigned);
static void serdes_7322_los_enable(struct qib_pportdata *, int);
static int serdes_7322_init_old(struct qib_pportdata *);
static int serdes_7322_init_new(struct qib_pportdata *);
static void dump_sdma_7322_state(struct qib_pportdata *);
#define BMASK(msb, lsb) …
#define LE2_DEFAULT …
#define LE2_5m …
#define LE2_QME …
#define IBSD(hw_pidx) …
static const unsigned rcv_int_timeout = …;
static const unsigned rcv_int_count = …;
static const unsigned sdma_idle_cnt = …;
#define RXEQ_DISABLE_MSECS …
ushort qib_num_cfg_vls = …;
module_param_named(num_vls, qib_num_cfg_vls, ushort, S_IRUGO);
MODULE_PARM_DESC(…) …;
static ushort qib_chase = …;
module_param_named(chase, qib_chase, ushort, S_IRUGO);
MODULE_PARM_DESC(…) …;
static ushort qib_long_atten = …;
module_param_named(long_attenuation, qib_long_atten, ushort, S_IRUGO);
MODULE_PARM_DESC(…) …;
static ushort qib_singleport;
module_param_named(singleport, qib_singleport, ushort, S_IRUGO);
MODULE_PARM_DESC(…) …;
static ushort qib_krcvq01_no_msi;
module_param_named(krcvq01_no_msi, qib_krcvq01_no_msi, ushort, S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned qib_rcvhdrcnt;
module_param_named(rcvhdrcnt, qib_rcvhdrcnt, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned qib_rcvhdrsize;
module_param_named(rcvhdrsize, qib_rcvhdrsize, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned qib_rcvhdrentsize;
module_param_named(rcvhdrentsize, qib_rcvhdrentsize, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
#define MAX_ATTEN_LEN …
static char txselect_list[MAX_ATTEN_LEN] = …;
static struct kparam_string kp_txselect = …;
static int setup_txselect(const char *, const struct kernel_param *);
module_param_call(…);
MODULE_PARM_DESC(…) …;
#define BOARD_QME7342 …
#define BOARD_QMH7342 …
#define BOARD_QMH7360 …
#define IS_QMH(dd) …
#define IS_QME(dd) …
#define KREG_IDX(regname) …
#define KREG_IBPORT_IDX(regname) …
#define MASK_ACROSS(lsb, msb) …
#define SYM_RMASK(regname, fldname) …
#define SYM_MASK(regname, fldname) …
#define SYM_FIELD(value, regname, fldname) …
#define SYM_FIELD_ACROSS(value, regname, fldname, nbits) …
#define HWE_MASK(fldname) …
#define ERR_MASK(fldname) …
#define ERR_MASK_N(fldname) …
#define INT_MASK(fldname) …
#define INT_MASK_P(fldname, port) …
#define INT_MASK_PM(fldname, port) …
#define SYM_LSB(regname, fldname) …
#define IBA7322_TID_SZ_SHIFT …
#define IBA7322_TID_SZ_2K …
#define IBA7322_TID_SZ_4K …
#define IBA7322_TID_PA_SHIFT …
#define SendIBSLIDAssignMask …
#define SendIBSLMCMask …
#define ExtLED_IB1_YEL …
#define ExtLED_IB1_GRN …
#define ExtLED_IB2_YEL …
#define ExtLED_IB2_GRN …
#define ExtLED_IB1_MASK …
#define ExtLED_IB2_MASK …
#define _QIB_GPIO_SDA_NUM …
#define _QIB_GPIO_SCL_NUM …
#define QIB_EEPROM_WEN_NUM …
#define QIB_TWSI_EEPROM_DEV …
#define QIB_7322_PSXMITWAIT_CHECK_RATE …
#define PORT_SPD_CAP …
#define PORT_SPD_CAP_SHIFT …
#define DUAL_PORT_CAP …
#define kr_contextcnt …
#define kr_control …
#define kr_counterregbase …
#define kr_errclear …
#define kr_errmask …
#define kr_errstatus …
#define kr_extctrl …
#define kr_extstatus …
#define kr_gpio_clear …
#define kr_gpio_mask …
#define kr_gpio_out …
#define kr_gpio_status …
#define kr_hwdiagctrl …
#define kr_debugportval …
#define kr_fmask …
#define kr_act_fmask …
#define kr_hwerrclear …
#define kr_hwerrmask …
#define kr_hwerrstatus …
#define kr_intclear …
#define kr_intmask …
#define kr_intredirect …
#define kr_intstatus …
#define kr_pagealign …
#define kr_rcvavailtimeout …
#define kr_rcvctrl …
#define kr_rcvegrbase …
#define kr_rcvegrcnt …
#define kr_rcvhdrcnt …
#define kr_rcvhdrentsize …
#define kr_rcvhdrsize …
#define kr_rcvtidbase …
#define kr_rcvtidcnt …
#define kr_revision …
#define kr_scratch …
#define kr_sendbuffererror …
#define kr_sendcheckmask …
#define kr_sendctrl …
#define kr_sendgrhcheckmask …
#define kr_sendibpktmask …
#define kr_sendpioavailaddr …
#define kr_sendpiobufbase …
#define kr_sendpiobufcnt …
#define kr_sendpiosize …
#define kr_sendregbase …
#define kr_sendbufavail0 …
#define kr_userregbase …
#define kr_intgranted …
#define kr_vecclr_wo_int …
#define kr_intblocked …
#define kr_r_access …
#define krp_errclear …
#define krp_errmask …
#define krp_errstatus …
#define krp_highprio_0 …
#define krp_highprio_limit …
#define krp_hrtbt_guid …
#define krp_ib_pcsconfig …
#define krp_ibcctrl_a …
#define krp_ibcctrl_b …
#define krp_ibcctrl_c …
#define krp_ibcstatus_a …
#define krp_ibcstatus_b …
#define krp_txestatus …
#define krp_lowprio_0 …
#define krp_ncmodectrl …
#define krp_partitionkey …
#define krp_psinterval …
#define krp_psstart …
#define krp_psstat …
#define krp_rcvbthqp …
#define krp_rcvctrl …
#define krp_rcvpktledcnt …
#define krp_rcvqpmaptable …
#define krp_rxcreditvl0 …
#define krp_rxcreditvl15 …
#define krp_sendcheckcontrol …
#define krp_sendctrl …
#define krp_senddmabase …
#define krp_senddmabufmask0 …
#define krp_senddmabufmask1 …
#define krp_senddmabufmask2 …
#define krp_senddmabuf_use0 …
#define krp_senddmabuf_use1 …
#define krp_senddmabuf_use2 …
#define krp_senddmadesccnt …
#define krp_senddmahead …
#define krp_senddmaheadaddr …
#define krp_senddmaidlecnt …
#define krp_senddmalengen …
#define krp_senddmaprioritythld …
#define krp_senddmareloadcnt …
#define krp_senddmastatus …
#define krp_senddmatail …
#define krp_sendhdrsymptom …
#define krp_sendslid …
#define krp_sendslidmask …
#define krp_ibsdtestiftx …
#define krp_adapt_dis_timer …
#define krp_tx_deemph_override …
#define krp_serdesctrl …
#define krc_rcvhdraddr …
#define krc_rcvhdrtailaddr …
#define NUM_TIDFLOWS_CTXT …
#define ur_rcvflowtable …
#define TIDFLOW_ERRBITS …
#define CREG_IDX(regname) …
#define crp_badformat …
#define crp_err_rlen …
#define crp_erricrc …
#define crp_errlink …
#define crp_errlpcrc …
#define crp_errpkey …
#define crp_errvcrc …
#define crp_excessbufferovfl …
#define crp_iblinkdown …
#define crp_iblinkerrrecov …
#define crp_ibstatuschange …
#define crp_ibsymbolerr …
#define crp_invalidrlen …
#define crp_locallinkintegrityerr …
#define crp_pktrcv …
#define crp_pktrcvflowctrl …
#define crp_pktsend …
#define crp_pktsendflow …
#define crp_psrcvdatacount …
#define crp_psrcvpktscount …
#define crp_psxmitdatacount …
#define crp_psxmitpktscount …
#define crp_psxmitwaitcount …
#define crp_rcvebp …
#define crp_rcvflowctrlviol …
#define crp_rcvovfl …
#define crp_rxdlidfltr …
#define crp_rxdroppkt …
#define crp_rxotherlocalphyerr …
#define crp_rxqpinvalidctxt …
#define crp_rxvlerr …
#define crp_sendstall …
#define crp_txdroppedpkt …
#define crp_txhdrerr …
#define crp_txlenerr …
#define crp_txminmaxlenerr …
#define crp_txsdmadesc …
#define crp_txunderrun …
#define crp_txunsupvl …
#define crp_vl15droppedpkt …
#define crp_wordrcv …
#define crp_wordsend …
#define crp_tx_creditstalls …
#define CREG_DEVIDX(regname) …
#define cr_base_egrovfl …
#define cr_lbint …
#define cr_lbstall …
#define cr_pcieretrydiag …
#define cr_rxtidflowdrop …
#define cr_tidfull …
#define cr_tidinvalid …
#define NUM_IB_PORTS …
#define NUM_VL15_BUFS …
#define KCTXT0_EGRCNT …
#define PBC_PORT_SEL_LSB …
#define PBC_PORT_SEL_RMASK …
#define PBC_VL_NUM_LSB …
#define PBC_VL_NUM_RMASK …
#define PBC_7322_VL15_SEND …
#define PBC_7322_VL15_SEND_CTRL …
static u8 ib_rate_to_delay[IB_RATE_120_GBPS + 1] = …;
static const char * const qib_sdma_state_names[] = …;
#define IBA7322_LINKSPEED_SHIFT …
#define IBA7322_LINKWIDTH_SHIFT …
#define IB_7322_LT_STATE_DISABLED …
#define IB_7322_LT_STATE_LINKUP …
#define IB_7322_LT_STATE_POLLACTIVE …
#define IB_7322_LT_STATE_POLLQUIET …
#define IB_7322_LT_STATE_SLEEPDELAY …
#define IB_7322_LT_STATE_SLEEPQUIET …
#define IB_7322_LT_STATE_CFGDEBOUNCE …
#define IB_7322_LT_STATE_CFGRCVFCFG …
#define IB_7322_LT_STATE_CFGWAITRMT …
#define IB_7322_LT_STATE_CFGIDLE …
#define IB_7322_LT_STATE_RECOVERRETRAIN …
#define IB_7322_LT_STATE_TXREVLANES …
#define IB_7322_LT_STATE_RECOVERWAITRMT …
#define IB_7322_LT_STATE_RECOVERIDLE …
#define IB_7322_LT_STATE_CFGENH …
#define IB_7322_LT_STATE_CFGTEST …
#define IB_7322_LT_STATE_CFGWAITRMTTEST …
#define IB_7322_LT_STATE_CFGWAITENH …
#define IB_7322_L_STATE_DOWN …
#define IB_7322_L_STATE_INIT …
#define IB_7322_L_STATE_ARM …
#define IB_7322_L_STATE_ACTIVE …
#define IB_7322_L_STATE_ACT_DEFER …
static const u8 qib_7322_physportstate[0x20] = …;
#ifdef CONFIG_INFINIBAND_QIB_DCA
struct qib_irq_notify { … };
#endif
struct qib_chip_specific { … };
struct txdds_ent { … };
struct vendor_txdds_ent { … };
static void write_tx_serdes_param(struct qib_pportdata *, struct txdds_ent *);
#define TXDDS_TABLE_SZ …
#define TXDDS_EXTRA_SZ …
#define TXDDS_MFG_SZ …
#define SERDES_CHANS …
#define H1_FORCE_VAL …
#define H1_FORCE_QME …
#define H1_FORCE_QMH …
#define krp_static_adapt_dis(spd) …
#define QDR_DFE_DISABLE_DELAY …
#define QDR_STATIC_ADAPT_DOWN …
#define QDR_STATIC_ADAPT_DOWN_R1 …
#define QDR_STATIC_ADAPT_INIT …
#define QDR_STATIC_ADAPT_INIT_R1 …
struct qib_chippport_specific { … };
static struct { … } irq_table[] = …;
#ifdef CONFIG_INFINIBAND_QIB_DCA
static const struct dca_reg_map { … } dca_rcvhdr_reg_map[] = …;
#endif
#define QLOGIC_IB_IBCC_LINKINITCMD_DISABLE …
#define QLOGIC_IB_IBCC_LINKINITCMD_POLL …
#define QLOGIC_IB_IBCC_LINKINITCMD_SLEEP …
#define QLOGIC_IB_IBCC_LINKINITCMD_SHIFT …
#define QLOGIC_IB_IBCC_LINKCMD_DOWN …
#define QLOGIC_IB_IBCC_LINKCMD_ARMED …
#define QLOGIC_IB_IBCC_LINKCMD_ACTIVE …
#define BLOB_7322_IBCHG …
static inline void qib_write_kreg(const struct qib_devdata *dd,
const u32 regno, u64 value);
static inline u32 qib_read_kreg32(const struct qib_devdata *, const u32);
static void write_7322_initregs(struct qib_devdata *);
static void write_7322_init_portregs(struct qib_pportdata *);
static void setup_7322_link_recovery(struct qib_pportdata *, u32);
static void check_7322_rxe_status(struct qib_pportdata *);
static u32 __iomem *qib_7322_getsendbuf(struct qib_pportdata *, u64, u32 *);
#ifdef CONFIG_INFINIBAND_QIB_DCA
static void qib_setup_dca(struct qib_devdata *dd);
static void setup_dca_notifier(struct qib_devdata *dd, int msixnum);
static void reset_dca_notifier(struct qib_devdata *dd, int msixnum);
#endif
static inline u32 qib_read_ureg32(const struct qib_devdata *dd,
enum qib_ureg regno, int ctxt)
{ … }
static inline void qib_write_ureg(const struct qib_devdata *dd,
enum qib_ureg regno, u64 value, int ctxt)
{ … }
static inline u32 qib_read_kreg32(const struct qib_devdata *dd,
const u32 regno)
{ … }
static inline u64 qib_read_kreg64(const struct qib_devdata *dd,
const u32 regno)
{ … }
static inline void qib_write_kreg(const struct qib_devdata *dd,
const u32 regno, u64 value)
{ … }
static inline u64 qib_read_kreg_port(const struct qib_pportdata *ppd,
const u16 regno)
{ … }
static inline void qib_write_kreg_port(const struct qib_pportdata *ppd,
const u16 regno, u64 value)
{ … }
static inline void qib_write_kreg_ctxt(const struct qib_devdata *dd,
const u16 regno, unsigned ctxt,
u64 value)
{ … }
static inline u64 read_7322_creg(const struct qib_devdata *dd, u16 regno)
{ … }
static inline u32 read_7322_creg32(const struct qib_devdata *dd, u16 regno)
{ … }
static inline void write_7322_creg_port(const struct qib_pportdata *ppd,
u16 regno, u64 value)
{ … }
static inline u64 read_7322_creg_port(const struct qib_pportdata *ppd,
u16 regno)
{ … }
static inline u32 read_7322_creg32_port(const struct qib_pportdata *ppd,
u16 regno)
{ … }
#define QLOGIC_IB_C_RESET …
#define QLOGIC_IB_C_SDMAFETCHPRIOEN …
#define QIB_I_RCVURG_LSB …
#define QIB_I_RCVURG_RMASK …
#define QIB_I_RCVURG_MASK …
#define QIB_I_RCVAVAIL_LSB …
#define QIB_I_RCVAVAIL_RMASK …
#define QIB_I_RCVAVAIL_MASK …
#define QIB_I_C_ERROR …
#define QIB_I_SPIOSENT …
#define QIB_I_SPIOBUFAVAIL …
#define QIB_I_GPIO …
#define QIB_I_P_SDMAINT(pidx) …
#define QIB_I_P_BITSEXTANT(pidx) …
#define QIB_I_C_BITSEXTANT …
#define QIB_I_BITSEXTANT …
#define QIB_E_P_IBSTATUSCHANGED …
#define QIB_E_P_SHDR …
#define QIB_E_P_VL15_BUF_MISUSE …
#define QIB_E_P_SND_BUF_MISUSE …
#define QIB_E_P_SUNSUPVL …
#define QIB_E_P_SUNEXP_PKTNUM …
#define QIB_E_P_SDROP_DATA …
#define QIB_E_P_SDROP_SMP …
#define QIB_E_P_SPKTLEN …
#define QIB_E_P_SUNDERRUN …
#define QIB_E_P_SMAXPKTLEN …
#define QIB_E_P_SMINPKTLEN …
#define QIB_E_P_RIBLOSTLINK …
#define QIB_E_P_RHDR …
#define QIB_E_P_RHDRLEN …
#define QIB_E_P_RBADTID …
#define QIB_E_P_RBADVERSION …
#define QIB_E_P_RIBFLOW …
#define QIB_E_P_REBP …
#define QIB_E_P_RUNSUPVL …
#define QIB_E_P_RUNEXPCHAR …
#define QIB_E_P_RSHORTPKTLEN …
#define QIB_E_P_RLONGPKTLEN …
#define QIB_E_P_RMAXPKTLEN …
#define QIB_E_P_RMINPKTLEN …
#define QIB_E_P_RICRC …
#define QIB_E_P_RVCRC …
#define QIB_E_P_RFORMATERR …
#define QIB_E_P_SDMA1STDESC …
#define QIB_E_P_SDMABASE …
#define QIB_E_P_SDMADESCADDRMISALIGN …
#define QIB_E_P_SDMADWEN …
#define QIB_E_P_SDMAGENMISMATCH …
#define QIB_E_P_SDMAHALT …
#define QIB_E_P_SDMAMISSINGDW …
#define QIB_E_P_SDMAOUTOFBOUND …
#define QIB_E_P_SDMARPYTAG …
#define QIB_E_P_SDMATAILOUTOFBOUND …
#define QIB_E_P_SDMAUNEXPDATA …
#define QIB_E_RESET …
#define QIB_E_HARDWARE …
#define QIB_E_INVALIDADDR …
#define QIB_E_SBUF_VL15_MISUSE …
#define QIB_E_BADEEP …
#define QIB_E_VLMISMATCH …
#define QIB_E_ARMLAUNCH …
#define QIB_E_SPCLTRIG …
#define QIB_E_RRCVHDRFULL …
#define QIB_E_RRCVEGRFULL …
#define QIB_E_RCVCTXTSHARE …
#define QIB_E_SDMA_VL15 …
#define QIB_E_SDMA_WRONG_PORT …
#define QIB_E_SDMA_BUF_DUP …
#define QIB_E_P_PKTERRS …
#define QIB_E_P_RPKTERRS …
#define QIB_E_P_SPKTERRS …
#define QIB_E_SPKTERRS …
#define QIB_E_P_SDMAERRS …
#define QIB_E_P_BITSEXTANT …
#define QIB_E_P_LINK_PKTERRS …
#define QIB_E_C_BITSEXTANT …
#define E_SPKT_ERRS_IGNORE …
#define QIB_EXTS_MEMBIST_DISABLED …
#define QIB_EXTS_MEMBIST_ENDTEST …
#define QIB_E_SPIOARMLAUNCH …
#define IBA7322_IBCC_LINKINITCMD_MASK …
#define IBA7322_IBCC_LINKCMD_SHIFT …
#define IBA7322_IBC_IBTA_1_2_MASK …
#define IBA7322_IBC_MAX_SPEED_MASK …
#define IBA7322_IBC_SPEED_QDR …
#define IBA7322_IBC_SPEED_DDR …
#define IBA7322_IBC_SPEED_SDR …
#define IBA7322_IBC_SPEED_MASK …
#define IBA7322_IBC_SPEED_LSB …
#define IBA7322_LEDBLINK_OFF_SHIFT …
#define IBA7322_LEDBLINK_ON_SHIFT …
#define IBA7322_IBC_WIDTH_AUTONEG …
#define IBA7322_IBC_WIDTH_4X_ONLY …
#define IBA7322_IBC_WIDTH_1X_ONLY …
#define IBA7322_IBC_RXPOL_MASK …
#define IBA7322_IBC_RXPOL_LSB …
#define IBA7322_IBC_HRTBT_MASK …
#define IBA7322_IBC_HRTBT_RMASK …
#define IBA7322_IBC_HRTBT_LSB …
#define IBA7322_REDIRECT_VEC_PER_REG …
#define IBA7322_SENDCHK_PKEY …
#define IBA7322_SENDCHK_BTHQP …
#define IBA7322_SENDCHK_SLID …
#define IBA7322_SENDCHK_RAW_IPV6 …
#define IBA7322_SENDCHK_MINSZ …
#define AUTONEG_TRIES …
#define HWE_AUTO(fldname) …
#define HWE_AUTO_P(fldname, port) …
static const struct qib_hwerror_msgs qib_7322_hwerror_msgs[] = …;
#define E_AUTO(fldname) …
#define E_P_AUTO(fldname) …
static const struct qib_hwerror_msgs qib_7322error_msgs[] = …;
static const struct qib_hwerror_msgs qib_7322p_error_msgs[] = …;
#define INTR_AUTO(fldname) …
#define INTR_AUTO_P(fldname) …
#define INTR_AUTO_PI(fldname) …
#define INTR_AUTO_C(fldname) …
#define TXSYMPTOM_AUTO_P(fldname) …
static const struct qib_hwerror_msgs hdrchk_msgs[] = …;
#define IBA7322_HDRHEAD_PKTINT_SHIFT …
static void qib_disarm_7322_senderrbufs(struct qib_pportdata *ppd)
{ … }
static void err_decode(char *msg, size_t len, u64 errs,
const struct qib_hwerror_msgs *msp)
{ … }
static void flush_fifo(struct qib_pportdata *ppd)
{ … }
static void qib_7322_sdma_sendctrl(struct qib_pportdata *ppd, unsigned op)
{ … }
static void qib_7322_sdma_hw_clean_up(struct qib_pportdata *ppd)
{ … }
static void qib_sdma_7322_setlengen(struct qib_pportdata *ppd)
{ … }
static void qib_sdma_update_7322_tail(struct qib_pportdata *ppd, u16 tail)
{ … }
static void qib_7322_sdma_hw_start_up(struct qib_pportdata *ppd)
{ … }
#define DISABLES_SDMA …
static void sdma_7322_p_errors(struct qib_pportdata *ppd, u64 errs)
{ … }
static noinline void handle_7322_errors(struct qib_devdata *dd)
{ … }
static void qib_error_tasklet(struct tasklet_struct *t)
{ … }
static void reenable_chase(struct timer_list *t)
{ … }
static void disable_chase(struct qib_pportdata *ppd, unsigned long tnow,
u8 ibclt)
{ … }
static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst)
{ … }
static int qib_7322_set_ib_cfg(struct qib_pportdata *, int, u32);
static noinline void handle_7322_p_errors(struct qib_pportdata *ppd)
{ … }
static void qib_7322_set_intr_state(struct qib_devdata *dd, u32 enable)
{ … }
static void qib_7322_clear_freeze(struct qib_devdata *dd)
{ … }
static void qib_7322_handle_hwerrors(struct qib_devdata *dd, char *msg,
size_t msgl)
{ … }
static void qib_7322_init_hwerrors(struct qib_devdata *dd)
{ … }
static void qib_set_7322_armlaunch(struct qib_devdata *dd, u32 enable)
{ … }
static void qib_set_ib_7322_lstate(struct qib_pportdata *ppd, u16 linkcmd,
u16 linitcmd)
{ … }
#define RCV_BUF_UNITSZ …
#define NUM_RCV_BUF_UNITS(dd) …
static void set_vls(struct qib_pportdata *ppd)
{ … }
static int serdes_7322_init(struct qib_pportdata *ppd);
static int qib_7322_bringup_serdes(struct qib_pportdata *ppd)
{ … }
static void qib_7322_mini_quiet_serdes(struct qib_pportdata *ppd)
{ … }
static void qib_setup_7322_setextled(struct qib_pportdata *ppd, u32 on)
{ … }
#ifdef CONFIG_INFINIBAND_QIB_DCA
static int qib_7322_notify_dca(struct qib_devdata *dd, unsigned long event)
{ … }
static void qib_update_rhdrq_dca(struct qib_ctxtdata *rcd, int cpu)
{ … }
static void qib_update_sdma_dca(struct qib_pportdata *ppd, int cpu)
{ … }
static void qib_setup_dca(struct qib_devdata *dd)
{ … }
static void qib_irq_notifier_notify(struct irq_affinity_notify *notify,
const cpumask_t *mask)
{ … }
static void qib_irq_notifier_release(struct kref *ref)
{ … }
#endif
static void qib_7322_free_irq(struct qib_devdata *dd)
{ … }
static void qib_setup_7322_cleanup(struct qib_devdata *dd)
{ … }
static void sdma_7322_intr(struct qib_devdata *dd, u64 istat)
{ … }
static void qib_wantpiobuf_7322_intr(struct qib_devdata *dd, u32 needint)
{ … }
static noinline void unknown_7322_ibits(struct qib_devdata *dd, u64 istat)
{ … }
static noinline void unknown_7322_gpio_intr(struct qib_devdata *dd)
{ … }
static noinline void unlikely_7322_intr(struct qib_devdata *dd, u64 istat)
{ … }
static void adjust_rcv_timeout(struct qib_ctxtdata *rcd, int npkts)
{ … }
static irqreturn_t qib_7322intr(int irq, void *data)
{ … }
static irqreturn_t qib_7322pintr(int irq, void *data)
{ … }
static irqreturn_t qib_7322bufavail(int irq, void *data)
{ … }
static irqreturn_t sdma_intr(int irq, void *data)
{ … }
static irqreturn_t sdma_idle_intr(int irq, void *data)
{ … }
static irqreturn_t sdma_progress_intr(int irq, void *data)
{ … }
static irqreturn_t sdma_cleanup_intr(int irq, void *data)
{ … }
#ifdef CONFIG_INFINIBAND_QIB_DCA
static void reset_dca_notifier(struct qib_devdata *dd, int msixnum)
{ … }
static void setup_dca_notifier(struct qib_devdata *dd, int msixnum)
{ … }
#endif
static void qib_setup_7322_interrupt(struct qib_devdata *dd, int clearpend)
{ … }
static unsigned qib_7322_boardname(struct qib_devdata *dd)
{ … }
static int qib_do_7322_reset(struct qib_devdata *dd)
{ … }
static void qib_7322_put_tid(struct qib_devdata *dd, u64 __iomem *tidptr,
u32 type, unsigned long pa)
{ … }
static void qib_7322_clear_tids(struct qib_devdata *dd,
struct qib_ctxtdata *rcd)
{ … }
static void qib_7322_tidtemplate(struct qib_devdata *dd)
{ … }
static int qib_7322_get_base_info(struct qib_ctxtdata *rcd,
struct qib_base_info *kinfo)
{ … }
static struct qib_message_header *
qib_7322_get_msgheader(struct qib_devdata *dd, __le32 *rhf_addr)
{ … }
static void qib_7322_config_ctxts(struct qib_devdata *dd)
{ … }
static int qib_7322_get_ib_cfg(struct qib_pportdata *ppd, int which)
{ … }
#define IBA7322_IBC_DLIDLMC_SHIFT …
#define IBA7322_IBC_DLIDLMC_MASK …
static int qib_7322_set_ib_cfg(struct qib_pportdata *ppd, int which, u32 val)
{ … }
static int qib_7322_set_loopback(struct qib_pportdata *ppd, const char *what)
{ … }
static void get_vl_weights(struct qib_pportdata *ppd, unsigned regno,
struct ib_vl_weight_elem *vl)
{ … }
static void set_vl_weights(struct qib_pportdata *ppd, unsigned regno,
struct ib_vl_weight_elem *vl)
{ … }
static int qib_7322_get_ib_table(struct qib_pportdata *ppd, int which, void *t)
{ … }
static int qib_7322_set_ib_table(struct qib_pportdata *ppd, int which, void *t)
{ … }
static void qib_update_7322_usrhead(struct qib_ctxtdata *rcd, u64 hd,
u32 updegr, u32 egrhd, u32 npkts)
{ … }
static u32 qib_7322_hdrqempty(struct qib_ctxtdata *rcd)
{ … }
#define RCVCTRL_COMMON_MODS …
#define RCVCTRL_PORT_MODS …
static void rcvctrl_7322_mod(struct qib_pportdata *ppd, unsigned int op,
int ctxt)
{ … }
#define SENDCTRL_COMMON_MODS …
#define SENDCTRL_PORT_MODS …
static void sendctrl_7322_mod(struct qib_pportdata *ppd, u32 op)
{ … }
#define _PORT_VIRT_FLAG …
#define _PORT_64BIT_FLAG …
#define _PORT_CNTR_IDXMASK …
static u64 qib_portcntr_7322(struct qib_pportdata *ppd, u32 reg)
{ … }
static const char cntr7322names[] = …
;
static const u32 cntr7322indices[] = …;
static const char portcntr7322names[] = …
;
static const u32 portcntr7322indices[] = …;
static void init_7322_cntrnames(struct qib_devdata *dd)
{ … }
static u32 qib_read_7322cntrs(struct qib_devdata *dd, loff_t pos, char **namep,
u64 **cntrp)
{ … }
static u32 qib_read_7322portcntrs(struct qib_devdata *dd, loff_t pos, u32 port,
char **namep, u64 **cntrp)
{ … }
static void qib_get_7322_faststats(struct timer_list *t)
{ … }
static int qib_7322_intr_fallback(struct qib_devdata *dd)
{ … }
static void qib_7322_mini_pcs_reset(struct qib_pportdata *ppd)
{ … }
static void autoneg_7322_sendpkt(struct qib_pportdata *ppd, u32 *hdr,
u32 dcnt, u32 *data)
{ … }
static void qib_autoneg_7322_send(struct qib_pportdata *ppd, int which)
{ … }
static void set_7322_ibspeed_fast(struct qib_pportdata *ppd, u32 speed)
{ … }
static void try_7322_autoneg(struct qib_pportdata *ppd)
{ … }
static void autoneg_7322_work(struct work_struct *work)
{ … }
static void try_7322_ipg(struct qib_pportdata *ppd)
{ … }
static void ipg_7322_work(struct work_struct *work)
{ … }
static u32 qib_7322_iblink_state(u64 ibcs)
{ … }
static u8 qib_7322_phys_portstate(u64 ibcs)
{ … }
static int qib_7322_ib_updown(struct qib_pportdata *ppd, int ibup, u64 ibcs)
{ … }
static int gpio_7322_mod(struct qib_devdata *dd, u32 out, u32 dir, u32 mask)
{ … }
static int qib_7322_eeprom_wen(struct qib_devdata *dd, int wen)
{ … }
static void get_7322_chip_params(struct qib_devdata *dd)
{ … }
static void qib_7322_set_baseaddrs(struct qib_devdata *dd)
{ … }
#define SENDCTRL_SHADOWED …
static int sendctrl_hook(struct qib_devdata *dd,
const struct diag_observer *op, u32 offs,
u64 *data, u64 mask, int only_32)
{ … }
static const struct diag_observer sendctrl_0_observer = …;
static const struct diag_observer sendctrl_1_observer = …;
static ushort sdma_fetch_prio = …;
module_param_named(sdma_fetch_prio, sdma_fetch_prio, ushort, S_IRUGO);
MODULE_PARM_DESC(…) …;
static void init_txdds_table(struct qib_pportdata *ppd, int override);
static void qsfp_7322_event(struct work_struct *work)
{ … }
static void qib_init_7322_qsfp(struct qib_pportdata *ppd)
{ … }
static void set_no_qsfp_atten(struct qib_devdata *dd, int change)
{ … }
static int setup_txselect(const char *str, const struct kernel_param *kp)
{ … }
static int qib_late_7322_initreg(struct qib_devdata *dd)
{ … }
#define SENDCTRL_PIBP …
#define RCVCTRL_PIBP …
#define ERRS_PIBP …
static void write_7322_init_portregs(struct qib_pportdata *ppd)
{ … }
static void write_7322_initregs(struct qib_devdata *dd)
{ … }
static int qib_init_7322_variables(struct qib_devdata *dd)
{ … }
static u32 __iomem *qib_7322_getsendbuf(struct qib_pportdata *ppd, u64 pbc,
u32 *pbufnum)
{ … }
static void qib_set_cntr_7322_sample(struct qib_pportdata *ppd, u32 intv,
u32 start)
{ … }
static void qib_sdma_set_7322_desc_cnt(struct qib_pportdata *ppd, unsigned cnt)
{ … }
static void dump_sdma_7322_state(struct qib_pportdata *ppd)
{ … }
static struct sdma_set_state_action sdma_7322_action_table[] = …;
static void qib_7322_sdma_init_early(struct qib_pportdata *ppd)
{ … }
static int init_sdma_7322_regs(struct qib_pportdata *ppd)
{ … }
static u16 qib_sdma_7322_gethead(struct qib_pportdata *ppd)
{ … }
static int qib_sdma_7322_busy(struct qib_pportdata *ppd)
{ … }
static u32 qib_7322_setpbc_control(struct qib_pportdata *ppd, u32 plen,
u8 srate, u8 vl)
{ … }
static void qib_7322_initvl15_bufs(struct qib_devdata *dd)
{ … }
static void qib_7322_init_ctxt(struct qib_ctxtdata *rcd)
{ … }
#define QTXSLEEPS …
static void qib_7322_txchk_change(struct qib_devdata *dd, u32 start,
u32 len, u32 which, struct qib_ctxtdata *rcd)
{ … }
static void writescratch(struct qib_devdata *dd, u32 val)
{ … }
static int qib_7322_tempsense_rd(struct qib_devdata *dd, int regnum)
{ … }
struct qib_devdata *qib_init_iba7322_funcs(struct pci_dev *pdev,
const struct pci_device_id *ent)
{ … }
#define DDS_ENT_AMP_LSB …
#define DDS_ENT_MAIN_LSB …
#define DDS_ENT_POST_LSB …
#define DDS_ENT_PRE_XTRA_LSB …
#define DDS_ENT_PRE_LSB …
static void set_txdds(struct qib_pportdata *ppd, int ridx,
const struct txdds_ent *tp)
{ … }
static const struct vendor_txdds_ent vendor_txdds[] = …;
static const struct txdds_ent txdds_sdr[TXDDS_TABLE_SZ] = …;
static const struct txdds_ent txdds_ddr[TXDDS_TABLE_SZ] = …;
static const struct txdds_ent txdds_qdr[TXDDS_TABLE_SZ] = …;
static const struct txdds_ent txdds_extra_sdr[TXDDS_EXTRA_SZ] = …;
static const struct txdds_ent txdds_extra_ddr[TXDDS_EXTRA_SZ] = …;
static const struct txdds_ent txdds_extra_qdr[TXDDS_EXTRA_SZ] = …;
static const struct txdds_ent txdds_extra_mfg[TXDDS_MFG_SZ] = …;
static const struct txdds_ent *get_atten_table(const struct txdds_ent *txdds,
unsigned atten)
{ … }
static void find_best_ent(struct qib_pportdata *ppd,
const struct txdds_ent **sdr_dds,
const struct txdds_ent **ddr_dds,
const struct txdds_ent **qdr_dds, int override)
{ … }
static void init_txdds_table(struct qib_pportdata *ppd, int override)
{ … }
#define KR_AHB_ACC …
#define KR_AHB_TRANS …
#define AHB_TRANS_RDY …
#define AHB_ADDR_LSB …
#define AHB_DATA_LSB …
#define AHB_WR …
#define AHB_TRANS_TRIES …
static u32 ahb_mod(struct qib_devdata *dd, int quad, int chan, int addr,
u32 data, u32 mask)
{ … }
static void ibsd_wr_allchans(struct qib_pportdata *ppd, int addr, unsigned data,
unsigned mask)
{ … }
static void serdes_7322_los_enable(struct qib_pportdata *ppd, int enable)
{ … }
static int serdes_7322_init(struct qib_pportdata *ppd)
{ … }
static int serdes_7322_init_old(struct qib_pportdata *ppd)
{ … }
static int serdes_7322_init_new(struct qib_pportdata *ppd)
{ … }
static void set_man_code(struct qib_pportdata *ppd, int chan, int code)
{ … }
static void set_man_mode_h1(struct qib_pportdata *ppd, int chan,
int enable, u32 tapenable)
{ … }
static void clock_man(struct qib_pportdata *ppd, int chan)
{ … }
static void write_tx_serdes_param(struct qib_pportdata *ppd,
struct txdds_ent *txdds)
{ … }
static void adj_tx_serdes(struct qib_pportdata *ppd)
{ … }
static void force_h1(struct qib_pportdata *ppd)
{ … }
#define SJA_EN …
#define BISTEN_LSB …
#define R_OPCODE_LSB …
#define R_OP_NOP …
#define R_OP_SHIFT …
#define R_OP_UPDATE …
#define R_TDI_LSB …
#define R_TDO_LSB …
#define R_RDY …
static int qib_r_grab(struct qib_devdata *dd)
{ … }
static int qib_r_wait_for_rdy(struct qib_devdata *dd)
{ … }
static int qib_r_shift(struct qib_devdata *dd, int bisten,
int len, u8 *inp, u8 *outp)
{ … }
static int qib_r_update(struct qib_devdata *dd, int bisten)
{ … }
#define BISTEN_PORT_SEL …
#define LEN_PORT_SEL …
#define BISTEN_AT …
#define LEN_AT …
#define BISTEN_ETM …
#define LEN_ETM …
#define BIT2BYTE(x) …
static u8 reset_at[BIT2BYTE(LEN_AT)] = …;
static u8 reset_atetm[BIT2BYTE(LEN_ETM)] = …;
static u8 at[BIT2BYTE(LEN_AT)] = …;
static u8 atetm_1port[BIT2BYTE(LEN_ETM)] = …;
static u8 atetm_2port[BIT2BYTE(LEN_ETM)] = …;
static u8 portsel_port1[BIT2BYTE(LEN_PORT_SEL)] = …;
static u8 portsel_port2[BIT2BYTE(LEN_PORT_SEL)] = …;
static u8 portsel_2port[BIT2BYTE(LEN_PORT_SEL)] = …;
static void setup_7322_link_recovery(struct qib_pportdata *ppd, u32 both)
{ … }
static void check_7322_rxe_status(struct qib_pportdata *ppd)
{ … }