Lines Matching refs:wq

25 void vnic_wq_copy_enable(struct vnic_wq_copy *wq)
27 iowrite32(1, &wq->ctrl->enable);
30 int vnic_wq_copy_disable(struct vnic_wq_copy *wq)
34 iowrite32(0, &wq->ctrl->enable);
38 if (!(ioread32(&wq->ctrl->running)))
45 wq->index, ioread32(&wq->ctrl->fetch_index),
46 ioread32(&wq->ctrl->posted_index));
51 void vnic_wq_copy_clean(struct vnic_wq_copy *wq,
52 void (*q_clean)(struct vnic_wq_copy *wq,
55 BUG_ON(ioread32(&wq->ctrl->enable));
57 if (vnic_wq_copy_desc_in_use(wq))
58 vnic_wq_copy_service(wq, -1, q_clean);
60 wq->to_use_index = wq->to_clean_index = 0;
62 iowrite32(0, &wq->ctrl->fetch_index);
63 iowrite32(0, &wq->ctrl->posted_index);
64 iowrite32(0, &wq->ctrl->error_status);
66 vnic_dev_clear_desc_ring(&wq->ring);
69 void vnic_wq_copy_free(struct vnic_wq_copy *wq)
73 vdev = wq->vdev;
74 vnic_dev_free_desc_ring(vdev, &wq->ring);
75 wq->ctrl = NULL;
78 int vnic_wq_copy_alloc(struct vnic_dev *vdev, struct vnic_wq_copy *wq,
82 wq->index = index;
83 wq->vdev = vdev;
84 wq->to_use_index = wq->to_clean_index = 0;
85 wq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_WQ, index);
86 if (!wq->ctrl) {
91 vnic_wq_copy_disable(wq);
93 return vnic_dev_alloc_desc_ring(vdev, &wq->ring, desc_count, desc_size);
96 void vnic_wq_copy_init(struct vnic_wq_copy *wq, unsigned int cq_index,
102 paddr = (u64)wq->ring.base_addr | VNIC_PADDR_TARGET;
103 writeq(paddr, &wq->ctrl->ring_base);
104 iowrite32(wq->ring.desc_count, &wq->ctrl->ring_size);
105 iowrite32(0, &wq->ctrl->fetch_index);
106 iowrite32(0, &wq->ctrl->posted_index);
107 iowrite32(cq_index, &wq->ctrl->cq_index);
108 iowrite32(error_interrupt_enable, &wq->ctrl->error_interrupt_enable);
109 iowrite32(error_interrupt_offset, &wq->ctrl->error_interrupt_offset);