Lines Matching refs:vdev
13 struct vfio_cdx_device *vdev =
14 container_of(core_vdev, struct vfio_cdx_device, vdev);
19 vdev->regions = kcalloc(count, sizeof(struct vfio_cdx_region),
21 if (!vdev->regions)
27 vdev->regions[i].addr = res->start;
28 vdev->regions[i].size = resource_size(res);
29 vdev->regions[i].type = res->flags;
34 if (!(vdev->regions[i].addr & ~PAGE_MASK) &&
35 !(vdev->regions[i].size & ~PAGE_MASK))
36 vdev->regions[i].flags |=
38 vdev->regions[i].flags |= VFIO_REGION_INFO_FLAG_READ;
40 vdev->regions[i].flags |= VFIO_REGION_INFO_FLAG_WRITE;
48 struct vfio_cdx_device *vdev =
49 container_of(core_vdev, struct vfio_cdx_device, vdev);
51 kfree(vdev->regions);
55 static int vfio_cdx_ioctl_get_info(struct vfio_cdx_device *vdev,
59 struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev);
77 static int vfio_cdx_ioctl_get_region_info(struct vfio_cdx_device *vdev,
81 struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev);
95 info.size = vdev->regions[info.index].size;
96 info.flags = vdev->regions[info.index].flags;
104 struct vfio_cdx_device *vdev =
105 container_of(core_vdev, struct vfio_cdx_device, vdev);
110 return vfio_cdx_ioctl_get_info(vdev, uarg);
112 return vfio_cdx_ioctl_get_region_info(vdev, uarg);
143 struct vfio_cdx_device *vdev =
144 container_of(core_vdev, struct vfio_cdx_device, vdev);
153 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_MMAP))
156 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ) &&
160 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE) &&
164 return vfio_cdx_mmap_mmio(vdev->regions[index], vma);
180 struct vfio_cdx_device *vdev;
184 vdev = vfio_alloc_device(vfio_cdx_device, vdev, dev,
186 if (IS_ERR(vdev))
187 return PTR_ERR(vdev);
189 ret = vfio_register_group_dev(&vdev->vdev);
193 dev_set_drvdata(dev, vdev);
197 vfio_put_device(&vdev->vdev);
204 struct vfio_cdx_device *vdev = dev_get_drvdata(dev);
206 vfio_unregister_group_dev(&vdev->vdev);
207 vfio_put_device(&vdev->vdev);