drivers/net/ethernet/netronome/nfp/nfp_app_nic.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/nfp_app_nic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/netronome/nfp/nfp_app_nic.c- Extension
.c- Size
- 976 bytes
- Lines
- 45
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
nfpcore/nfp_cpp.hnfpcore/nfp_nsp.hnfp_app.hnfp_main.hnfp_net.hnfp_port.h
Detected Declarations
function nfp_app_nic_vnic_init_phy_portfunction nfp_app_nic_vnic_alloc
Annotated Snippet
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
/* Copyright (C) 2017-2018 Netronome Systems, Inc. */
#include "nfpcore/nfp_cpp.h"
#include "nfpcore/nfp_nsp.h"
#include "nfp_app.h"
#include "nfp_main.h"
#include "nfp_net.h"
#include "nfp_port.h"
int nfp_app_nic_vnic_init_phy_port(struct nfp_pf *pf, struct nfp_app *app,
struct nfp_net *nn, unsigned int id)
{
int err;
if (!pf->eth_tbl)
return 0;
nn->port = nfp_port_alloc(app, NFP_PORT_PHYS_PORT, nn->dp.netdev);
if (IS_ERR(nn->port))
return PTR_ERR(nn->port);
err = nfp_port_init_phy_port(pf, app, nn->port, id);
if (err) {
nfp_port_free(nn->port);
return err;
}
return nn->port->type == NFP_PORT_INVALID;
}
int nfp_app_nic_vnic_alloc(struct nfp_app *app, struct nfp_net *nn,
unsigned int id)
{
int err;
err = nfp_app_nic_vnic_init_phy_port(app->pf, app, nn, id);
if (err)
return err < 0 ? err : 0;
nfp_net_get_mac_addr(app->pf, nn->dp.netdev, nn->port);
return 0;
}
Annotation
- Immediate include surface: `nfpcore/nfp_cpp.h`, `nfpcore/nfp_nsp.h`, `nfp_app.h`, `nfp_main.h`, `nfp_net.h`, `nfp_port.h`.
- Detected declarations: `function nfp_app_nic_vnic_init_phy_port`, `function nfp_app_nic_vnic_alloc`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.