Lines Matching refs:cpspec
759 if (!ppd->cpspec->kpregbase || !(ppd->dd->flags & QIB_PRESENT))
761 return readq(&ppd->cpspec->kpregbase[regno]);
767 if (ppd->cpspec && ppd->dd && ppd->cpspec->kpregbase &&
769 writeq(value, &ppd->cpspec->kpregbase[regno]);
807 if (ppd->cpspec && ppd->cpspec->cpregbase &&
809 writeq(value, &ppd->cpspec->cpregbase[regno]);
815 if (!ppd->cpspec || !ppd->cpspec->cpregbase ||
818 return readq(&ppd->cpspec->cpregbase[regno]);
824 if (!ppd->cpspec || !ppd->cpspec->cpregbase ||
827 return readl(&ppd->cpspec->cpregbase[regno]);
1628 ppd->cpspec->chase_timer.expires = 0;
1635 ppd->cpspec->chase_end = 0;
1642 ppd->cpspec->chase_timer.expires = jiffies + QIB_CHASE_DIS_TIME;
1643 add_timer(&ppd->cpspec->chase_timer);
1665 if (ppd->cpspec->chase_end &&
1666 time_after64(tnow, ppd->cpspec->chase_end))
1668 else if (!ppd->cpspec->chase_end)
1669 ppd->cpspec->chase_end = tnow + QIB_CHASE_TIME;
1672 ppd->cpspec->chase_end = 0;
1679 ppd->cpspec->qdr_reforce = 1;
1680 } else if (ppd->cpspec->qdr_reforce &&
1695 if (!ppd->cpspec->qdr_dfe_on && ibclt != IB_7322_LT_STATE_LINKUP &&
1697 ppd->cpspec->qdr_dfe_on = 1;
1698 ppd->cpspec->qdr_dfe_time = 0;
1733 msg = ppd->cpspec->epmsgbuf;
1737 err_decode(msg, sizeof ppd->cpspec->epmsgbuf,
1740 snprintf(msg, sizeof ppd->cpspec->epmsgbuf,
1754 err_decode(msg, sizeof ppd->cpspec->epmsgbuf, symptom,
1770 err_decode(msg, sizeof ppd->cpspec->epmsgbuf,
1786 err_decode(msg, sizeof ppd->cpspec->epmsgbuf, errs,
1817 if (!(ppd->cpspec->ibcctrl_a &
1824 ppd->cpspec->ibcctrl_a |=
1827 ppd->cpspec->ibcctrl_a);
2118 ppd->cpspec->ibcctrl_a &=
2125 qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a |
2183 ppd->cpspec->ibcctrl_a = (ppd->cpspec->ibcctrl_a &
2186 qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);
2213 ppd->cpspec->ibcctrl_a &= ~SYM_MASK(IBCCtrlA_0, IBLinkEn);
2214 qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);
2218 ppd->cpspec->ibdeltainprog = 1;
2219 ppd->cpspec->ibsymsnap = read_7322_creg32_port(ppd,
2221 ppd->cpspec->iblnkerrsnap = read_7322_creg32_port(ppd,
2243 ppd->cpspec->ibcctrl_a = ibc; /* without linkcmd or linkinitcmd! */
2246 val = ppd->cpspec->ibcctrl_a | (QLOGIC_IB_IBCC_LINKINITCMD_DISABLE <<
2256 if (!ppd->cpspec->ibcctrl_b) {
2263 ppd->cpspec->ibcctrl_b = qib_read_kreg_port(ppd,
2265 ppd->cpspec->ibcctrl_b &= ~(IBA7322_IBC_SPEED_QDR |
2271 ppd->cpspec->ibcctrl_b |=
2276 ppd->cpspec->ibcctrl_b |= (lse == QIB_IB_QDR) ?
2284 ppd->cpspec->ibcctrl_b |= IBA7322_IBC_WIDTH_AUTONEG;
2286 ppd->cpspec->ibcctrl_b |=
2292 ppd->cpspec->ibcctrl_b |= (IBA7322_IBC_RXPOL_MASK |
2295 qib_write_kreg_port(ppd, krp_ibcctrl_b, ppd->cpspec->ibcctrl_b);
2317 ppd->cpspec->ibcctrl_a |= SYM_MASK(IBCCtrlA_0, IBLinkEn);
2350 wake_up(&ppd->cpspec->autoneg_wait);
2351 cancel_delayed_work(&ppd->cpspec->autoneg_work);
2353 cancel_delayed_work(&ppd->cpspec->ipg_work);
2356 ppd->cpspec->chase_end = 0;
2357 if (ppd->cpspec->chase_timer.data) /* if initted */
2358 del_timer_sync(&ppd->cpspec->chase_timer);
2367 ppd->cpspec->ibcctrl_a &= ~SYM_MASK(IBCCtrlA_0, IBLinkEn);
2374 if (ppd->cpspec->ibsymdelta || ppd->cpspec->iblnkerrdelta ||
2375 ppd->cpspec->ibdeltainprog || ppd->cpspec->iblnkdowndelta) {
2384 if (ppd->cpspec->ibsymdelta || ppd->cpspec->ibdeltainprog) {
2386 if (ppd->cpspec->ibdeltainprog)
2387 val -= val - ppd->cpspec->ibsymsnap;
2388 val -= ppd->cpspec->ibsymdelta;
2391 if (ppd->cpspec->iblnkerrdelta || ppd->cpspec->ibdeltainprog) {
2393 if (ppd->cpspec->ibdeltainprog)
2394 val -= val - ppd->cpspec->iblnkerrsnap;
2395 val -= ppd->cpspec->iblnkerrdelta;
2398 if (ppd->cpspec->iblnkdowndelta) {
2400 val += ppd->cpspec->iblnkdowndelta;
2538 kfree(dd->pport[i].cpspec->portcntrs);
2544 qib_qsfp_deinit(&dd->pport[i].cpspec->qsfp_data);
2644 qd = &ppd->cpspec->qsfp_data;
3247 dd->pport->cpspec->ibdeltainprog = 0;
3248 dd->pport->cpspec->ibsymdelta = 0;
3249 dd->pport->cpspec->iblnkerrdelta = 0;
3250 dd->pport->cpspec->ibmalfdelta = 0;
3589 ret = SYM_FIELD(ppd->cpspec->ibcctrl_a, IBCCtrlA_0,
3594 ret = SYM_FIELD(ppd->cpspec->ibcctrl_a, IBCCtrlA_0,
3600 ret = (ppd->cpspec->ibcctrl_a &
3627 ret = (int)((ppd->cpspec->ibcctrl_b >> lsb) & maskr);
3718 maskr = SYM_FIELD(ppd->cpspec->ibcctrl_a, IBCCtrlA_0,
3721 ppd->cpspec->ibcctrl_a &=
3723 ppd->cpspec->ibcctrl_a |= (u64) val <<
3726 ppd->cpspec->ibcctrl_a);
3732 maskr = SYM_FIELD(ppd->cpspec->ibcctrl_a, IBCCtrlA_0,
3735 ppd->cpspec->ibcctrl_a &=
3737 ppd->cpspec->ibcctrl_a |= (u64) val <<
3740 ppd->cpspec->ibcctrl_a);
3755 ppd->cpspec->ibcctrl_a &=
3758 ppd->cpspec->ibcctrl_a |=
3760 qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);
3773 ppd->cpspec->ibcctrl_a &= ~SYM_MASK(IBCCtrlA_0, MaxPktLen);
3774 ppd->cpspec->ibcctrl_a |= (u64)val <<
3777 ppd->cpspec->ibcctrl_a);
3785 ppd->cpspec->ibmalfusesnap = 1;
3786 ppd->cpspec->ibmalfsnap = read_7322_creg32_port(ppd,
3788 if (!ppd->cpspec->ibdeltainprog &&
3790 ppd->cpspec->ibdeltainprog = 1;
3791 ppd->cpspec->ibsymsnap =
3794 ppd->cpspec->iblnkerrsnap =
3802 if (ppd->cpspec->ibmalfusesnap) {
3803 ppd->cpspec->ibmalfusesnap = 0;
3804 ppd->cpspec->ibmalfdelta +=
3807 ppd->cpspec->ibmalfsnap;
3835 ppd->cpspec->chase_end = 0;
3840 if (ppd->cpspec->chase_timer.expires) {
3841 del_timer_sync(&ppd->cpspec->chase_timer);
3842 ppd->cpspec->chase_timer.expires = 0;
3878 cancel_delayed_work(&ppd->cpspec->ipg_work);
3879 ppd->cpspec->ipg_tries = 0;
3887 ppd->cpspec->ibcctrl_b &= ~(maskr << lsb);
3888 ppd->cpspec->ibcctrl_b |= (((u64) val & maskr) << lsb);
3889 qib_write_kreg_port(ppd, krp_ibcctrl_b, ppd->cpspec->ibcctrl_b);
3902 ppd->cpspec->ibcctrl_a |= SYM_MASK(IBCCtrlA_0,
3908 ppd->cpspec->ibcctrl_a &= ~SYM_MASK(IBCCtrlA_0,
3918 ppd->cpspec->ibcctrl_a);
3919 ctrlb = ppd->cpspec->ibcctrl_b & ~(IBA7322_IBC_HRTBT_MASK
3921 ppd->cpspec->ibcctrl_b = ctrlb | val;
3923 ppd->cpspec->ibcctrl_b);
4390 if (ppd->cpspec->ibdeltainprog)
4391 ret -= ret - ppd->cpspec->ibsymsnap;
4392 ret -= ppd->cpspec->ibsymdelta;
4394 if (ppd->cpspec->ibdeltainprog)
4395 ret -= ret - ppd->cpspec->iblnkerrsnap;
4396 ret -= ppd->cpspec->iblnkerrdelta;
4398 ret -= ppd->cpspec->ibmalfdelta;
4400 ret += ppd->cpspec->iblnkdowndelta;
4586 dd->pport[i].cpspec->portcntrs = kmalloc(dd->cspec->nportcntrs
4588 if (!dd->pport[i].cpspec->portcntrs)
4642 u64 *cntr = ppd->cpspec->portcntrs;
4714 if (ppd->cpspec->qdr_dfe_on && (ppd->link_speed_active &
4718 ppd->cpspec->qdr_dfe_time &&
4719 time_after64(get_jiffies_64(), ppd->cpspec->qdr_dfe_time)) {
4720 ppd->cpspec->qdr_dfe_on = 0;
4754 * of cpspec->ibcctrl_a as part of it's operation, so if that changes,
4769 ppd->cpspec->ibcctrl_a &
4775 qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);
4890 newctrlb = ppd->cpspec->ibcctrl_b & ~(IBA7322_IBC_SPEED_MASK |
4904 if (newctrlb == ppd->cpspec->ibcctrl_b)
4907 ppd->cpspec->ibcctrl_b = newctrlb;
4908 qib_write_kreg_port(ppd, krp_ibcctrl_b, ppd->cpspec->ibcctrl_b);
4929 schedule_delayed_work(&ppd->cpspec->autoneg_work,
4968 if (wait_event_timeout(ppd->cpspec->autoneg_wait,
4975 if (wait_event_timeout(ppd->cpspec->autoneg_wait,
4987 wait_event_timeout(ppd->cpspec->autoneg_wait,
4994 if (ppd->cpspec->autoneg_tries == AUTONEG_TRIES) {
4996 ppd->cpspec->autoneg_tries = 0;
5059 delay = 2 << ppd->cpspec->ipg_tries;
5060 schedule_delayed_work(&ppd->cpspec->ipg_work, msecs_to_jiffies(delay));
5074 && ++ppd->cpspec->ipg_tries <= 10)
5142 ppd->cpspec->ipg_tries = 0;
5166 if (clr == ppd->cpspec->iblnkdownsnap)
5167 ppd->cpspec->iblnkdowndelta++;
5174 && ppd->cpspec->autoneg_tries < AUTONEG_TRIES) {
5176 ++ppd->cpspec->autoneg_tries;
5177 if (!ppd->cpspec->ibdeltainprog) {
5178 ppd->cpspec->ibdeltainprog = 1;
5179 ppd->cpspec->ibsymdelta +=
5182 ppd->cpspec->ibsymsnap;
5183 ppd->cpspec->iblnkerrdelta +=
5186 ppd->cpspec->iblnkerrsnap;
5203 ppd->cpspec->autoneg_tries = 0;
5206 wake_up(&ppd->cpspec->autoneg_wait);
5218 ppd->cpspec->ibcctrl_b |= IBA7322_IBC_IBTA_1_2_MASK;
5223 if (ppd->dd->cspec->r1 && ppd->cpspec->ipg_tries <= 10)
5225 if (!ppd->cpspec->recovery_init)
5227 ppd->cpspec->qdr_dfe_time = jiffies +
5230 ppd->cpspec->ibmalfusesnap = 0;
5231 ppd->cpspec->ibmalfsnap = read_7322_creg32_port(ppd,
5235 ppd->cpspec->iblnkdownsnap =
5237 if (ppd->cpspec->ibdeltainprog) {
5238 ppd->cpspec->ibdeltainprog = 0;
5239 ppd->cpspec->ibsymdelta += read_7322_creg32_port(ppd,
5240 crp_ibsymbolerr) - ppd->cpspec->ibsymsnap;
5241 ppd->cpspec->iblnkerrdelta += read_7322_creg32_port(ppd,
5242 crp_iblinkerrrecov) - ppd->cpspec->iblnkerrsnap;
5245 !ppd->cpspec->ibdeltainprog &&
5247 ppd->cpspec->ibdeltainprog = 1;
5248 ppd->cpspec->ibsymsnap = read_7322_creg32_port(ppd,
5250 ppd->cpspec->iblnkerrsnap = read_7322_creg32_port(ppd,
5364 * The chip base addresses in cspec and cpspec have to be set
5380 dd->pport[0].cpspec->kpregbase =
5382 dd->pport[1].cpspec->kpregbase =
5385 dd->pport[0].cpspec->cpregbase =
5388 dd->pport[1].cpspec->cpregbase =
5427 if (!ppd->cpspec->kpregbase)
5430 psptr = ppd->cpspec->kpregbase + krp_sendctrl;
5548 struct qib_qsfp_data *qd = &ppd->cpspec->qsfp_data;
5588 dd->pport[pidx].cpspec->no_eep = deflt;
5631 ppd->cpspec->no_eep = val;
5633 ppd->cpspec->h1_val = h1;
5897 ppd[0].cpspec = (struct qib_chippport_specific *)(dd->cspec + 1);
5898 ppd[1].cpspec = &ppd[0].cpspec[1];
5899 ppd[0].cpspec->ppd = &ppd[0]; /* for autoneg_7322_work() */
5900 ppd[1].cpspec->ppd = &ppd[1]; /* for autoneg_7322_work() */
5978 struct qib_chippport_specific *cp = ppd->cpspec;
6084 ppd->cpspec->no_eep = IS_QMH(dd) ?
7021 struct qib_qsfp_cache *qd = &ppd->cpspec->qsfp_data.cache;
7052 } else if (ppd->cpspec->no_eep < TXDDS_TABLE_SZ) {
7059 idx = ppd->cpspec->no_eep;
7063 } else if (ppd->cpspec->no_eep < (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ)) {
7065 idx = ppd->cpspec->no_eep - TXDDS_TABLE_SZ;
7298 ppd->cpspec->qdr_dfe_on = 1;
7405 ppd->cpspec->qdr_reforce = 0;
7411 set_man_code(ppd, chan, ppd->cpspec->h1_val);
7609 ppd->cpspec->recovery_init = 1;
7667 ppd->cpspec->ibcctrl_a &=
7670 ppd->cpspec->ibcctrl_a);