Lines Matching refs:eqcr

356 	struct qm_eqcr eqcr;  member
411 static inline void eqcr_inc(struct qm_eqcr *eqcr) in eqcr_inc() argument
414 struct qm_eqcr_entry *partial = eqcr->cursor + 1; in eqcr_inc()
416 eqcr->cursor = eqcr_carryclear(partial); in eqcr_inc()
417 if (partial != eqcr->cursor) in eqcr_inc()
418 eqcr->vbit ^= QM_EQCR_VERB_VBIT; in eqcr_inc()
426 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_init() local
430 eqcr->ring = portal->addr.ce + QM_CL_EQCR; in qm_eqcr_init()
431 eqcr->ci = qm_in(portal, QM_REG_EQCR_CI_CINH) & (QM_EQCR_SIZE - 1); in qm_eqcr_init()
434 eqcr->cursor = eqcr->ring + pi; in qm_eqcr_init()
435 eqcr->vbit = (qm_in(portal, QM_REG_EQCR_PI_CINH) & QM_EQCR_SIZE) ? in qm_eqcr_init()
437 eqcr->available = QM_EQCR_SIZE - 1 - in qm_eqcr_init()
438 dpaa_cyc_diff(QM_EQCR_SIZE, eqcr->ci, pi); in qm_eqcr_init()
439 eqcr->ithresh = qm_in(portal, QM_REG_EQCR_ITR); in qm_eqcr_init()
441 eqcr->busy = 0; in qm_eqcr_init()
442 eqcr->pmode = pmode; in qm_eqcr_init()
454 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_finish() local
458 DPAA_ASSERT(!eqcr->busy); in qm_eqcr_finish()
459 if (pi != eqcr_ptr2idx(eqcr->cursor)) in qm_eqcr_finish()
461 if (ci != eqcr->ci) in qm_eqcr_finish()
463 if (eqcr->ci != eqcr_ptr2idx(eqcr->cursor)) in qm_eqcr_finish()
470 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_start_no_stash() local
472 DPAA_ASSERT(!eqcr->busy); in qm_eqcr_start_no_stash()
473 if (!eqcr->available) in qm_eqcr_start_no_stash()
477 eqcr->busy = 1; in qm_eqcr_start_no_stash()
479 dpaa_zero(eqcr->cursor); in qm_eqcr_start_no_stash()
480 return eqcr->cursor; in qm_eqcr_start_no_stash()
486 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_start_stash() local
489 DPAA_ASSERT(!eqcr->busy); in qm_eqcr_start_stash()
490 if (!eqcr->available) { in qm_eqcr_start_stash()
491 old_ci = eqcr->ci; in qm_eqcr_start_stash()
492 eqcr->ci = qm_ce_in(portal, QM_CL_EQCR_CI_CENA) & in qm_eqcr_start_stash()
494 diff = dpaa_cyc_diff(QM_EQCR_SIZE, old_ci, eqcr->ci); in qm_eqcr_start_stash()
495 eqcr->available += diff; in qm_eqcr_start_stash()
500 eqcr->busy = 1; in qm_eqcr_start_stash()
502 dpaa_zero(eqcr->cursor); in qm_eqcr_start_stash()
503 return eqcr->cursor; in qm_eqcr_start_stash()
506 static inline void eqcr_commit_checks(struct qm_eqcr *eqcr) in eqcr_commit_checks() argument
508 DPAA_ASSERT(eqcr->busy); in eqcr_commit_checks()
509 DPAA_ASSERT(!(be32_to_cpu(eqcr->cursor->fqid) & ~QM_FQID_MASK)); in eqcr_commit_checks()
510 DPAA_ASSERT(eqcr->available >= 1); in eqcr_commit_checks()
515 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_pvb_commit() local
518 eqcr_commit_checks(eqcr); in qm_eqcr_pvb_commit()
519 DPAA_ASSERT(eqcr->pmode == qm_eqcr_pvb); in qm_eqcr_pvb_commit()
521 eqcursor = eqcr->cursor; in qm_eqcr_pvb_commit()
522 eqcursor->_ncw_verb = myverb | eqcr->vbit; in qm_eqcr_pvb_commit()
524 eqcr_inc(eqcr); in qm_eqcr_pvb_commit()
525 eqcr->available--; in qm_eqcr_pvb_commit()
527 eqcr->busy = 0; in qm_eqcr_pvb_commit()
538 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_cce_update() local
539 u8 diff, old_ci = eqcr->ci; in qm_eqcr_cce_update()
541 eqcr->ci = qm_ce_in(portal, QM_CL_EQCR_CI_CENA) & (QM_EQCR_SIZE - 1); in qm_eqcr_cce_update()
543 diff = dpaa_cyc_diff(QM_EQCR_SIZE, old_ci, eqcr->ci); in qm_eqcr_cce_update()
544 eqcr->available += diff; in qm_eqcr_cce_update()
550 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_set_ithresh() local
552 eqcr->ithresh = ithresh; in qm_eqcr_set_ithresh()
558 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_get_avail() local
560 return eqcr->available; in qm_eqcr_get_avail()
565 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_get_fill() local
567 return QM_EQCR_SIZE - 1 - eqcr->available; in qm_eqcr_get_fill()