Lines Matching refs:cp
273 int qib_refresh_qsfp_cache(struct qib_pportdata *ppd, struct qib_qsfp_cache *cp) in qib_refresh_qsfp_cache() argument
281 memset(cp, 0, sizeof(*cp)); in qib_refresh_qsfp_cache()
311 ret = qsfp_read(ppd, QSFP_MOD_ID_OFFS, &cp->id, 1); in qib_refresh_qsfp_cache()
314 if ((cp->id & 0xFE) != 0x0C) in qib_refresh_qsfp_cache()
316 "QSFP ID byte is 0x%02X, S/B 0x0C/D\n", cp->id); in qib_refresh_qsfp_cache()
317 cks = cp->id; in qib_refresh_qsfp_cache()
319 ret = qsfp_read(ppd, QSFP_MOD_PWR_OFFS, &cp->pwr, 1); in qib_refresh_qsfp_cache()
322 cks += cp->pwr; in qib_refresh_qsfp_cache()
329 ret = qsfp_read(ppd, QSFP_MOD_LEN_OFFS, &cp->len, 1); in qib_refresh_qsfp_cache()
332 cks += cp->len; in qib_refresh_qsfp_cache()
334 ret = qsfp_read(ppd, QSFP_MOD_TECH_OFFS, &cp->tech, 1); in qib_refresh_qsfp_cache()
337 cks += cp->tech; in qib_refresh_qsfp_cache()
339 ret = qsfp_read(ppd, QSFP_VEND_OFFS, &cp->vendor, QSFP_VEND_LEN); in qib_refresh_qsfp_cache()
343 cks += cp->vendor[idx]; in qib_refresh_qsfp_cache()
345 ret = qsfp_read(ppd, QSFP_IBXCV_OFFS, &cp->xt_xcv, 1); in qib_refresh_qsfp_cache()
348 cks += cp->xt_xcv; in qib_refresh_qsfp_cache()
350 ret = qsfp_read(ppd, QSFP_VOUI_OFFS, &cp->oui, QSFP_VOUI_LEN); in qib_refresh_qsfp_cache()
354 cks += cp->oui[idx]; in qib_refresh_qsfp_cache()
356 ret = qsfp_read(ppd, QSFP_PN_OFFS, &cp->partnum, QSFP_PN_LEN); in qib_refresh_qsfp_cache()
360 cks += cp->partnum[idx]; in qib_refresh_qsfp_cache()
362 ret = qsfp_read(ppd, QSFP_REV_OFFS, &cp->rev, QSFP_REV_LEN); in qib_refresh_qsfp_cache()
366 cks += cp->rev[idx]; in qib_refresh_qsfp_cache()
368 ret = qsfp_read(ppd, QSFP_ATTEN_OFFS, &cp->atten, QSFP_ATTEN_LEN); in qib_refresh_qsfp_cache()
372 cks += cp->atten[idx]; in qib_refresh_qsfp_cache()
380 ret = qsfp_read(ppd, QSFP_CC_OFFS, &cp->cks1, 1); in qib_refresh_qsfp_cache()
383 if (cks != cp->cks1) in qib_refresh_qsfp_cache()
385 "QSFP cks1 is %02X, computed %02X\n", cp->cks1, in qib_refresh_qsfp_cache()
394 ret = qsfp_read(ppd, QSFP_SN_OFFS, &cp->serial, QSFP_SN_LEN); in qib_refresh_qsfp_cache()
398 cks += cp->serial[idx]; in qib_refresh_qsfp_cache()
400 ret = qsfp_read(ppd, QSFP_DATE_OFFS, &cp->date, QSFP_DATE_LEN); in qib_refresh_qsfp_cache()
404 cks += cp->date[idx]; in qib_refresh_qsfp_cache()
406 ret = qsfp_read(ppd, QSFP_LOT_OFFS, &cp->lot, QSFP_LOT_LEN); in qib_refresh_qsfp_cache()
410 cks += cp->lot[idx]; in qib_refresh_qsfp_cache()
417 ret = qsfp_read(ppd, QSFP_CC_EXT_OFFS, &cp->cks2, 1); in qib_refresh_qsfp_cache()
421 if (cks != cp->cks2) in qib_refresh_qsfp_cache()
423 "QSFP cks2 is %02X, computed %02X\n", cp->cks2, in qib_refresh_qsfp_cache()
428 cp->id = 0; in qib_refresh_qsfp_cache()