Lines Matching refs:index
180 if (info.index >= vdev->num_regions) in vfio_platform_ioctl()
184 info.offset = VFIO_PLATFORM_INDEX_TO_OFFSET(info.index); in vfio_platform_ioctl()
185 info.size = vdev->regions[info.index].size; in vfio_platform_ioctl()
186 info.flags = vdev->regions[info.index].flags; in vfio_platform_ioctl()
202 if (info.index >= vdev->num_irqs) in vfio_platform_ioctl()
205 info.flags = vdev->irqs[info.index].flags; in vfio_platform_ioctl()
206 info.count = vdev->irqs[info.index].count; in vfio_platform_ioctl()
224 if (hdr.index >= vdev->num_irqs) in vfio_platform_ioctl()
251 ret = vfio_platform_set_irqs_ioctl(vdev, hdr.flags, hdr.index, in vfio_platform_ioctl()
323 unsigned int index = VFIO_PLATFORM_OFFSET_TO_INDEX(*ppos); in vfio_platform_read() local
326 if (index >= vdev->num_regions) in vfio_platform_read()
329 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ)) in vfio_platform_read()
332 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_read()
333 return vfio_platform_read_mmio(vdev->regions[index], in vfio_platform_read()
335 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_read()
399 unsigned int index = VFIO_PLATFORM_OFFSET_TO_INDEX(*ppos); in vfio_platform_write() local
402 if (index >= vdev->num_regions) in vfio_platform_write()
405 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)) in vfio_platform_write()
408 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_write()
409 return vfio_platform_write_mmio(vdev->regions[index], in vfio_platform_write()
411 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_write()
440 unsigned int index; in vfio_platform_mmap() local
442 index = vma->vm_pgoff >> (VFIO_PLATFORM_OFFSET_SHIFT - PAGE_SHIFT); in vfio_platform_mmap()
448 if (index >= vdev->num_regions) in vfio_platform_mmap()
455 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_MMAP)) in vfio_platform_mmap()
458 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ) in vfio_platform_mmap()
462 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE) in vfio_platform_mmap()
468 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_mmap()
469 return vfio_platform_mmap_mmio(vdev->regions[index], vma); in vfio_platform_mmap()
471 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_mmap()