drivers/ntb/hw/mscc/ntb_hw_switchtec.c
Source file repositories/reference/linux-study-clean/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ntb/hw/mscc/ntb_hw_switchtec.c- Extension
.c- Size
- 39369 bytes
- Lines
- 1587
- Domain
- Driver Families
- Bucket
- drivers/ntb
- 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.
- 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/interrupt.hlinux/io-64-nonatomic-lo-hi.hlinux/delay.hlinux/kthread.hlinux/module.hlinux/ntb.hlinux/pci.hlinux/switchtec.h
Detected Declarations
struct shared_mwstruct switchtec_ntbenum switchtec_msgfunction switchtec_ntb_part_opfunction switchtec_ntb_send_msgfunction switchtec_ntb_mw_countfunction lut_indexfunction peer_lut_indexfunction switchtec_ntb_mw_get_alignfunction switchtec_ntb_mw_clr_directfunction switchtec_ntb_mw_clr_lutfunction switchtec_ntb_mw_set_directfunction switchtec_ntb_mw_set_lutfunction switchtec_ntb_mw_set_transfunction switchtec_ntb_peer_mw_countfunction switchtec_ntb_direct_get_addrfunction switchtec_ntb_lut_get_addrfunction switchtec_ntb_peer_mw_get_addrfunction switchtec_ntb_part_link_speedfunction switchtec_ntb_set_link_speedfunction crosslink_is_enabledfunction crosslink_init_dbmsgsfunction switchtec_ntb_link_status_updatefunction check_link_status_workfunction switchtec_ntb_check_linkfunction switchtec_ntb_link_notificationfunction switchtec_ntb_link_is_upfunction switchtec_ntb_link_enablefunction switchtec_ntb_link_disablefunction switchtec_ntb_db_valid_maskfunction switchtec_ntb_db_vector_countfunction switchtec_ntb_db_vector_maskfunction switchtec_ntb_db_readfunction switchtec_ntb_db_clearfunction switchtec_ntb_db_set_maskfunction switchtec_ntb_db_clear_maskfunction switchtec_ntb_db_read_maskfunction switchtec_ntb_peer_db_addrfunction switchtec_ntb_peer_db_setfunction switchtec_ntb_spad_countfunction switchtec_ntb_spad_readfunction switchtec_ntb_spad_writefunction switchtec_ntb_peer_spad_readfunction switchtec_ntb_peer_spad_writefunction switchtec_ntb_peer_spad_addrfunction switchtec_ntb_init_sndevfunction config_rsvd_lut_winfunction config_req_id_table
Annotated Snippet
module_init(switchtec_ntb_init);
static void __exit switchtec_ntb_exit(void)
{
class_interface_unregister(&switchtec_interface);
}
module_exit(switchtec_ntb_exit);
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/io-64-nonatomic-lo-hi.h`, `linux/delay.h`, `linux/kthread.h`, `linux/module.h`, `linux/ntb.h`, `linux/pci.h`, `linux/switchtec.h`.
- Detected declarations: `struct shared_mw`, `struct switchtec_ntb`, `enum switchtec_msg`, `function switchtec_ntb_part_op`, `function switchtec_ntb_send_msg`, `function switchtec_ntb_mw_count`, `function lut_index`, `function peer_lut_index`, `function switchtec_ntb_mw_get_align`, `function switchtec_ntb_mw_clr_direct`.
- Atlas domain: Driver Families / drivers/ntb.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.