Lines Matching refs:cq
12 void vnic_cq_free(struct vnic_cq *cq)
14 vnic_dev_free_desc_ring(cq->vdev, &cq->ring);
16 cq->ctrl = NULL;
19 int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
24 cq->index = index;
25 cq->vdev = vdev;
27 cq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_CQ, index);
28 if (!cq->ctrl) {
33 err = vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size);
40 void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable,
48 paddr = (u64)cq->ring.base_addr | VNIC_PADDR_TARGET;
49 writeq(paddr, &cq->ctrl->ring_base);
50 iowrite32(cq->ring.desc_count, &cq->ctrl->ring_size);
51 iowrite32(flow_control_enable, &cq->ctrl->flow_control_enable);
52 iowrite32(color_enable, &cq->ctrl->color_enable);
53 iowrite32(cq_head, &cq->ctrl->cq_head);
54 iowrite32(cq_tail, &cq->ctrl->cq_tail);
55 iowrite32(cq_tail_color, &cq->ctrl->cq_tail_color);
56 iowrite32(interrupt_enable, &cq->ctrl->interrupt_enable);
57 iowrite32(cq_entry_enable, &cq->ctrl->cq_entry_enable);
58 iowrite32(cq_message_enable, &cq->ctrl->cq_message_enable);
59 iowrite32(interrupt_offset, &cq->ctrl->interrupt_offset);
60 writeq(cq_message_addr, &cq->ctrl->cq_message_addr);
63 void vnic_cq_clean(struct vnic_cq *cq)
65 cq->to_clean = 0;
66 cq->last_color = 0;
68 iowrite32(0, &cq->ctrl->cq_head);
69 iowrite32(0, &cq->ctrl->cq_tail);
70 iowrite32(1, &cq->ctrl->cq_tail_color);
72 vnic_dev_clear_desc_ring(&cq->ring);