lib: work around unnamed structs/unions
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_vfio.h
index d7b527e..29f7f3e 100644 (file)
@@ -126,16 +126,27 @@ int
 vfio_get_group_no(const char *sysfs_base,
                const char *dev_addr, int *iommu_group_no);
 
-int vfio_type1_dma_map(int);
-int vfio_noiommu_dma_map(int);
-
-/* IOMMU types we support */
-static const struct vfio_iommu_type iommu_types[] = {
-       /* x86 IOMMU, otherwise known as type 1 */
-       { RTE_VFIO_TYPE1, "Type 1", &vfio_type1_dma_map},
-       /* IOMMU-less mode */
-       { RTE_VFIO_NOIOMMU, "No-IOMMU", &vfio_noiommu_dma_map},
-};
+/* open group fd or get an existing one */
+int
+vfio_get_group_fd(int iommu_group_no);
+
+/**
+ * Setup vfio_cfg for the device identified by its address. It discovers
+ * the configured I/O MMU groups or sets a new one for the device. If a new
+ * groups is assigned, the DMA mapping is performed.
+ * Returns 0 on success, a negative value on failure and a positive value in
+ * case the given device cannot be managed this way.
+ */
+int vfio_setup_device(const char *sysfs_base, const char *dev_addr,
+               int *vfio_dev_fd, struct vfio_device_info *device_info);
+
+int vfio_enable(const char *modname);
+int vfio_is_enabled(const char *modname);
+
+int pci_vfio_enable(void);
+int pci_vfio_is_enabled(void);
+
+int vfio_mp_sync_setup(void);
 
 #define SOCKET_REQ_CONTAINER 0x100
 #define SOCKET_REQ_GROUP 0x200