Lines Matching refs:ring
86 struct pfx##_entry *ring; \
116 pfx##_ring_init(struct pfx##_ring *ring, struct dpaa_portal_softc *portal)\
120 ring->ci = ci & (sz - 1); \
121 ring->vbit = !!(ci & sz) << 7; \
122 ring->cursor = ring->ring + pi; \
123 ring->avail = sz - 1 - pfx##_cyc_diff(sz, ring->ci, pi); \
131 pfx##_INC(struct pfx##_ring *ring) \
133 struct pfx##_entry *partial = ring->cursor + 1; \
134 ring->cursor = pfx##_CARRYCLEAR(partial); \
135 if (partial != ring->cursor) \
136 ring->vbit ^= 0x80; \
139 pfx##_update(struct pfx##_ring *ring, struct dpaa_portal_softc *portal) \
141 uint8_t diff, old_ci = ring->ci; \
142 ring->ci = *(uint32_t*)(portal->sc_ci_va + ci_i) & (sz - 1); \
143 diff = pfx##_cyc_diff(sz, old_ci, ring->ci); \
144 ring->avail += diff; \
148 pfx##_start(struct pfx##_ring *ring, struct dpaa_portal_softc *portal) \
150 if (ring->avail <= 1) { \
151 pfx##_update(ring, portal); \
152 if (ring->avail == 0) \
155 dpaa_zero_line(ring->cursor); \
156 return (ring->cursor); \
159 pfx##_commit(struct pfx##_ring *ring, uint8_t verb) \
161 struct pfx##_entry *entry = ring->cursor; \
163 entry->verb = verb | ring->vbit; \
165 pfx##_INC(ring); \
166 ring->avail--; \