drivers/net/dsa/netc/netc_main.c
Source file repositories/reference/linux-study-clean/drivers/net/dsa/netc/netc_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/dsa/netc/netc_main.c- Extension
.c- Size
- 64615 bytes
- Lines
- 2525
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/clk.hlinux/etherdevice.hlinux/fsl/enetc_mdio.hlinux/if_bridge.hlinux/if_vlan.hlinux/of_mdio.hnetc_switch.h
Detected Declarations
function netc_lookup_fdb_entryfunction netc_destroy_fdb_listfunction netc_lookup_vlan_entryfunction netc_destroy_vlan_listfunction netc_get_tag_protocolfunction netc_port_rmwfunction netc_mac_port_wrfunction netc_mac_port_rmwfunction netc_port_get_capabilityfunction netc_port_get_info_from_dtfunction netc_port_create_emdio_busfunction netc_port_create_mdio_busfunction netc_init_switch_idfunction netc_get_switch_capabilitiesfunction netc_init_all_portsfunction dsa_switch_for_each_available_portfunction netc_init_ntmp_tbl_versionsfunction netc_init_all_cbdrsfunction netc_remove_all_cbdrsfunction netc_num_available_portsfunction netc_init_ntmp_bitmap_sizesfunction netc_init_ntmp_bitmapsfunction netc_free_ntmp_bitmapsfunction netc_init_ntmp_userfunction netc_free_ntmp_userfunction netc_clean_fdbt_ageing_entriesfunction netc_switch_dos_default_configfunction netc_switch_vfht_default_configfunction netc_port_set_max_frame_sizefunction netc_switch_fixed_configfunction netc_port_set_tc_max_sdufunction netc_port_set_all_tc_msdufunction netc_port_set_mlofunction netc_port_set_pvidfunction netc_port_set_vlan_awarefunction netc_port_fixed_configfunction netc_port_default_configfunction netc_available_port_bitmapfunction netc_add_standalone_vlan_entryfunction netc_port_add_fdb_entryfunction netc_port_set_fdb_entryfunction netc_port_del_fdb_entryfunction netc_add_standalone_fdb_bcast_entryfunction dsa_switch_for_each_cpu_portfunction netc_port_set_pbpmcrfunction netc_ipv_to_buffer_pool_mappingfunction netc_switch_bpt_default_configfunction netc_setup
Annotated Snippet
static struct pci_driver netc_switch_driver = {
.name = KBUILD_MODNAME,
.id_table = netc_switch_ids,
.probe = netc_switch_probe,
.remove = netc_switch_remove,
.shutdown = netc_switch_shutdown,
};
module_pci_driver(netc_switch_driver);
MODULE_DESCRIPTION("NXP NETC Switch driver");
MODULE_LICENSE("Dual BSD/GPL");
Annotation
- Immediate include surface: `linux/clk.h`, `linux/etherdevice.h`, `linux/fsl/enetc_mdio.h`, `linux/if_bridge.h`, `linux/if_vlan.h`, `linux/of_mdio.h`, `netc_switch.h`.
- Detected declarations: `function netc_lookup_fdb_entry`, `function netc_destroy_fdb_list`, `function netc_lookup_vlan_entry`, `function netc_destroy_vlan_list`, `function netc_get_tag_protocol`, `function netc_port_rmw`, `function netc_mac_port_wr`, `function netc_mac_port_rmw`, `function netc_port_get_capability`, `function netc_port_get_info_from_dt`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.