Lines Matching refs:index
236 if (info.index >= vdev->num_regions) in vfio_platform_ioctl()
240 info.offset = VFIO_PLATFORM_INDEX_TO_OFFSET(info.index); in vfio_platform_ioctl()
241 info.size = vdev->regions[info.index].size; in vfio_platform_ioctl()
242 info.flags = vdev->regions[info.index].flags; in vfio_platform_ioctl()
258 if (info.index >= vdev->num_irqs) in vfio_platform_ioctl()
261 info.flags = vdev->irqs[info.index].flags; in vfio_platform_ioctl()
262 info.count = vdev->irqs[info.index].count; in vfio_platform_ioctl()
280 if (hdr.index >= vdev->num_irqs) in vfio_platform_ioctl()
307 ret = vfio_platform_set_irqs_ioctl(vdev, hdr.flags, hdr.index, in vfio_platform_ioctl()
383 unsigned int index = VFIO_PLATFORM_OFFSET_TO_INDEX(*ppos); in vfio_platform_read() local
386 if (index >= vdev->num_regions) in vfio_platform_read()
389 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ)) in vfio_platform_read()
392 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_read()
393 return vfio_platform_read_mmio(&vdev->regions[index], in vfio_platform_read()
395 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_read()
459 unsigned int index = VFIO_PLATFORM_OFFSET_TO_INDEX(*ppos); in vfio_platform_write() local
462 if (index >= vdev->num_regions) in vfio_platform_write()
465 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)) in vfio_platform_write()
468 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_write()
469 return vfio_platform_write_mmio(&vdev->regions[index], in vfio_platform_write()
471 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_write()
500 unsigned int index; in vfio_platform_mmap() local
502 index = vma->vm_pgoff >> (VFIO_PLATFORM_OFFSET_SHIFT - PAGE_SHIFT); in vfio_platform_mmap()
508 if (index >= vdev->num_regions) in vfio_platform_mmap()
515 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_MMAP)) in vfio_platform_mmap()
518 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ) in vfio_platform_mmap()
522 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE) in vfio_platform_mmap()
528 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_mmap()
529 return vfio_platform_mmap_mmio(vdev->regions[index], vma); in vfio_platform_mmap()
531 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_mmap()