Lines Matching refs:wq

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