bus: add probing
[dpdk.git] / lib / librte_eal / common / include / rte_bus.h
index b01930a..7c36969 100644 (file)
@@ -69,6 +69,18 @@ TAILQ_HEAD(rte_bus_list, rte_bus);
  */
 typedef int (*rte_bus_scan_t)(void);
 
+/**
+ * Implementation specific probe function which is responsible for linking
+ * devices on that bus with applicable drivers.
+ *
+ * This is called while iterating over each registered bus.
+ *
+ * @return
+ *     0 for successful probe
+ *     !0 for any error while probing
+ */
+typedef int (*rte_bus_probe_t)(void);
+
 /**
  * A structure describing a generic bus.
  */
@@ -76,6 +88,7 @@ struct rte_bus {
        TAILQ_ENTRY(rte_bus) next;   /**< Next bus object in linked list */
        const char *name;            /**< Name of the bus */
        rte_bus_scan_t scan;         /**< Scan for devices attached to bus */
+       rte_bus_probe_t probe;       /**< Probe devices on bus */
 };
 
 /**
@@ -105,6 +118,16 @@ void rte_bus_unregister(struct rte_bus *bus);
  */
 int rte_bus_scan(void);
 
+/**
+ * For each device on the buses, perform a driver 'match' and call the
+ * driver-specific probe for device initialization.
+ *
+ * @return
+ *      0 for successful match/probe
+ *     !0 otherwise
+ */
+int rte_bus_probe(void);
+
 /**
  * Dump information of all the buses registered with EAL.
  *