WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / ethernet / netronome / nfp / nic / main.c
blobaea8579206ee76db0d9224a7575d29c6f2ced521
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 /* Copyright (C) 2017 Netronome Systems, Inc. */
4 #include "../nfpcore/nfp_cpp.h"
5 #include "../nfpcore/nfp_nsp.h"
6 #include "../nfp_app.h"
7 #include "../nfp_main.h"
9 static int nfp_nic_init(struct nfp_app *app)
11 struct nfp_pf *pf = app->pf;
13 if (pf->eth_tbl && pf->max_data_vnics != pf->eth_tbl->count) {
14 nfp_err(pf->cpp, "ETH entries don't match vNICs (%d vs %d)\n",
15 pf->max_data_vnics, pf->eth_tbl->count);
16 return -EINVAL;
19 return 0;
22 static int nfp_nic_sriov_enable(struct nfp_app *app, int num_vfs)
24 return 0;
27 static void nfp_nic_sriov_disable(struct nfp_app *app)
31 const struct nfp_app_type app_nic = {
32 .id = NFP_APP_CORE_NIC,
33 .name = "nic",
35 .init = nfp_nic_init,
36 .vnic_alloc = nfp_app_nic_vnic_alloc,
38 .sriov_enable = nfp_nic_sriov_enable,
39 .sriov_disable = nfp_nic_sriov_disable,