Lines Matching refs:dev

30 	struct virtio_vfio_user_dev *dev = vdev->ctx;
33 return spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
34 dev->pci_cap_device_specific_offset + offset,
42 struct virtio_vfio_user_dev *dev = vdev->ctx;
45 return spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
46 dev->pci_cap_device_specific_offset + offset,
53 struct virtio_vfio_user_dev *dev = vdev->ctx;
58 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_STATUS;
59 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
73 struct virtio_vfio_user_dev *dev = vdev->ctx;
79 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_STATUS;
80 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
90 struct virtio_vfio_user_dev *dev = vdev->ctx;
96 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_DFSELECT;
97 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
103 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_DF;
105 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
112 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_DFSELECT;
113 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
119 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_DF;
121 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
135 struct virtio_vfio_user_dev *dev = vdev->ctx;
141 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_GFSELECT;
142 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
149 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_GF;
151 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
159 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_GFSELECT;
160 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
167 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_GF;
169 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
184 struct virtio_vfio_user_dev *dev = vdev->ctx;
186 if (dev) {
187 spdk_vfio_user_release(dev->ctx);
188 free(dev);
195 struct virtio_vfio_user_dev *dev = vdev->ctx;
200 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_SELECT;
201 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
208 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_SIZE;
209 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
224 struct virtio_vfio_user_dev *dev = vdev->ctx;
252 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_SELECT;
253 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
260 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_DESCLO;
262 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
269 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_DESCHI;
271 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
278 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_AVAILLO;
280 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
287 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_AVAILHI;
289 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
296 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_USEDLO;
298 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
305 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_USEDHI;
307 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
314 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_NOFF;
315 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
322 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_ENABLE;
324 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
345 struct virtio_vfio_user_dev *dev = vdev->ctx;
350 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_SELECT;
351 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
359 offset = dev->pci_cap_common_cfg_offset + VIRTIO_PCI_COMMON_Q_ENABLE;
360 rc = spdk_vfio_user_pci_bar_access(dev->ctx, dev->pci_cap_region,
393 struct virtio_vfio_user_dev *dev;
408 dev = calloc(1, sizeof(*dev));
409 if (dev == NULL) {
413 rc = virtio_dev_construct(vdev, name, &virtio_vfio_user_ops, dev);
416 free(dev);
420 snprintf(dev->path, PATH_MAX, "%s", path);
421 dev->ctx = spdk_vfio_user_setup(path);
422 if (!dev->ctx) {
429 rc = spdk_vfio_user_pci_bar_access(dev->ctx, VFIO_PCI_CONFIG_REGION_INDEX, 4, 2,
437 rc = spdk_vfio_user_pci_bar_access(dev->ctx, VFIO_PCI_CONFIG_REGION_INDEX, 4, 2,
460 dev->pci_cap_region = VFIO_PCI_BAR4_REGION_INDEX;
461 dev->pci_cap_common_cfg_offset = 0x0;
462 dev->pci_cap_common_cfg_length = 0x1000;
463 dev->pci_cap_device_specific_offset = 0x2000;
464 dev->pci_cap_device_specific_length = 0x1000;
465 dev->pci_cap_notifications_offset = 0x3000;
466 dev->pci_cap_notifications_length = 0x1000;