Lines Matching refs:dd
52 u64 ipath_snap_cntr(struct ipath_devdata *dd, ipath_creg creg) in ipath_snap_cntr() argument
62 if (!(dd->ipath_flags & IPATH_32BITCOUNTERS) && in ipath_snap_cntr()
63 (creg == dd->ipath_cregs->cr_wordsendcnt || in ipath_snap_cntr()
64 creg == dd->ipath_cregs->cr_wordrcvcnt || in ipath_snap_cntr()
65 creg == dd->ipath_cregs->cr_pktsendcnt || in ipath_snap_cntr()
66 creg == dd->ipath_cregs->cr_pktrcvcnt)) { in ipath_snap_cntr()
67 val64 = ipath_read_creg(dd, creg); in ipath_snap_cntr()
71 val64 = val = ipath_read_creg32(dd, creg); in ipath_snap_cntr()
81 ipath_dev_err(dd, "Error! Read counter 0x%x timed out\n", in ipath_snap_cntr()
91 if (creg == dd->ipath_cregs->cr_wordsendcnt) { in ipath_snap_cntr()
92 if (val != dd->ipath_lastsword) { in ipath_snap_cntr()
93 dd->ipath_sword += val - dd->ipath_lastsword; in ipath_snap_cntr()
94 dd->ipath_lastsword = val; in ipath_snap_cntr()
96 val64 = dd->ipath_sword; in ipath_snap_cntr()
97 } else if (creg == dd->ipath_cregs->cr_wordrcvcnt) { in ipath_snap_cntr()
98 if (val != dd->ipath_lastrword) { in ipath_snap_cntr()
99 dd->ipath_rword += val - dd->ipath_lastrword; in ipath_snap_cntr()
100 dd->ipath_lastrword = val; in ipath_snap_cntr()
102 val64 = dd->ipath_rword; in ipath_snap_cntr()
103 } else if (creg == dd->ipath_cregs->cr_pktsendcnt) { in ipath_snap_cntr()
104 if (val != dd->ipath_lastspkts) { in ipath_snap_cntr()
105 dd->ipath_spkts += val - dd->ipath_lastspkts; in ipath_snap_cntr()
106 dd->ipath_lastspkts = val; in ipath_snap_cntr()
108 val64 = dd->ipath_spkts; in ipath_snap_cntr()
109 } else if (creg == dd->ipath_cregs->cr_pktrcvcnt) { in ipath_snap_cntr()
110 if (val != dd->ipath_lastrpkts) { in ipath_snap_cntr()
111 dd->ipath_rpkts += val - dd->ipath_lastrpkts; in ipath_snap_cntr()
112 dd->ipath_lastrpkts = val; in ipath_snap_cntr()
114 val64 = dd->ipath_rpkts; in ipath_snap_cntr()
115 } else if (creg == dd->ipath_cregs->cr_ibsymbolerrcnt) { in ipath_snap_cntr()
116 if (dd->ibdeltainprog) in ipath_snap_cntr()
117 val64 -= val64 - dd->ibsymsnap; in ipath_snap_cntr()
118 val64 -= dd->ibsymdelta; in ipath_snap_cntr()
119 } else if (creg == dd->ipath_cregs->cr_iblinkerrrecovcnt) { in ipath_snap_cntr()
120 if (dd->ibdeltainprog) in ipath_snap_cntr()
121 val64 -= val64 - dd->iblnkerrsnap; in ipath_snap_cntr()
122 val64 -= dd->iblnkerrdelta; in ipath_snap_cntr()
141 static void ipath_qcheck(struct ipath_devdata *dd) in ipath_qcheck() argument
144 struct ipath_portdata *pd = dd->ipath_pd[0]; in ipath_qcheck()
150 if (pd->port_hdrqfull != dd->ipath_p0_hdrqfull) { in ipath_qcheck()
153 dd->ipath_p0_hdrqfull); in ipath_qcheck()
154 dd->ipath_p0_hdrqfull = pd->port_hdrqfull; in ipath_qcheck()
156 if (ipath_stats.sps_etidfull != dd->ipath_last_tidfull) { in ipath_qcheck()
162 dd->ipath_last_tidfull)); in ipath_qcheck()
163 dd->ipath_last_tidfull = ipath_stats.sps_etidfull; in ipath_qcheck()
188 if (dd->ipath_lastport0rcv_cnt == in ipath_qcheck()
196 ipath_write_ureg(dd, ur_rcvhdrhead, hdrqtail | in ipath_qcheck()
197 dd->ipath_rhdrhead_intr_off, pd->port_port); in ipath_qcheck()
199 dd->ipath_lastport0rcv_cnt = ipath_stats.sps_port0pkts; in ipath_qcheck()
203 static void ipath_chk_errormask(struct ipath_devdata *dd) in ipath_chk_errormask() argument
210 if (!dd->ipath_errormask || !(dd->ipath_flags & IPATH_INITTED)) in ipath_chk_errormask()
213 errormask = ipath_read_kreg64(dd, dd->ipath_kregs->kr_errormask); in ipath_chk_errormask()
215 if (errormask == dd->ipath_errormask) in ipath_chk_errormask()
219 hwerrs = ipath_read_kreg64(dd, dd->ipath_kregs->kr_hwerrstatus); in ipath_chk_errormask()
220 ctrl = ipath_read_kreg32(dd, dd->ipath_kregs->kr_control); in ipath_chk_errormask()
222 ipath_write_kreg(dd, dd->ipath_kregs->kr_errormask, in ipath_chk_errormask()
223 dd->ipath_errormask); in ipath_chk_errormask()
225 if ((hwerrs & dd->ipath_hwerrmask) || in ipath_chk_errormask()
228 ipath_write_kreg(dd, dd->ipath_kregs->kr_hwerrclear, 0ULL); in ipath_chk_errormask()
229 ipath_write_kreg(dd, dd->ipath_kregs->kr_errorclear, 0ULL); in ipath_chk_errormask()
230 ipath_write_kreg(dd, dd->ipath_kregs->kr_intclear, 0ULL); in ipath_chk_errormask()
231 dev_info(&dd->pcidev->dev, in ipath_chk_errormask()
233 fixed, errormask, (unsigned long)dd->ipath_errormask, in ipath_chk_errormask()
238 (unsigned long)dd->ipath_errormask); in ipath_chk_errormask()
250 struct ipath_devdata *dd = (struct ipath_devdata *) opaque; in ipath_get_faststats() local
260 if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_INITTED) || in ipath_get_faststats()
270 traffic_wds = ipath_snap_cntr(dd, dd->ipath_cregs->cr_wordsendcnt) + in ipath_get_faststats()
271 ipath_snap_cntr(dd, dd->ipath_cregs->cr_wordrcvcnt); in ipath_get_faststats()
272 spin_lock_irqsave(&dd->ipath_eep_st_lock, flags); in ipath_get_faststats()
273 traffic_wds -= dd->ipath_traffic_wds; in ipath_get_faststats()
274 dd->ipath_traffic_wds += traffic_wds; in ipath_get_faststats()
276 atomic_add(5, &dd->ipath_active_time); /* S/B #define */ in ipath_get_faststats()
277 spin_unlock_irqrestore(&dd->ipath_eep_st_lock, flags); in ipath_get_faststats()
279 if (dd->ipath_flags & IPATH_32BITCOUNTERS) { in ipath_get_faststats()
280 ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktsendcnt); in ipath_get_faststats()
281 ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktrcvcnt); in ipath_get_faststats()
284 ipath_qcheck(dd); in ipath_get_faststats()
295 if (dd->ipath_lasterror) in ipath_get_faststats()
296 dd->ipath_lasterror = 0; in ipath_get_faststats()
297 if (dd->ipath_lasthwerror) in ipath_get_faststats()
298 dd->ipath_lasthwerror = 0; in ipath_get_faststats()
299 if (dd->ipath_maskederrs in ipath_get_faststats()
300 && time_after(jiffies, dd->ipath_unmasktime)) { in ipath_get_faststats()
303 iserr = ipath_decode_err(dd, ebuf, sizeof ebuf, in ipath_get_faststats()
304 dd->ipath_maskederrs); in ipath_get_faststats()
305 if (dd->ipath_maskederrs & in ipath_get_faststats()
308 ipath_dev_err(dd, "Re-enabling masked errors " in ipath_get_faststats()
328 dd->ipath_errormask |= dd->ipath_maskederrs; in ipath_get_faststats()
329 ipath_write_kreg(dd, dd->ipath_kregs->kr_errormask, in ipath_get_faststats()
330 dd->ipath_errormask); in ipath_get_faststats()
331 dd->ipath_maskederrs = 0; in ipath_get_faststats()
336 for (i = (int) dd->ipath_cfgports; --i >= 0; ) { in ipath_get_faststats()
337 struct ipath_portdata *pd = dd->ipath_pd[i]; in ipath_get_faststats()
344 ipath_chk_errormask(dd); in ipath_get_faststats()
346 mod_timer(&dd->ipath_stats_timer, jiffies + HZ * 5); in ipath_get_faststats()