From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 573EA6CB4 for ; Mon, 6 Mar 2017 11:01:08 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id u132so4782327wmg.1 for ; Mon, 06 Mar 2017 02:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=mjtmhBd39zPPjwuvoMp9mxeTi7EOIj75Enrrrr8zAo4=; b=quW3h9nwybGrwftwWDIlxQpD7bNHFnF5dOqltW6pe1/zG2YOwPbKUa/SvNnXnvKBfb iZieNVpGx7DAs/vBm2kCf37b4m0wf1ozlWcfp/0fFJfa7Na0c5qJW1T00nModcNc9dn+ kv8RkElYIDcBHSzPwEbwYXtS6H6GItw1F1bThKmUOGkxRUkc1jxE9J0StvAqkPAag9fM Gvhr2pWaqReKaWgHJi8FzXt8bGSjdnq51wq9k7kHrMm6r6iOvpyeFcND4Is+s2OeO4/J CmUruKCQlHmcUQuuOlM3OVJMtIe4Q/IzzJKgdbhB1aDuY2kaI83OxJZx1IRPtnU18sbV YoaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=mjtmhBd39zPPjwuvoMp9mxeTi7EOIj75Enrrrr8zAo4=; b=i8rpRkphlA3GegKechfFoXNIt0c53+tml92UymNDZLjQ3WtaFwAt5nnY7cUrSlUaax C2/TbDceSdkQ3EFM8YXQaHKUHWB3ZqCUjsG7GN8wa7fuawp/cgmEE6bqGjvn8XD1jQF7 TAAgjXnokfkFJr4zlTnw89iYeveVr1rHhSEX4T1aLQ+n+t+bZ/f6wCNF+G3ojNJU1sz9 Y2Om0lJRzOpekhZ3D1Fj4YoEjrvJr4HNXLqp+Sshg86ZUjgHijLcULiTRChawZRNUI9z VhxaUTOESs+/A5UWaSiEYVg7hsqKPgAwdL+IJOxoK3+rC4ATMecDJkpg75Gscx6GB1os FWWQ== X-Gm-Message-State: AMke39mtdcdWJq+3dAVVSa3f3lsCqu0gJv0qX6ZFH8RKxq+JC/bLCrqhGdyLUjelBMohow== X-Received: by 10.28.132.20 with SMTP id g20mr12428408wmd.68.1488794467581; Mon, 06 Mar 2017 02:01:07 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id u145sm3829237wmu.1.2017.03.06.02.01.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:06 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:12 +0100 Message-Id: <1488794430-25179-21-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488794430-25179-1-git-send-email-jblunck@infradead.org> References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH 20/38] net/em: Don't use eth_driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 10:01:08 -0000 Signed-off-by: Jan Blunck --- drivers/net/e1000/em_ethdev.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 4066ef9..39a62a3 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -416,16 +417,23 @@ eth_em_dev_uninit(struct rte_eth_dev *eth_dev) return 0; } -static struct eth_driver rte_em_pmd = { - .pci_drv = { - .id_table = pci_id_em_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, - }, - .eth_dev_init = eth_em_dev_init, - .eth_dev_uninit = eth_em_dev_uninit, - .dev_private_size = sizeof(struct e1000_adapter), +static int eth_em_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_probe(pci_dev, + sizeof(struct e1000_adapter), eth_em_dev_init); +} + +static int eth_em_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_em_dev_uninit); +} + +static struct rte_pci_driver rte_em_pmd = { + .id_table = pci_id_em_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_em_pci_probe, + .remove = eth_em_pci_remove, }; static int @@ -1847,6 +1855,6 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev, return 0; } -RTE_PMD_REGISTER_PCI(net_e1000_em, rte_em_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_e1000_em, rte_em_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_e1000_em, pci_id_em_map); RTE_PMD_REGISTER_KMOD_DEP(net_e1000_em, "* igb_uio | uio_pci_generic | vfio"); -- 2.7.4