drivers/net/ethernet/netronome/nfp/nfp_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/nfp_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/netronome/nfp/nfp_main.c- Extension
.c- Size
- 23938 bytes
- Lines
- 1002
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/mutex.hlinux/pci.hlinux/firmware.hlinux/vmalloc.hnet/devlink.hnfpcore/nfp.hnfpcore/nfp_cpp.hnfpcore/nfp_dev.hnfpcore/nfp_nffw.hnfpcore/nfp_nsp.hnfpcore/nfp6000_pcie.hnfp_abi.hnfp_app.hnfp_main.hnfp_net.h
Detected Declarations
function nfp_pf_rtsym_read_optionalfunction nfp_pf_map_rtsymfunction nfp_mbox_cmdfunction nfp_board_readyfunction nfp_pf_board_state_waitfunction nfp_pcie_sriov_read_nfd_limitfunction nfp_pcie_sriov_enablefunction nfp_pcie_sriov_disablefunction nfp_pcie_sriov_configurefunction nfp_flash_update_commonfunction nfp_net_fw_requestfunction nfp_net_fw_findfunction nfp_get_fw_policy_valuefunction nfp_fw_loadfunction nfp_nsp_has_stored_fw_loadfunction nfp_nsp_init_portsfunction nfp_nsp_initfunction nfp_fw_unloadfunction nfp_pf_find_rtsymsfunction nfp_net_pf_get_app_idfunction nfp_net_pf_get_app_capfunction nfp_pf_cfg_hwinfofunction nfp_pci_probefunction __nfp_pci_shutdownfunction nfp_pci_removefunction nfp_pci_shutdownfunction nfp_main_initfunction nfp_main_exitmodule init nfp_main_init
Annotated Snippet
static struct pci_driver nfp_pci_driver = {
.name = nfp_driver_name,
.id_table = nfp_pci_device_ids,
.probe = nfp_pci_probe,
.remove = nfp_pci_remove,
.shutdown = nfp_pci_shutdown,
.sriov_configure = nfp_pcie_sriov_configure,
};
static int __init nfp_main_init(void)
{
int err;
pr_info("%s: NFP PCIe Driver, Copyright (C) 2014-2020 Netronome Systems\n",
nfp_driver_name);
pr_info("%s: NFP PCIe Driver, Copyright (C) 2021-2022 Corigine Inc.\n",
nfp_driver_name);
nfp_net_debugfs_create();
err = pci_register_driver(&nfp_pci_driver);
if (err < 0)
goto err_destroy_debugfs;
err = pci_register_driver(&nfp_netvf_pci_driver);
if (err)
goto err_unreg_pf;
return err;
err_unreg_pf:
pci_unregister_driver(&nfp_pci_driver);
err_destroy_debugfs:
nfp_net_debugfs_destroy();
return err;
}
static void __exit nfp_main_exit(void)
{
pci_unregister_driver(&nfp_netvf_pci_driver);
pci_unregister_driver(&nfp_pci_driver);
nfp_net_debugfs_destroy();
}
module_init(nfp_main_init);
module_exit(nfp_main_exit);
MODULE_FIRMWARE("netronome/nic_AMDA0058-0011_2x40.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0058-0012_2x40.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0081-0001_1x40.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0081-0001_4x10.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0096-0001_2x10.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0097-0001_2x40.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0097-0001_4x10_1x40.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0097-0001_8x10.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0099-0001_2x10.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0099-0001_2x25.nffw");
MODULE_FIRMWARE("netronome/nic_AMDA0099-0001_1x10_1x25.nffw");
MODULE_AUTHOR("Corigine, Inc. <oss-drivers@corigine.com>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("The Network Flow Processor (NFP) driver.");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/mutex.h`, `linux/pci.h`, `linux/firmware.h`, `linux/vmalloc.h`, `net/devlink.h`, `nfpcore/nfp.h`.
- Detected declarations: `function nfp_pf_rtsym_read_optional`, `function nfp_pf_map_rtsym`, `function nfp_mbox_cmd`, `function nfp_board_ready`, `function nfp_pf_board_state_wait`, `function nfp_pcie_sriov_read_nfd_limit`, `function nfp_pcie_sriov_enable`, `function nfp_pcie_sriov_disable`, `function nfp_pcie_sriov_configure`, `function nfp_flash_update_common`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.