drivers/net/ethernet/mellanox/mlxsw/core.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxsw/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlxsw/core.c- Extension
.c- Size
- 97638 bytes
- Lines
- 3417
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/kernel.hlinux/module.hlinux/device.hlinux/export.hlinux/err.hlinux/if_link.hlinux/netdevice.hlinux/completion.hlinux/skbuff.hlinux/etherdevice.hlinux/types.hlinux/string.hlinux/gfp.hlinux/random.hlinux/jiffies.hlinux/mutex.hlinux/rcupdate.hlinux/slab.hlinux/workqueue.hlinux/firmware.hasm/byteorder.hnet/devlink.htrace/events/devlink.hcore.hcore_env.hitem.hcmd.hport.htrap.hemad.hreg.hresources.h
Detected Declarations
struct mlxsw_core_portstruct mlxsw_corestruct mlxsw_rx_listener_itemstruct mlxsw_event_listener_itemstruct mlxsw_emad_tlv_offsetsstruct mlxsw_reg_transstruct mlxsw_core_fw_infostruct mlxsw_core_health_eventstruct mlxsw_core_irq_event_handler_itemenum mlxsw_core_reg_access_typefunction mlxsw_core_port_checkfunction mlxsw_core_linecards_setfunction mlxsw_ports_occ_getfunction mlxsw_core_resources_ports_registerfunction mlxsw_ports_initfunction mlxsw_ports_finifunction mlxsw_core_max_portsfunction mlxsw_core_max_lagfunction mlxsw_core_lag_modefunction mlxsw_core_flood_modefunction mlxsw_core_fw_rev_minor_subminor_validatefunction mlxsw_core_trap_groups_setfunction mlxsw_core_reg_access_type_strfunction mlxsw_emad_pack_end_tlvfunction mlxsw_emad_pack_reg_tlvfunction mlxsw_emad_pack_string_tlvfunction mlxsw_emad_pack_op_tlvfunction mlxsw_emad_pack_latency_tlvfunction mlxsw_emad_construct_eth_hdrfunction mlxsw_emad_constructfunction mlxsw_emad_tlv_is_string_tlvfunction mlxsw_emad_tlv_is_latency_tlvfunction mlxsw_emad_tlv_parsefunction mlxsw_emad_get_tidfunction mlxsw_emad_is_respfunction mlxsw_emad_process_statusfunction mlxsw_emad_process_status_skbfunction mlxsw_emad_process_string_tlvfunction mlxsw_emad_trans_timeout_schedulefunction mlxsw_emad_transmitfunction mlxsw_emad_trans_finishfunction mlxsw_emad_transmit_retryfunction mlxsw_emad_trans_timeout_workfunction mlxsw_emad_process_responsefunction mlxsw_emad_rx_listener_funcfunction list_for_each_entry_rcufunction mlxsw_emad_tlv_enablefunction mlxsw_emad_tlv_disable
Annotated Snippet
module_init(mlxsw_core_module_init);
module_exit(mlxsw_core_module_exit);
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Jiri Pirko <jiri@mellanox.com>");
MODULE_DESCRIPTION("Mellanox switch device core driver");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/device.h`, `linux/export.h`, `linux/err.h`, `linux/if_link.h`, `linux/netdevice.h`, `linux/completion.h`.
- Detected declarations: `struct mlxsw_core_port`, `struct mlxsw_core`, `struct mlxsw_rx_listener_item`, `struct mlxsw_event_listener_item`, `struct mlxsw_emad_tlv_offsets`, `struct mlxsw_reg_trans`, `struct mlxsw_core_fw_info`, `struct mlxsw_core_health_event`, `struct mlxsw_core_irq_event_handler_item`, `enum mlxsw_core_reg_access_type`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.