Lines Matching refs:eqcr

354 	struct qm_eqcr eqcr;  member
409 static inline void eqcr_inc(struct qm_eqcr *eqcr) in eqcr_inc() argument
412 struct qm_eqcr_entry *partial = eqcr->cursor + 1; in eqcr_inc()
414 eqcr->cursor = eqcr_carryclear(partial); in eqcr_inc()
415 if (partial != eqcr->cursor) in eqcr_inc()
416 eqcr->vbit ^= QM_EQCR_VERB_VBIT; in eqcr_inc()
424 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_init() local
428 eqcr->ring = portal->addr.ce + QM_CL_EQCR; in qm_eqcr_init()
429 eqcr->ci = qm_in(portal, QM_REG_EQCR_CI_CINH) & (QM_EQCR_SIZE - 1); in qm_eqcr_init()
432 eqcr->cursor = eqcr->ring + pi; in qm_eqcr_init()
433 eqcr->vbit = (qm_in(portal, QM_REG_EQCR_PI_CINH) & QM_EQCR_SIZE) ? in qm_eqcr_init()
435 eqcr->available = QM_EQCR_SIZE - 1 - in qm_eqcr_init()
436 dpaa_cyc_diff(QM_EQCR_SIZE, eqcr->ci, pi); in qm_eqcr_init()
437 eqcr->ithresh = qm_in(portal, QM_REG_EQCR_ITR); in qm_eqcr_init()
439 eqcr->busy = 0; in qm_eqcr_init()
440 eqcr->pmode = pmode; in qm_eqcr_init()
457 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_finish() local
461 DPAA_ASSERT(!eqcr->busy); in qm_eqcr_finish()
462 if (pi != eqcr_ptr2idx(eqcr->cursor)) in qm_eqcr_finish()
464 if (ci != eqcr->ci) in qm_eqcr_finish()
466 if (eqcr->ci != eqcr_ptr2idx(eqcr->cursor)) in qm_eqcr_finish()
473 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_start_no_stash() local
475 DPAA_ASSERT(!eqcr->busy); in qm_eqcr_start_no_stash()
476 if (!eqcr->available) in qm_eqcr_start_no_stash()
480 eqcr->busy = 1; in qm_eqcr_start_no_stash()
482 dpaa_zero(eqcr->cursor); in qm_eqcr_start_no_stash()
483 return eqcr->cursor; in qm_eqcr_start_no_stash()
489 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_start_stash() local
492 DPAA_ASSERT(!eqcr->busy); in qm_eqcr_start_stash()
493 if (!eqcr->available) { in qm_eqcr_start_stash()
494 old_ci = eqcr->ci; in qm_eqcr_start_stash()
495 eqcr->ci = qm_ce_in(portal, QM_CL_EQCR_CI_CENA) & in qm_eqcr_start_stash()
497 diff = dpaa_cyc_diff(QM_EQCR_SIZE, old_ci, eqcr->ci); in qm_eqcr_start_stash()
498 eqcr->available += diff; in qm_eqcr_start_stash()
503 eqcr->busy = 1; in qm_eqcr_start_stash()
505 dpaa_zero(eqcr->cursor); in qm_eqcr_start_stash()
506 return eqcr->cursor; in qm_eqcr_start_stash()
509 static inline void eqcr_commit_checks(struct qm_eqcr *eqcr) in eqcr_commit_checks() argument
511 DPAA_ASSERT(eqcr->busy); in eqcr_commit_checks()
512 DPAA_ASSERT(!(be32_to_cpu(eqcr->cursor->fqid) & ~QM_FQID_MASK)); in eqcr_commit_checks()
513 DPAA_ASSERT(eqcr->available >= 1); in eqcr_commit_checks()
518 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_pvb_commit() local
521 eqcr_commit_checks(eqcr); in qm_eqcr_pvb_commit()
522 DPAA_ASSERT(eqcr->pmode == qm_eqcr_pvb); in qm_eqcr_pvb_commit()
524 eqcursor = eqcr->cursor; in qm_eqcr_pvb_commit()
525 eqcursor->_ncw_verb = myverb | eqcr->vbit; in qm_eqcr_pvb_commit()
527 eqcr_inc(eqcr); in qm_eqcr_pvb_commit()
528 eqcr->available--; in qm_eqcr_pvb_commit()
530 eqcr->busy = 0; in qm_eqcr_pvb_commit()
541 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_cce_update() local
542 u8 diff, old_ci = eqcr->ci; in qm_eqcr_cce_update()
544 eqcr->ci = qm_ce_in(portal, QM_CL_EQCR_CI_CENA) & (QM_EQCR_SIZE - 1); in qm_eqcr_cce_update()
546 diff = dpaa_cyc_diff(QM_EQCR_SIZE, old_ci, eqcr->ci); in qm_eqcr_cce_update()
547 eqcr->available += diff; in qm_eqcr_cce_update()
553 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_set_ithresh() local
555 eqcr->ithresh = ithresh; in qm_eqcr_set_ithresh()
561 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_get_avail() local
563 return eqcr->available; in qm_eqcr_get_avail()
568 struct qm_eqcr *eqcr = &portal->eqcr; in qm_eqcr_get_fill() local
570 return QM_EQCR_SIZE - 1 - eqcr->available; in qm_eqcr_get_fill()