From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 62EDC5927 for ; Mon, 6 Mar 2017 11:01:05 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id v190so12806713wme.3 for ; Mon, 06 Mar 2017 02:01:05 -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=2gnwVujwQkj4KDbA3My/RJNJd6g/83pRYXg2m7/SLWo=; b=pjSOW+mGF3mFXEAbp5EQEvI1zw/Xz1P/CUyuV7+wVch2yGmbRO3K5msnpaizQoolKz K+HUgi8qMJQeUGlIYVpU+xduwlMyA2q/0t0ItyRy9ij0WiCQuWMz44uhDwiN2gUym3Mz 5YJ4FDDh8KvaoTPIsxkp2jZserOpfBReW/wY+d10290Sv327W6WD6OA6e7s+rQ6aUOoZ M+cWiPxEvZ7RwNrAVAy6sR+WDj36vFAP3By3ZyncAuIV8MMU1pwKcNuRTgrpXFn65rJQ R/GVr2ILo4kyRHSOfCR5my/O9BbER7o9e9LBE71zbNv8VTVlDeCR6lX17BaDPyNlteXS BU8g== 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=2gnwVujwQkj4KDbA3My/RJNJd6g/83pRYXg2m7/SLWo=; b=mbgsUQl7Iq+YR22wDxYcv0G6m+HaeOqAzd/DiokPILoGh2vRS6T7951JygtUIX0I9t GPUgXY7WqChwoUvREUPzlaSuq2RPzbzlDQ4MXTsUqZI4t9snICwArV+Zm6uo+nJ2JMMd J+fIWfPyb8pxY5s7Z+m7rBACRcPEMKSPE2yEEUASrNbYa4uOYVcGBXdxVjnJ8hNUlpN0 8SYIDFR4j7aeb9HDbwuJUTofqGIg61n13ppA/e+waypsRT7aN4VJB82nGiaVv0E8oAPO v3qxmkeKTlDRv6+t56uFTX0X7wc2WEpNUSsTx4BnIMiQg9pAExc9VbdRD7LL15hX1T+G aTAg== X-Gm-Message-State: AMke39myJCIq3sYc12gc7U7M9vND94IwodjtJCOB8tAg0kf3o/RDItB/L7O1z9sN/7izJg== X-Received: by 10.28.20.148 with SMTP id 142mr5746281wmu.134.1488794464988; Mon, 06 Mar 2017 02:01:04 -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.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:04 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:10 +0100 Message-Id: <1488794430-25179-19-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 18/38] net/bnxt: 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:05 -0000 Signed-off-by: Jan Blunck --- drivers/net/bnxt/bnxt_ethdev.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6167443..5dc3ff0 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -1075,6 +1076,8 @@ static int bnxt_init_board(struct rte_eth_dev *eth_dev) return rc; } +static int bnxt_dev_uninit(struct rte_eth_dev *eth_dev); + static int bnxt_dev_init(struct rte_eth_dev *eth_dev) { @@ -1167,7 +1170,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev) return 0; error_free: - eth_dev->driver->eth_dev_uninit(eth_dev); + bnxt_dev_uninit(eth_dev); error: return rc; } @@ -1196,19 +1199,26 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) { return rc; } -static struct eth_driver bnxt_rte_pmd = { - .pci_drv = { - .id_table = bnxt_pci_id_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 = bnxt_dev_init, - .eth_dev_uninit = bnxt_dev_uninit, - .dev_private_size = sizeof(struct bnxt), +static int bnxt_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 bnxt), + bnxt_dev_init); +} + +static int bnxt_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, bnxt_dev_uninit); +} + +static struct rte_pci_driver bnxt_rte_pmd = { + .id_table = bnxt_pci_id_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | + RTE_PCI_DRV_INTR_LSC, + .probe = bnxt_pci_probe, + .remove = bnxt_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map); RTE_PMD_REGISTER_KMOD_DEP(net_bnxt, "* igb_uio | uio_pci_generic | vfio"); -- 2.7.4