drivers/net/ethernet/cavium/thunder/nic_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/cavium/thunder/nic_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/cavium/thunder/nic_main.c- Extension
.c- Size
- 39194 bytes
- Lines
- 1417
- 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/module.hlinux/interrupt.hlinux/pci.hlinux/etherdevice.hlinux/of.hlinux/if_vlan.hnic_reg.hnic.hq_struct.hthunder_bgx.h
Detected Declarations
struct hw_infostruct nicpffunction nic_reg_writefunction nic_reg_readfunction nic_enable_mbx_intrfunction nic_clear_mbx_intrfunction nic_get_mbx_addrfunction nic_send_msg_to_vffunction MBOXfunction nic_mbx_send_readyfunction nic_mbx_send_ackfunction nic_mbx_send_nackfunction nic_rcv_queue_sw_syncfunction nic_get_bgx_statsfunction nic_update_hw_frsfunction nic_set_tx_pkt_padfunction nic_set_lmac_vf_mappingfunction nic_get_hw_infofunction nic_init_hwfunction nic_config_cpifunction nic_send_rss_sizefunction nic_config_rssfunction nic_tx_channel_cfgfunction nic_send_pnicvffunction nic_send_snicvffunction nic_nxt_avail_sqsfunction nic_alloc_sqsfunction nic_config_loopbackfunction nic_reset_stat_countersfunction nic_enable_tunnel_parsingfunction nic_enable_vffunction nic_pause_framefunction nic_config_timestampfunction nic_link_status_getfunction nic_handle_mbx_intrfunction nic_mbx_intr_handlerfunction nic_free_all_interruptsfunction nic_register_interruptsfunction nic_unregister_interruptsfunction nic_num_sqs_enfunction nic_sriov_initfunction nic_probefunction nic_removefunction nic_init_modulefunction nic_cleanup_modulemodule init nic_init_module
Annotated Snippet
static struct pci_driver nic_driver = {
.name = DRV_NAME,
.id_table = nic_id_table,
.probe = nic_probe,
.remove = nic_remove,
};
static int __init nic_init_module(void)
{
pr_info("%s, ver %s\n", DRV_NAME, DRV_VERSION);
return pci_register_driver(&nic_driver);
}
static void __exit nic_cleanup_module(void)
{
pci_unregister_driver(&nic_driver);
}
module_init(nic_init_module);
module_exit(nic_cleanup_module);
Annotation
- Immediate include surface: `linux/module.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/etherdevice.h`, `linux/of.h`, `linux/if_vlan.h`, `nic_reg.h`, `nic.h`.
- Detected declarations: `struct hw_info`, `struct nicpf`, `function nic_reg_write`, `function nic_reg_read`, `function nic_enable_mbx_intr`, `function nic_clear_mbx_intr`, `function nic_get_mbx_addr`, `function nic_send_msg_to_vf`, `function MBOX`, `function nic_mbx_send_ready`.
- 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.