Lines Matching refs:cq

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