Lines Matching defs:wq

36 static inline unsigned int vnic_wq_copy_desc_avail(struct vnic_wq_copy *wq)
38 return wq->ring.desc_avail;
41 static inline unsigned int vnic_wq_copy_desc_in_use(struct vnic_wq_copy *wq)
43 return wq->ring.desc_count - 1 - wq->ring.desc_avail;
46 static inline void *vnic_wq_copy_next_desc(struct vnic_wq_copy *wq)
48 struct fcpio_host_req *desc = wq->ring.descs;
49 return &desc[wq->to_use_index];
52 static inline void vnic_wq_copy_post(struct vnic_wq_copy *wq)
55 ((wq->to_use_index + 1) == wq->ring.desc_count) ?
56 (wq->to_use_index = 0) : (wq->to_use_index++);
57 wq->ring.desc_avail--;
66 iowrite32(wq->to_use_index, &wq->ctrl->posted_index);
69 static inline void vnic_wq_copy_desc_process(struct vnic_wq_copy *wq, u16 index)
73 if (wq->to_clean_index <= index)
74 cnt = (index - wq->to_clean_index) + 1;
76 cnt = wq->ring.desc_count - wq->to_clean_index + index + 1;
78 wq->to_clean_index = ((index + 1) % wq->ring.desc_count);
79 wq->ring.desc_avail += cnt;
83 static inline void vnic_wq_copy_service(struct vnic_wq_copy *wq,
85 void (*q_service)(struct vnic_wq_copy *wq,
88 struct fcpio_host_req *wq_desc = wq->ring.descs;
94 (*q_service)(wq, &wq_desc[wq->to_clean_index]);
96 wq->ring.desc_avail++;
98 curr_index = wq->to_clean_index;
103 ((wq->to_clean_index + 1) == wq->ring.desc_count) ?
104 (wq->to_clean_index = 0) : (wq->to_clean_index++);
111 (wq->to_clean_index == wq->to_use_index))
116 void vnic_wq_copy_enable(struct vnic_wq_copy *wq);
117 int vnic_wq_copy_disable(struct vnic_wq_copy *wq);
118 void vnic_wq_copy_free(struct vnic_wq_copy *wq);
119 int vnic_wq_copy_alloc(struct vnic_dev *vdev, struct vnic_wq_copy *wq,
121 void vnic_wq_copy_init(struct vnic_wq_copy *wq, unsigned int cq_index,
124 void vnic_wq_copy_clean(struct vnic_wq_copy *wq,
125 void (*q_clean)(struct vnic_wq_copy *wq,