drivers/message/fusion/mptsas.c
Source file repositories/reference/linux-study-clean/drivers/message/fusion/mptsas.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/message/fusion/mptsas.c- Extension
.c- Size
- 152242 bytes
- Lines
- 5462
- Domain
- Driver Families
- Bucket
- drivers/message
- 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.
- 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/kernel.hlinux/slab.hlinux/init.hlinux/errno.hlinux/jiffies.hlinux/workqueue.hlinux/delay.hscsi/scsi.hscsi/scsi_cmnd.hscsi/scsi_device.hscsi/scsi_host.hscsi/scsi_transport_sas.hscsi/scsi_transport.hscsi/scsi_dbg.hmptbase.hmptscsih.hmptsas.h
Detected Declarations
struct rep_manu_requeststruct rep_manu_replyenum device_statefunction mptsas_print_phy_datafunction mptsas_print_phy_pg0function mptsas_print_phy_pg1function mptsas_print_device_pg0function mptsas_print_expander_pg1function mptsas_fw_event_offfunction mptsas_fw_event_onfunction mptsas_add_fw_eventfunction mptsas_requeue_fw_eventfunction __mptsas_free_fw_eventfunction mptsas_free_fw_eventfunction mptsas_cleanup_fw_event_qfunction list_for_each_entry_safefunction mptsas_find_portinfo_by_handlefunction mptsas_find_portinfo_by_sas_addressfunction mptsas_is_end_devicefunction mptsas_port_deletefunction mptsas_get_rphyfunction mptsas_set_rphyfunction mptsas_get_portfunction mptsas_set_portfunction mptsas_get_stargetfunction mptsas_set_stargetfunction mptsas_add_device_componentfunction mptsas_add_device_component_by_fwfunction mptsas_add_device_component_starget_irfunction list_for_each_entryfunction mptsas_add_device_component_stargetfunction mptsas_del_device_component_by_osfunction mptsas_del_device_componentsfunction mptsas_setup_wide_portsfunction mptsas_find_vtargetfunction shost_for_each_devicefunction mptsas_queue_device_deletefunction mptsas_queue_rescanfunction mptsas_target_resetfunction mptsas_block_io_sdevfunction mptsas_block_io_stargetfunction mptsas_target_reset_queuefunction mptsas_schedule_target_resetfunction mptsas_taskmgmt_completefunction mptsas_ioc_resetfunction mptsas_sas_enclosure_pg0function mptsas_del_end_devicefunction mptsas_refreshing_device_handles
Annotated Snippet
static struct pci_driver mptsas_driver = {
.name = "mptsas",
.id_table = mptsas_pci_table,
.probe = mptsas_probe,
.remove = mptsas_remove,
.shutdown = mptsas_shutdown,
#ifdef CONFIG_PM
.suspend = mptscsih_suspend,
.resume = mptscsih_resume,
#endif
};
static int __init
mptsas_init(void)
{
int error;
show_mptmod_ver(my_NAME, my_VERSION);
mptsas_transport_template =
sas_attach_transport(&mptsas_transport_functions);
if (!mptsas_transport_template)
return -ENODEV;
mptsasDoneCtx = mpt_register(mptscsih_io_done, MPTSAS_DRIVER,
"mptscsih_io_done");
mptsasTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSAS_DRIVER,
"mptscsih_taskmgmt_complete");
mptsasInternalCtx =
mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER,
"mptscsih_scandv_complete");
mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER,
"mptsas_mgmt_done");
mptsasDeviceResetCtx =
mpt_register(mptsas_taskmgmt_complete, MPTSAS_DRIVER,
"mptsas_taskmgmt_complete");
mpt_event_register(mptsasDoneCtx, mptsas_event_process);
mpt_reset_register(mptsasDoneCtx, mptsas_ioc_reset);
error = pci_register_driver(&mptsas_driver);
if (error)
sas_release_transport(mptsas_transport_template);
return error;
}
static void __exit
mptsas_exit(void)
{
pci_unregister_driver(&mptsas_driver);
sas_release_transport(mptsas_transport_template);
mpt_reset_deregister(mptsasDoneCtx);
mpt_event_deregister(mptsasDoneCtx);
mpt_deregister(mptsasMgmtCtx);
mpt_deregister(mptsasInternalCtx);
mpt_deregister(mptsasTaskCtx);
mpt_deregister(mptsasDoneCtx);
mpt_deregister(mptsasDeviceResetCtx);
}
module_init(mptsas_init);
module_exit(mptsas_exit);
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/slab.h`, `linux/init.h`, `linux/errno.h`, `linux/jiffies.h`, `linux/workqueue.h`, `linux/delay.h`.
- Detected declarations: `struct rep_manu_request`, `struct rep_manu_reply`, `enum device_state`, `function mptsas_print_phy_data`, `function mptsas_print_phy_pg0`, `function mptsas_print_phy_pg1`, `function mptsas_print_device_pg0`, `function mptsas_print_expander_pg1`, `function mptsas_fw_event_off`, `function mptsas_fw_event_on`.
- Atlas domain: Driver Families / drivers/message.
- Implementation status: pattern 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.