X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_dev.h;h=f601d21ea2d997440a28f4ae94b161fe56648cc2;hb=1e496d6fdf94d7e3d597a6e59a6c16befe0ecd2b;hp=f7e3a104a4e9055754dd79aefed7ff62260dd5a0;hpb=6bc2415c3387ae72f2ce3677f0e3540e734583d5;p=dpdk.git diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index f7e3a104a4..f601d21ea2 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -56,6 +56,11 @@ TAILQ_HEAD(rte_driver_list, rte_driver); */ 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 */ @@ -72,6 +77,7 @@ struct rte_driver { 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. */ }; /** @@ -97,6 +103,28 @@ void rte_eal_driver_unregister(struct rte_driver *driver); */ int rte_eal_dev_init(void); +/** + * Initialize a driver specified by name. + * + * @param name + * The pointer to a driver name to be initialized. + * @param args + * The pointer to arguments used by driver initialization. + * @return + * 0 on success, negative on error + */ +int rte_eal_vdev_init(const char *name, const char *args); + +/** + * Uninitalize a driver specified by name. + * + * @param name + * The pointer to a driver name to be initialized. + * @return + * 0 on success, negative on error + */ +int rte_eal_vdev_uninit(const char *name); + #define PMD_REGISTER_DRIVER(d)\ void devinitfn_ ##d(void);\ void __attribute__((constructor, used)) devinitfn_ ##d(void)\