20 #include <linux/kernel.h>
21 #include <linux/errno.h>
22 #include <linux/types.h>
23 #include <linux/pci.h>
25 #include <linux/slab.h>
30 static int vnic_rq_alloc_bufs(
struct vnic_rq *
rq)
39 for (i = 0; i < blks; i++) {
45 for (i = 0; i < blks; i++) {
88 unsigned int desc_count,
unsigned int desc_size)
97 pr_err(
"Failed to hook RQ[%d] resource\n", index);
107 err = vnic_rq_alloc_bufs(rq);
116 static void vnic_rq_init_start(
struct vnic_rq *rq,
unsigned int cq_index,
117 unsigned int fetch_index,
unsigned int posted_index,
118 unsigned int error_interrupt_enable,
119 unsigned int error_interrupt_offset)
122 unsigned int count = rq->
ring.desc_count;
128 iowrite32(error_interrupt_enable, &rq->
ctrl->error_interrupt_enable);
129 iowrite32(error_interrupt_offset, &rq->
ctrl->error_interrupt_offset);
141 unsigned int error_interrupt_enable,
142 unsigned int error_interrupt_offset)
149 if (fetch_index == 0xFFFFFFFF) {
154 vnic_rq_init_start(rq, cq_index,
155 fetch_index, fetch_index,
156 error_interrupt_enable,
157 error_interrupt_offset);
177 for (wait = 0; wait < 1000; wait++) {
193 unsigned int count = rq->
ring.desc_count;
199 (*buf_clean)(
rq,
buf);
201 buf = rq->to_clean = buf->
next;
202 rq->ring.desc_avail++;
208 if (fetch_index == 0xFFFFFFFF) {