Lines Matching refs:vfu_ctx

103     vfu_ctx_t *vfu_ctx;  member
150 if (o->vfu_ctx) { in vfu_object_set_socket()
178 if (o->vfu_ctx) { in vfu_object_set_device()
200 ret = vfu_run_ctx(o->vfu_ctx); in vfu_object_ctx_run()
240 ret = vfu_attach_ctx(o->vfu_ctx); in vfu_object_attach_ctx()
255 o->vfu_poll_fd = vfu_get_poll_fd(o->vfu_ctx); in vfu_object_attach_ctx()
264 static ssize_t vfu_object_cfg_access(vfu_ctx_t *vfu_ctx, char * const buf, in vfu_object_cfg_access() argument
268 VfuObject *o = vfu_get_private(vfu_ctx); in vfu_object_cfg_access()
303 static void dma_register(vfu_ctx_t *vfu_ctx, vfu_dma_info_t *info) in dma_register() argument
305 VfuObject *o = vfu_get_private(vfu_ctx); in dma_register()
330 static void dma_unregister(vfu_ctx_t *vfu_ctx, vfu_dma_info_t *info) in dma_unregister() argument
332 VfuObject *o = vfu_get_private(vfu_ctx); in dma_unregister()
480 static ssize_t vfu_object_bar##BAR_NO##_handler(vfu_ctx_t *vfu_ctx, \
484 VfuObject *o = vfu_get_private(vfu_ctx); \
513 static void vfu_object_register_bars(vfu_ctx_t *vfu_ctx, PCIDevice *pdev) in vfu_object_register_bars() argument
528 vfu_setup_region(vfu_ctx, VFU_PCI_DEV_BAR0_REGION_IDX + i, in vfu_object_register_bars()
550 vfu_ctx_t *vfu_ctx = NULL; in vfu_object_set_irq() local
565 vfu_ctx = pci_dev->irq_opaque; in vfu_object_set_irq()
567 g_assert(vfu_ctx); in vfu_object_set_irq()
569 vfu_irq_trigger(vfu_ctx, 0); in vfu_object_set_irq()
586 vfu_ctx_t *vfu_ctx = pci_dev->irq_opaque; in vfu_object_msi_trigger() local
588 vfu_irq_trigger(vfu_ctx, msg.data); in vfu_object_msi_trigger()
609 static void vfu_msix_irq_state(vfu_ctx_t *vfu_ctx, uint32_t start, in vfu_msix_irq_state() argument
612 VfuObject *o = vfu_get_private(vfu_ctx); in vfu_msix_irq_state()
620 static void vfu_msi_irq_state(vfu_ctx_t *vfu_ctx, uint32_t start, in vfu_msi_irq_state() argument
623 VfuObject *o = vfu_get_private(vfu_ctx); in vfu_msi_irq_state()
640 vfu_ctx_t *vfu_ctx = o->vfu_ctx; in vfu_object_setup_irqs() local
643 ret = vfu_setup_device_nr_irqs(vfu_ctx, VFU_DEV_INTX_IRQ, 1); in vfu_object_setup_irqs()
649 ret = vfu_setup_device_nr_irqs(vfu_ctx, VFU_DEV_MSIX_IRQ, in vfu_object_setup_irqs()
651 vfu_setup_irq_state_callback(vfu_ctx, VFU_DEV_MSIX_IRQ, in vfu_object_setup_irqs()
654 ret = vfu_setup_device_nr_irqs(vfu_ctx, VFU_DEV_MSI_IRQ, in vfu_object_setup_irqs()
656 vfu_setup_irq_state_callback(vfu_ctx, VFU_DEV_MSI_IRQ, in vfu_object_setup_irqs()
666 pci_dev->irq_opaque = vfu_ctx; in vfu_object_setup_irqs()
680 static int vfu_object_device_reset(vfu_ctx_t *vfu_ctx, vfu_reset_type_t type) in vfu_object_device_reset() argument
682 VfuObject *o = vfu_get_private(vfu_ctx); in vfu_object_device_reset()
734 if (o->vfu_ctx || !o->socket || !o->device || in vfu_object_init_ctx()
745 o->vfu_ctx = vfu_create_ctx(VFU_TRANS_SOCK, o->socket->u.q_unix.path, in vfu_object_init_ctx()
748 if (o->vfu_ctx == NULL) { in vfu_object_init_ctx()
772 ret = vfu_pci_init(o->vfu_ctx, pci_type, PCI_HEADER_TYPE_NORMAL, 0); in vfu_object_init_ctx()
785 ret = vfu_setup_region(o->vfu_ctx, VFU_PCI_DEV_CFG_REGION_IDX, in vfu_object_init_ctx()
796 ret = vfu_setup_device_dma(o->vfu_ctx, &dma_register, &dma_unregister); in vfu_object_init_ctx()
803 vfu_object_register_bars(o->vfu_ctx, o->pci_dev); in vfu_object_init_ctx()
812 ret = vfu_setup_device_reset_cb(o->vfu_ctx, &vfu_object_device_reset); in vfu_object_init_ctx()
818 ret = vfu_realize_ctx(o->vfu_ctx); in vfu_object_init_ctx()
825 o->vfu_poll_fd = vfu_get_poll_fd(o->vfu_ctx); in vfu_object_init_ctx()
836 vfu_destroy_ctx(o->vfu_ctx); in vfu_object_init_ctx()
848 o->vfu_ctx = NULL; in vfu_object_init_ctx()
888 if (o->vfu_ctx) { in vfu_object_finalize()
889 vfu_destroy_ctx(o->vfu_ctx); in vfu_object_finalize()
890 o->vfu_ctx = NULL; in vfu_object_finalize()