drivers: use vdev registration
[dpdk.git] / lib / librte_eal / common / include / rte_dev.h
index 94ae14e..8796f97 100644 (file)
@@ -104,16 +104,6 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...)
 /** Double linked list of device drivers. */
 TAILQ_HEAD(rte_driver_list, rte_driver);
 
-/**
- * Initialization function called for each device driver once.
- */
-typedef int (rte_dev_init_t)(const char *name, const char *args);
-
-/**
- * Uninitilization function called for each device driver once.
- */
-typedef int (rte_dev_uninit_t)(const char *name);
-
 /**
  * Driver type enumeration
  */
@@ -129,8 +119,6 @@ struct rte_driver {
        TAILQ_ENTRY(rte_driver) next;  /**< Next in list. */
        enum pmd_type type;                /**< PMD Driver type */
        const char *name;                   /**< Driver name. */
-       rte_dev_init_t *init;              /**< Device init. function. */
-       rte_dev_uninit_t *uninit;          /**< Device uninit. function. */
 };
 
 /**
@@ -178,6 +166,32 @@ int rte_eal_vdev_init(const char *name, const char *args);
  */
 int rte_eal_vdev_uninit(const char *name);
 
+/**
+ * Attach a device to a registered driver.
+ *
+ * @param name
+ *   The device name, that refers to a pci device (or some private
+ *   way of designating a vdev device). Based on this device name, eal
+ *   will identify a driver capable of handling it and pass it to the
+ *   driver probing function.
+ * @param devargs
+ *   Device arguments to be passed to the driver.
+ * @return
+ *   0 on success, negative on error.
+ */
+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.
+ * @return
+ *   0 on success, negative on error.
+ */
+int rte_eal_dev_detach(const char *name);
+
 #define DRIVER_EXPORT_NAME_ARRAY(n, idx) n##idx[]
 
 #define DRIVER_EXPORT_NAME(name, idx) \