From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: [PATCH v5 05/12] eal: add probe and remove support for rte_driver Date: Mon, 26 Dec 2016 18:53:58 +0530 Message-ID: <1482758645-23057-6-git-send-email-shreyansh.jain@nxp.com> References: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , Shreyansh Jain To: Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0065.outbound.protection.outlook.com [104.47.33.65]) by dpdk.org (Postfix) with ESMTP id 4F54CF614 for ; Mon, 26 Dec 2016 14:21:24 +0100 (CET) In-Reply-To: <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 8ac09e0..3a3dc9b 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