Lines Matching refs:cq
24 void svnic_cq_free(struct vnic_cq *cq) in svnic_cq_free() argument
26 svnic_dev_free_desc_ring(cq->vdev, &cq->ring); in svnic_cq_free()
28 cq->ctrl = NULL; in svnic_cq_free()
31 int svnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, in svnic_cq_alloc() argument
34 cq->index = index; in svnic_cq_alloc()
35 cq->vdev = vdev; in svnic_cq_alloc()
37 cq->ctrl = svnic_dev_get_res(vdev, RES_TYPE_CQ, index); in svnic_cq_alloc()
38 if (!cq->ctrl) { in svnic_cq_alloc()
44 return svnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size); in svnic_cq_alloc()
47 void svnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable, in svnic_cq_init() argument
55 paddr = (u64)cq->ring.base_addr | VNIC_PADDR_TARGET; in svnic_cq_init()
56 writeq(paddr, &cq->ctrl->ring_base); in svnic_cq_init()
57 iowrite32(cq->ring.desc_count, &cq->ctrl->ring_size); in svnic_cq_init()
58 iowrite32(flow_control_enable, &cq->ctrl->flow_control_enable); in svnic_cq_init()
59 iowrite32(color_enable, &cq->ctrl->color_enable); in svnic_cq_init()
60 iowrite32(cq_head, &cq->ctrl->cq_head); in svnic_cq_init()
61 iowrite32(cq_tail, &cq->ctrl->cq_tail); in svnic_cq_init()
62 iowrite32(cq_tail_color, &cq->ctrl->cq_tail_color); in svnic_cq_init()
63 iowrite32(interrupt_enable, &cq->ctrl->interrupt_enable); in svnic_cq_init()
64 iowrite32(cq_entry_enable, &cq->ctrl->cq_entry_enable); in svnic_cq_init()
65 iowrite32(cq_message_enable, &cq->ctrl->cq_message_enable); in svnic_cq_init()
66 iowrite32(interrupt_offset, &cq->ctrl->interrupt_offset); in svnic_cq_init()
67 writeq(cq_message_addr, &cq->ctrl->cq_message_addr); in svnic_cq_init()
70 void svnic_cq_clean(struct vnic_cq *cq) in svnic_cq_clean() argument
72 cq->to_clean = 0; in svnic_cq_clean()
73 cq->last_color = 0; in svnic_cq_clean()
75 iowrite32(0, &cq->ctrl->cq_head); in svnic_cq_clean()
76 iowrite32(0, &cq->ctrl->cq_tail); in svnic_cq_clean()
77 iowrite32(1, &cq->ctrl->cq_tail_color); in svnic_cq_clean()
79 svnic_dev_clear_desc_ring(&cq->ring); in svnic_cq_clean()