Lines Matching refs:cq
16 void vnic_cq_free(struct vnic_cq *cq) in vnic_cq_free() argument
18 vnic_dev_free_desc_ring(cq->vdev, &cq->ring); in vnic_cq_free()
20 cq->ctrl = NULL; in vnic_cq_free()
23 int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index, in vnic_cq_alloc() argument
26 cq->index = index; in vnic_cq_alloc()
27 cq->vdev = vdev; in vnic_cq_alloc()
29 cq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_CQ, index); in vnic_cq_alloc()
30 if (!cq->ctrl) { in vnic_cq_alloc()
35 return vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size); in vnic_cq_alloc()
38 void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable, in vnic_cq_init() argument
46 paddr = (u64)cq->ring.base_addr | VNIC_PADDR_TARGET; in vnic_cq_init()
47 writeq(paddr, &cq->ctrl->ring_base); in vnic_cq_init()
48 iowrite32(cq->ring.desc_count, &cq->ctrl->ring_size); in vnic_cq_init()
49 iowrite32(flow_control_enable, &cq->ctrl->flow_control_enable); in vnic_cq_init()
50 iowrite32(color_enable, &cq->ctrl->color_enable); in vnic_cq_init()
51 iowrite32(cq_head, &cq->ctrl->cq_head); in vnic_cq_init()
52 iowrite32(cq_tail, &cq->ctrl->cq_tail); in vnic_cq_init()
53 iowrite32(cq_tail_color, &cq->ctrl->cq_tail_color); in vnic_cq_init()
54 iowrite32(interrupt_enable, &cq->ctrl->interrupt_enable); in vnic_cq_init()
55 iowrite32(cq_entry_enable, &cq->ctrl->cq_entry_enable); in vnic_cq_init()
56 iowrite32(cq_message_enable, &cq->ctrl->cq_message_enable); in vnic_cq_init()
57 iowrite32(interrupt_offset, &cq->ctrl->interrupt_offset); in vnic_cq_init()
58 writeq(cq_message_addr, &cq->ctrl->cq_message_addr); in vnic_cq_init()
60 cq->interrupt_offset = interrupt_offset; 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()