[PATCH v2 06/12] eal: add probe and remove support for rte_driver
From: Shreyansh Jain <hidden>
Date: 2016-12-13 13:35:02
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
From: Shreyansh Jain <hidden>
Date: 2016-12-13 13:35:02
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
rte_driver now supports probe and remove. These would be used for generic device type (PCI, etc) probe and remove. Signed-off-by: Shreyansh Jain <redacted> --- lib/librte_eal/common/include/rte_dev.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 4004f9a..7d2ab16 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h@@ -145,6 +145,16 @@ void rte_eal_device_insert(struct rte_device *dev); void rte_eal_device_remove(struct rte_device *dev); /** + * Initialisation function for the driver called during probing. + */ +typedef int (driver_probe_t)(struct rte_driver *, struct rte_device *); + +/** + * Uninitialisation function for the driver called during hotplugging. + */ +typedef int (driver_remove_t)(struct rte_device *); + +/** * A structure describing a device driver. */ struct rte_driver {
@@ -152,6 +162,8 @@ struct rte_driver { struct rte_bus *bus; /**< Bus serviced by this driver */ const char *name; /**< Driver name. */ const char *alias; /**< Driver alias. */ + driver_probe_t *probe; /**< Probe the device */ + driver_remove_t *remove; /**< Remove/hotplugging the device */ }; /**
--
2.7.4