vfio.h (b28f9db1a7ce4d537ce2fae6fbce5e5e37dc265b) vfio.h (74c98e20a604b9db58284b8727688df70e9bf643)
1/*
2 * VFIO API definition
3 *
4 * Copyright (C) 2012 Red Hat, Inc. All rights reserved.
5 * Author: Alex Williamson <alex.williamson@redhat.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 184 unchanged lines hidden (view full) ---

193 */
194struct vfio_device_info {
195 __u32 argsz;
196 __u32 flags;
197#define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */
198#define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */
199#define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2) /* vfio-platform device */
200#define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */
1/*
2 * VFIO API definition
3 *
4 * Copyright (C) 2012 Red Hat, Inc. All rights reserved.
5 * Author: Alex Williamson <alex.williamson@redhat.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 184 unchanged lines hidden (view full) ---

193 */
194struct vfio_device_info {
195 __u32 argsz;
196 __u32 flags;
197#define VFIO_DEVICE_FLAGS_RESET (1 << 0) /* Device supports reset */
198#define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */
199#define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2) /* vfio-platform device */
200#define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */
201#define VFIO_DEVICE_FLAGS_CCW (1 << 4) /* vfio-ccw device */
201 __u32 num_regions; /* Max region index + 1 */
202 __u32 num_irqs; /* Max IRQ index + 1 */
203};
204#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
205
206/*
207 * Vendor driver using Mediated device framework should provide device_api
208 * attribute in supported type attribute groups. Device API string should be one
209 * of the following corresponding to device flags in vfio_device_info structure.
210 */
211
212#define VFIO_DEVICE_API_PCI_STRING "vfio-pci"
213#define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform"
214#define VFIO_DEVICE_API_AMBA_STRING "vfio-amba"
202 __u32 num_regions; /* Max region index + 1 */
203 __u32 num_irqs; /* Max IRQ index + 1 */
204};
205#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
206
207/*
208 * Vendor driver using Mediated device framework should provide device_api
209 * attribute in supported type attribute groups. Device API string should be one
210 * of the following corresponding to device flags in vfio_device_info structure.
211 */
212
213#define VFIO_DEVICE_API_PCI_STRING "vfio-pci"
214#define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform"
215#define VFIO_DEVICE_API_AMBA_STRING "vfio-amba"
216#define VFIO_DEVICE_API_CCW_STRING "vfio-ccw"
215
216/**
217 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
218 * struct vfio_region_info)
219 *
220 * Retrieve information about a device region. Caller provides
221 * struct vfio_region_info with index value set. Caller sets argsz.
222 * Implementation of region mapping is bus driver specific. This is

--- 218 unchanged lines hidden (view full) ---

441 VFIO_PCI_INTX_IRQ_INDEX,
442 VFIO_PCI_MSI_IRQ_INDEX,
443 VFIO_PCI_MSIX_IRQ_INDEX,
444 VFIO_PCI_ERR_IRQ_INDEX,
445 VFIO_PCI_REQ_IRQ_INDEX,
446 VFIO_PCI_NUM_IRQS
447};
448
217
218/**
219 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
220 * struct vfio_region_info)
221 *
222 * Retrieve information about a device region. Caller provides
223 * struct vfio_region_info with index value set. Caller sets argsz.
224 * Implementation of region mapping is bus driver specific. This is

--- 218 unchanged lines hidden (view full) ---

443 VFIO_PCI_INTX_IRQ_INDEX,
444 VFIO_PCI_MSI_IRQ_INDEX,
445 VFIO_PCI_MSIX_IRQ_INDEX,
446 VFIO_PCI_ERR_IRQ_INDEX,
447 VFIO_PCI_REQ_IRQ_INDEX,
448 VFIO_PCI_NUM_IRQS
449};
450
451/*
452 * The vfio-ccw bus driver makes use of the following fixed region and
453 * IRQ index mapping. Unimplemented regions return a size of zero.
454 * Unimplemented IRQ types return a count of zero.
455 */
456
457enum {
458 VFIO_CCW_CONFIG_REGION_INDEX,
459 VFIO_CCW_NUM_REGIONS
460};
461
462enum {
463 VFIO_CCW_IO_IRQ_INDEX,
464 VFIO_CCW_NUM_IRQS
465};
466
449/**
450 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
451 * struct vfio_pci_hot_reset_info)
452 *
453 * Return: 0 on success, -errno on failure:
454 * -enospc = insufficient buffer, -enodev = unsupported for device.
455 */
456struct vfio_pci_dependent_device {

--- 245 unchanged lines hidden ---
467/**
468 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
469 * struct vfio_pci_hot_reset_info)
470 *
471 * Return: 0 on success, -errno on failure:
472 * -enospc = insufficient buffer, -enodev = unsupported for device.
473 */
474struct vfio_pci_dependent_device {

--- 245 unchanged lines hidden ---