From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 192E8BD28 for ; Mon, 6 Mar 2017 11:01:13 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id u48so21047048wrc.1 for ; Mon, 06 Mar 2017 02:01:13 -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=4uDatJsOB1EQ+XbQdc4m3e5zr5o/sHjVPXQPg3+yYlg=; b=oOL1YrdlOFVRDgQmppc9XTjT9fh8ErcIhUdlZ83WvWJh7w1T5MRieoL3T78sPEutI6 GDMuj2oyrIfHH02+k0nLclMUxIlPI2Uv13JL6Ij215HbNDiEVyiq4WlQNOHt/DoOi1FP rkXHgw+nWUPEa/3fBtzrpq1TMKYELhsvX1to7aUX79SDnaUpQEnrN4ORqNlpEVyqOHxY OQc6eEmYHWwxrjtklTqXufeLafmzuZsanCRyVB+3F7t9v0xbTrpshbW7zna+2csGU24p BFM8zJFQeVFuIt21REY8U9nDCAc6Wfw9okvTBHgIDOM6niMeXhYBzrzErZgRk/Kz79jo Pr+A== 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=4uDatJsOB1EQ+XbQdc4m3e5zr5o/sHjVPXQPg3+yYlg=; b=NX7t0lQmAnGgiBae/DoTVuGW1mPU4DxC0aW2yBAlEntfD90m/AgmyyO7fVuUP6QvcO FjM90ApPUsBmkGPIXfRL5Q/WdonzSlcqIxUnly5CpasglCpK3Svb9AqO10COpSxtE4Ln bJk0EIRrGuJDNiKUyFz8eaFu+3Y2QP6e5MQci0k0aCQ23Oh6zWMkTIuUg7ZPLYt21QoL omDcZ0W7UCmszI4cYV++BaVz54zagfeFNfp5OKHdbWITwx8KYBNHIy6ER1Ozny9apieq LRiFhVDhBbpOP2DUqg/vjN4eoWuzBaYPs/erKP7HzP7HLO+MFSXy96o78t7v0Hf9AMcK XzFA== X-Gm-Message-State: AMke39mPbnUO+1AHwDIJJl2HQhmxlG/41Vt6FCdvA0c9zX68cvfU7EqXN1gl0OBwAmct1Q== X-Received: by 10.223.130.214 with SMTP id 80mr14438212wrc.43.1488794472666; Mon, 06 Mar 2017 02:01:12 -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.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:11 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:16 +0100 Message-Id: <1488794430-25179-25-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 24/38] net/fm10k: 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:13 -0000 Signed-off-by: Jan Blunck --- drivers/net/fm10k/fm10k_ethdev.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index c4fe746..5bb0426 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -3067,6 +3068,18 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev) return 0; } +static int eth_fm10k_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 fm10k_adapter), eth_fm10k_dev_init); +} + +static int eth_fm10k_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_fm10k_dev_uninit); +} + /* * The set of PCI devices this driver supports. This driver will enable both PF * and SRIOV-VF devices. @@ -3078,18 +3091,13 @@ static const struct rte_pci_id pci_id_fm10k_map[] = { { .vendor_id = 0, /* sentinel */ }, }; -static struct eth_driver rte_pmd_fm10k = { - .pci_drv = { - .id_table = pci_id_fm10k_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_fm10k_dev_init, - .eth_dev_uninit = eth_fm10k_dev_uninit, - .dev_private_size = sizeof(struct fm10k_adapter), +static struct rte_pci_driver rte_pmd_fm10k = { + .id_table = pci_id_fm10k_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_fm10k_pci_probe, + .remove = eth_fm10k_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_fm10k, rte_pmd_fm10k.pci_drv); +RTE_PMD_REGISTER_PCI(net_fm10k, rte_pmd_fm10k); RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map); RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio"); -- 2.7.4