drivers/scsi/qla4xxx/ql4_os.c
Source file repositories/reference/linux-study-clean/drivers/scsi/qla4xxx/ql4_os.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qla4xxx/ql4_os.c- Extension
.c- Size
- 290271 bytes
- Lines
- 9959
- Domain
- Driver Families
- Bucket
- drivers/scsi
- 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/moduleparam.hlinux/slab.hlinux/blkdev.hlinux/iscsi_boot_sysfs.hlinux/inet.hscsi/scsi_tcq.hscsi/scsicam.hql4_def.hql4_version.hql4_glbl.hql4_dbg.hql4_inline.hql4_83xx.h
Detected Declarations
function qla4xxx_isp_check_regfunction qla4xxx_send_pingfunction qla4_attr_is_visiblefunction qla4xxx_create_chap_listfunction qla4xxx_get_chap_by_indexfunction cpu_to_le16function qla4xxx_find_free_chap_indexfunction qla4xxx_get_chap_listfunction __qla4xxx_is_chap_activefunction qla4xxx_is_chap_activefunction qla4xxx_delete_chapfunction qla4xxx_set_chap_entryfunction nla_for_each_attrfunction qla4xxx_get_host_statsfunction qla4xxx_get_iface_paramfunction qla4xxx_ep_connectfunction qla4xxx_ep_pollfunction qla4xxx_ep_disconnectfunction qla4xxx_get_ep_paramfunction qla4xxx_conn_get_statsfunction qla4xxx_eh_cmd_timed_outfunction qla4xxx_set_port_speedfunction qla4xxx_set_port_statefunction qla4xxx_host_get_paramfunction qla4xxx_create_ipv4_ifacefunction qla4xxx_create_ipv6_ifacefunction qla4xxx_create_ifacesfunction qla4xxx_destroy_ipv4_ifacefunction qla4xxx_destroy_ipv6_ifacefunction qla4xxx_destroy_ifacesfunction qla4xxx_set_ipv6function qla4xxx_set_ipv4function qla4xxx_set_iscsi_paramfunction qla4xxx_initcb_to_acbfunction qla4xxx_iface_set_paramfunction nla_for_each_attrfunction qla4xxx_session_get_paramfunction qla4xxx_conn_get_paramfunction qla4xxx_get_ddb_indexfunction qla4xxx_match_ipaddressfunction qla4xxx_match_fwdb_sessionfunction qla4xxx_session_createfunction qla4xxx_session_destroyfunction qla4xxx_conn_createfunction qla4xxx_conn_bindfunction qla4xxx_conn_startfunction qla4xxx_conn_destroyfunction qla4xxx_task_work
Annotated Snippet
static struct pci_driver qla4xxx_pci_driver = {
.name = DRIVER_NAME,
.id_table = qla4xxx_pci_tbl,
.probe = qla4xxx_probe_adapter,
.remove = qla4xxx_remove_adapter,
.err_handler = &qla4xxx_err_handler,
};
static int __init qla4xxx_module_init(void)
{
int ret;
if (ql4xqfulltracking)
qla4xxx_driver_template.track_queue_depth = 1;
/* Allocate cache for SRBs. */
srb_cachep = kmem_cache_create("qla4xxx_srbs", sizeof(struct srb), 0,
SLAB_HWCACHE_ALIGN, NULL);
if (srb_cachep == NULL) {
printk(KERN_ERR
"%s: Unable to allocate SRB cache..."
"Failing load!\n", DRIVER_NAME);
ret = -ENOMEM;
goto no_srp_cache;
}
/* Derive version string. */
strcpy(qla4xxx_version_str, QLA4XXX_DRIVER_VERSION);
if (ql4xextended_error_logging)
strcat(qla4xxx_version_str, "-debug");
qla4xxx_scsi_transport =
iscsi_register_transport(&qla4xxx_iscsi_transport);
if (!qla4xxx_scsi_transport){
ret = -ENODEV;
goto release_srb_cache;
}
ret = pci_register_driver(&qla4xxx_pci_driver);
if (ret)
goto unregister_transport;
printk(KERN_INFO "QLogic iSCSI HBA Driver\n");
return 0;
unregister_transport:
iscsi_unregister_transport(&qla4xxx_iscsi_transport);
release_srb_cache:
kmem_cache_destroy(srb_cachep);
no_srp_cache:
return ret;
}
static void __exit qla4xxx_module_exit(void)
{
pci_unregister_driver(&qla4xxx_pci_driver);
iscsi_unregister_transport(&qla4xxx_iscsi_transport);
kmem_cache_destroy(srb_cachep);
}
module_init(qla4xxx_module_init);
module_exit(qla4xxx_module_exit);
MODULE_AUTHOR("QLogic Corporation");
MODULE_DESCRIPTION("QLogic iSCSI HBA Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(QLA4XXX_DRIVER_VERSION);
Annotation
- Immediate include surface: `linux/moduleparam.h`, `linux/slab.h`, `linux/blkdev.h`, `linux/iscsi_boot_sysfs.h`, `linux/inet.h`, `scsi/scsi_tcq.h`, `scsi/scsicam.h`, `ql4_def.h`.
- Detected declarations: `function qla4xxx_isp_check_reg`, `function qla4xxx_send_ping`, `function qla4_attr_is_visible`, `function qla4xxx_create_chap_list`, `function qla4xxx_get_chap_by_index`, `function cpu_to_le16`, `function qla4xxx_find_free_chap_index`, `function qla4xxx_get_chap_list`, `function __qla4xxx_is_chap_active`, `function qla4xxx_is_chap_active`.
- Atlas domain: Driver Families / drivers/scsi.
- 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.