Lines Matching refs:queue
196 static inline void *hw_qeit_calc(struct hw_queue *queue, u64 q_offset) in hw_qeit_calc() argument
200 if (q_offset >= queue->queue_length) in hw_qeit_calc()
201 q_offset -= queue->queue_length; in hw_qeit_calc()
202 current_page = (queue->queue_pages)[q_offset >> EHEA_PAGESHIFT]; in hw_qeit_calc()
206 static inline void *hw_qeit_get(struct hw_queue *queue) in hw_qeit_get() argument
208 return hw_qeit_calc(queue, queue->current_q_offset); in hw_qeit_get()
211 static inline void hw_qeit_inc(struct hw_queue *queue) in hw_qeit_inc() argument
213 queue->current_q_offset += queue->qe_size; in hw_qeit_inc()
214 if (queue->current_q_offset >= queue->queue_length) { in hw_qeit_inc()
215 queue->current_q_offset = 0; in hw_qeit_inc()
217 queue->toggle_state = (~queue->toggle_state) & 1; in hw_qeit_inc()
221 static inline void *hw_qeit_get_inc(struct hw_queue *queue) in hw_qeit_get_inc() argument
223 void *retvalue = hw_qeit_get(queue); in hw_qeit_get_inc()
224 hw_qeit_inc(queue); in hw_qeit_get_inc()
228 static inline void *hw_qeit_get_inc_valid(struct hw_queue *queue) in hw_qeit_get_inc_valid() argument
230 struct ehea_cqe *retvalue = hw_qeit_get(queue); in hw_qeit_get_inc_valid()
234 if ((valid >> 7) == (queue->toggle_state & 1)) { in hw_qeit_get_inc_valid()
236 hw_qeit_inc(queue); in hw_qeit_get_inc_valid()
237 pref = hw_qeit_calc(queue, queue->current_q_offset); in hw_qeit_get_inc_valid()
245 static inline void *hw_qeit_get_valid(struct hw_queue *queue) in hw_qeit_get_valid() argument
247 struct ehea_cqe *retvalue = hw_qeit_get(queue); in hw_qeit_get_valid()
251 pref = hw_qeit_calc(queue, queue->current_q_offset); in hw_qeit_get_valid()
256 if (!((valid >> 7) == (queue->toggle_state & 1))) in hw_qeit_get_valid()
261 static inline void *hw_qeit_reset(struct hw_queue *queue) in hw_qeit_reset() argument
263 queue->current_q_offset = 0; in hw_qeit_reset()
264 return hw_qeit_get(queue); in hw_qeit_reset()
267 static inline void *hw_qeit_eq_get_inc(struct hw_queue *queue) in hw_qeit_eq_get_inc() argument
269 u64 last_entry_in_q = queue->queue_length - queue->qe_size; in hw_qeit_eq_get_inc()
272 retvalue = hw_qeit_get(queue); in hw_qeit_eq_get_inc()
273 queue->current_q_offset += queue->qe_size; in hw_qeit_eq_get_inc()
274 if (queue->current_q_offset > last_entry_in_q) { in hw_qeit_eq_get_inc()
275 queue->current_q_offset = 0; in hw_qeit_eq_get_inc()
276 queue->toggle_state = (~queue->toggle_state) & 1; in hw_qeit_eq_get_inc()
281 static inline void *hw_eqit_eq_get_inc_valid(struct hw_queue *queue) in hw_eqit_eq_get_inc_valid() argument
283 void *retvalue = hw_qeit_get(queue); in hw_eqit_eq_get_inc_valid()
285 if ((qe >> 7) == (queue->toggle_state & 1)) in hw_eqit_eq_get_inc_valid()
286 hw_qeit_eq_get_inc(queue); in hw_eqit_eq_get_inc_valid()
295 struct hw_queue *queue; in ehea_get_next_rwqe() local
298 queue = &qp->hw_rqueue1; in ehea_get_next_rwqe()
300 queue = &qp->hw_rqueue2; in ehea_get_next_rwqe()
302 queue = &qp->hw_rqueue3; in ehea_get_next_rwqe()
304 return hw_qeit_get_inc(queue); in ehea_get_next_rwqe()
310 struct hw_queue *queue = &my_qp->hw_squeue; in ehea_get_swqe() local
313 *wqe_index = (queue->current_q_offset) >> (7 + EHEA_SG_SQ); in ehea_get_swqe()
327 struct hw_queue *queue = &qp->hw_rqueue1; in ehea_poll_rq1() local
329 *wqe_index = (queue->current_q_offset) >> (7 + EHEA_SG_RQ1); in ehea_poll_rq1()
330 return hw_qeit_get_valid(queue); in ehea_poll_rq1()