eal: remove generic driver and device lists
[dpdk.git] / lib / librte_eal / common / include / rte_dev.h
index 4251099..b63d054 100644 (file)
@@ -49,6 +49,7 @@ extern "C" {
 #include <stdio.h>
 #include <sys/queue.h>
 
+#include <rte_config.h>
 #include <rte_log.h>
 
 __attribute__((format(printf, 2, 0)))
@@ -70,6 +71,19 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...)
        rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD, "%s: %s", func_name, buffer);
 }
 
+/*
+ * Enable RTE_PMD_DEBUG_TRACE() when at least one component relying on the
+ * RTE_*_RET() macros defined below is compiled in debug mode.
+ */
+#if defined(RTE_LIBRTE_ETHDEV_DEBUG) || \
+       defined(RTE_LIBRTE_CRYPTODEV_DEBUG) || \
+       defined(RTE_LIBRTE_EVENTDEV_DEBUG)
+#define RTE_PMD_DEBUG_TRACE(...) \
+       rte_pmd_debug_trace(__func__, __VA_ARGS__)
+#else
+#define RTE_PMD_DEBUG_TRACE(...) (void)0
+#endif
+
 /* Macros for checking for restricting functions to primary instance only */
 #define RTE_PROC_PRIMARY_OR_ERR_RET(retval) do { \
        if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \
@@ -109,11 +123,6 @@ struct rte_mem_resource {
        void *addr;         /**< Virtual address, NULL when not mapped. */
 };
 
-/** Double linked list of device drivers. */
-TAILQ_HEAD(rte_driver_list, rte_driver);
-/** Double linked list of devices. */
-TAILQ_HEAD(rte_device_list, rte_device);
-
 /* Forward declaration */
 struct rte_driver;
 
@@ -122,27 +131,12 @@ struct rte_driver;
  */
 struct rte_device {
        TAILQ_ENTRY(rte_device) next; /**< Next device */
+       const char *name;             /**< Device name */
        const struct rte_driver *driver;/**< Associated driver */
        int numa_node;                /**< NUMA node connection */
        struct rte_devargs *devargs;  /**< Device user arguments */
 };
 
-/**
- * Insert a device detected by a bus scanning.
- *
- * @param dev
- *   A pointer to a rte_device structure describing the detected device.
- */
-void rte_eal_device_insert(struct rte_device *dev);
-
-/**
- * Remove a device (e.g. when being unplugged).
- *
- * @param dev
- *   A pointer to a rte_device structure describing the device to be removed.
- */
-void rte_eal_device_remove(struct rte_device *dev);
-
 /**
  * A structure describing a device driver.
  */
@@ -152,24 +146,6 @@ struct rte_driver {
        const char *alias;              /**< Driver alias. */
 };
 
-/**
- * Register a device driver.
- *
- * @param driver
- *   A pointer to a rte_dev structure describing the driver
- *   to be registered.
- */
-void rte_eal_driver_register(struct rte_driver *driver);
-
-/**
- * Unregister a device driver.
- *
- * @param driver
- *   A pointer to a rte_dev structure describing the driver
- *   to be unregistered.
- */
-void rte_eal_driver_unregister(struct rte_driver *driver);
-
 /**
  * Initialize a driver specified by name.
  *