Lines Matching refs:queue
210 static inline void *hw_qeit_calc(struct hw_queue *queue, u64 q_offset)
214 if (q_offset >= queue->queue_length)
215 q_offset -= queue->queue_length;
216 current_page = (queue->queue_pages)[q_offset >> EHEA_PAGESHIFT];
220 static inline void *hw_qeit_get(struct hw_queue *queue)
222 return hw_qeit_calc(queue, queue->current_q_offset);
225 static inline void hw_qeit_inc(struct hw_queue *queue)
227 queue->current_q_offset += queue->qe_size;
228 if (queue->current_q_offset >= queue->queue_length) {
229 queue->current_q_offset = 0;
231 queue->toggle_state = (~queue->toggle_state) & 1;
235 static inline void *hw_qeit_get_inc(struct hw_queue *queue)
237 void *retvalue = hw_qeit_get(queue);
238 hw_qeit_inc(queue);
242 static inline void *hw_qeit_get_inc_valid(struct hw_queue *queue)
244 struct ehea_cqe *retvalue = hw_qeit_get(queue);
248 if ((valid >> 7) == (queue->toggle_state & 1)) {
250 hw_qeit_inc(queue);
251 pref = hw_qeit_calc(queue, queue->current_q_offset);
259 static inline void *hw_qeit_get_valid(struct hw_queue *queue)
261 struct ehea_cqe *retvalue = hw_qeit_get(queue);
265 pref = hw_qeit_calc(queue, queue->current_q_offset);
270 if (!((valid >> 7) == (queue->toggle_state & 1)))
275 static inline void *hw_qeit_reset(struct hw_queue *queue)
277 queue->current_q_offset = 0;
278 return hw_qeit_get(queue);
281 static inline void *hw_qeit_eq_get_inc(struct hw_queue *queue)
283 u64 last_entry_in_q = queue->queue_length - queue->qe_size;
286 retvalue = hw_qeit_get(queue);
287 queue->current_q_offset += queue->qe_size;
288 if (queue->current_q_offset > last_entry_in_q) {
289 queue->current_q_offset = 0;
290 queue->toggle_state = (~queue->toggle_state) & 1;
295 static inline void *hw_eqit_eq_get_inc_valid(struct hw_queue *queue)
297 void *retvalue = hw_qeit_get(queue);
299 if ((qe >> 7) == (queue->toggle_state & 1))
300 hw_qeit_eq_get_inc(queue);
309 struct hw_queue *queue;
312 queue = &qp->hw_rqueue1;
314 queue = &qp->hw_rqueue2;
316 queue = &qp->hw_rqueue3;
318 return hw_qeit_get_inc(queue);
324 struct hw_queue *queue = &my_qp->hw_squeue;
327 *wqe_index = (queue->current_q_offset) >> (7 + EHEA_SG_SQ);
341 struct hw_queue *queue = &qp->hw_rqueue1;
343 *wqe_index = (queue->current_q_offset) >> (7 + EHEA_SG_RQ1);
344 return hw_qeit_get_valid(queue);
366 EHEA_EQ = 0, /* event queue */
367 EHEA_NEQ /* notification event queue */