devargs: restore device type API
[dpdk.git] / lib / librte_eal / common / include / rte_dev.h
index a0d67d0..5386d3a 100644 (file)
@@ -114,6 +114,26 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...)
        } \
 } while (0)
 
+/**
+ * Device driver.
+ */
+enum rte_kernel_driver {
+       RTE_KDRV_UNKNOWN = 0,
+       RTE_KDRV_IGB_UIO,
+       RTE_KDRV_VFIO,
+       RTE_KDRV_UIO_GENERIC,
+       RTE_KDRV_NIC_UIO,
+       RTE_KDRV_NONE,
+};
+
+/**
+ * Device policies.
+ */
+enum rte_dev_policy {
+       RTE_DEV_WHITELISTED,
+       RTE_DEV_BLACKLISTED,
+};
+
 /**
  * A generic memory resource representation.
  */
@@ -132,6 +152,8 @@ struct rte_driver {
        const char *alias;              /**< Driver alias. */
 };
 
+#define RTE_DEV_NAME_MAX_LEN (32)
+
 /**
  * A structure describing a generic device.
  */
@@ -183,13 +205,12 @@ int rte_eal_dev_attach(const char *name, const char *devargs);
 /**
  * Detach a device from its driver.
  *
- * @param name
- *   Same description as for rte_eal_dev_attach().
- *   Here, eal will call the driver detaching function.
+ * @param dev
+ *   A pointer to a rte_device structure.
  * @return
  *   0 on success, negative on error.
  */
-int rte_eal_dev_detach(const char *name);
+int rte_eal_dev_detach(struct rte_device *dev);
 
 /**
  * @warning