Lines Matching refs:vqs
77 if (snet->vqs[i] && snet->vqs[i]->irq != -1) { in snet_free_irqs()
78 devm_free_irq(&pdev->dev, snet->vqs[i]->irq, snet->vqs[i]); in snet_free_irqs()
79 snet->vqs[i]->irq = -1; in snet_free_irqs()
91 snet->vqs[idx]->desc_area = desc_area; in snet_set_vq_address()
92 snet->vqs[idx]->driver_area = driver_area; in snet_set_vq_address()
93 snet->vqs[idx]->device_area = device_area; in snet_set_vq_address()
102 snet->vqs[idx]->num = num; in snet_set_vq_num()
109 if (unlikely(!snet->vqs[idx]->ready)) in snet_kick_vq()
112 iowrite32(SNET_KICK_VAL, snet->vqs[idx]->kick_ptr); in snet_kick_vq()
121 if (unlikely(!snet->vqs[idx]->ready)) in snet_kick_vq_with_data()
124 iowrite32((data & 0xFFFF0000) | SNET_KICK_VAL, snet->vqs[idx]->kick_ptr); in snet_kick_vq_with_data()
131 snet->vqs[idx]->cb.callback = cb->callback; in snet_set_vq_cb()
132 snet->vqs[idx]->cb.private = cb->private; in snet_set_vq_cb()
139 snet->vqs[idx]->ready = ready; in snet_set_vq_ready()
146 return snet->vqs[idx]->ready; in snet_get_vq_ready()
173 memcpy(&snet->vqs[idx]->vq_state, state, sizeof(*state)); in snet_set_vq_state()
197 return snet->vqs[idx]->irq; in snet_get_vq_irq()
221 if (!snet->vqs[i]) in snet_reset_dev()
223 snet->vqs[i]->cb.callback = NULL; in snet_reset_dev()
224 snet->vqs[i]->cb.private = NULL; in snet_reset_dev()
225 snet->vqs[i]->desc_area = 0; in snet_reset_dev()
226 snet->vqs[i]->device_area = 0; in snet_reset_dev()
227 snet->vqs[i]->driver_area = 0; in snet_reset_dev()
228 snet->vqs[i]->ready = false; in snet_reset_dev()
363 tmp = (i << 16) | (snet->vqs[i]->num & 0xFFFF); in snet_write_conf()
366 snet_write32(snet, off, snet->vqs[i]->irq_idx); in snet_write_conf()
368 snet_write64(snet, off, snet->vqs[i]->desc_area); in snet_write_conf()
370 snet_write64(snet, off, snet->vqs[i]->device_area); in snet_write_conf()
372 snet_write64(snet, off, snet->vqs[i]->driver_area); in snet_write_conf()
376 snet_write32(snet, off, *(u32 *)&snet->vqs[i]->vq_state); in snet_write_conf()
416 irq = pci_irq_vector(pdev, snet->vqs[i]->irq_idx); in snet_request_irqs()
418 snet->vqs[i]->irq_name, snet->vqs[i]); in snet_request_irqs()
423 snet->vqs[i]->irq = irq; in snet_request_irqs()
803 if (!snet->vqs) in snet_free_vqs()
807 if (!snet->vqs[i]) in snet_free_vqs()
810 kfree(snet->vqs[i]); in snet_free_vqs()
812 kfree(snet->vqs); in snet_free_vqs()
819 snet->vqs = kcalloc(snet->cfg->vq_num, sizeof(void *), GFP_KERNEL); in snet_build_vqs()
820 if (!snet->vqs) in snet_build_vqs()
825 snet->vqs[i] = kzalloc(sizeof(*snet->vqs[i]), GFP_KERNEL); in snet_build_vqs()
826 if (!snet->vqs[i]) { in snet_build_vqs()
831 snet->vqs[i]->irq = -1; in snet_build_vqs()
833 snet->vqs[i]->sid = i; in snet_build_vqs()
835 snet->vqs[i]->kick_ptr = snet->bar + snet->psnet->cfg.kick_off + in snet_build_vqs()
836 snet->vqs[i]->sid * 4; in snet_build_vqs()
838 iowrite32(0, snet->vqs[i]->kick_ptr); in snet_build_vqs()
866 snet->vqs[i]->irq_idx = psnet_get_next_irq_num(psnet); in snet_reserve_irq_idx()
868 snprintf(snet->vqs[i]->irq_name, SNET_NAME_SIZE, "snet[%s]-vq[%d]", in snet_reserve_irq_idx()
869 pci_name(pdev), snet->vqs[i]->irq_idx); in snet_reserve_irq_idx()