drivers/scsi/be2iscsi/be_main.c
Source file repositories/reference/linux-study-clean/drivers/scsi/be2iscsi/be_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/be2iscsi/be_main.c- Extension
.c- Size
- 167508 bytes
- Lines
- 5848
- 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/reboot.hlinux/delay.hlinux/slab.hlinux/interrupt.hlinux/blkdev.hlinux/pci.hlinux/string.hlinux/kernel.hlinux/semaphore.hlinux/iscsi_boot_sysfs.hlinux/module.hlinux/bsg-lib.hlinux/irq_poll.hscsi/libiscsi.hscsi/scsi_bsg_iscsi.hscsi/scsi_netlink.hscsi/scsi_transport_iscsi.hscsi/scsi_transport.hscsi/scsi_cmnd.hscsi/scsi_device.hscsi/scsi_host.hscsi/scsi.hbe_main.hbe_iscsi.hbe_mgmt.hbe_cmds.h
Detected Declarations
struct beiscsi_invldt_cmd_tblfunction beiscsi_eh_abortfunction beiscsi_eh_device_resetfunction beiscsi_unmap_pci_functionfunction beiscsi_map_pci_barsfunction beiscsi_enable_pcifunction be_ctrl_initfunction beiscsi_get_paramsfunction hwi_ring_eq_dbfunction be_isr_mccfunction be_isr_msixfunction be_isrfunction beiscsi_free_irqsfunction beiscsi_init_irqsfunction hwi_ring_cq_dbfunction free_io_sgl_handlefunction beiscsi_get_wrb_handlefunction beiscsi_put_wrb_handlefunction free_wrb_handlefunction free_mgmt_sgl_handlefunction be_complete_iofunction be_complete_logoutfunction be_complete_tmffunction hwi_complete_drvr_msgsfunction be_complete_nopin_respfunction adapter_get_sol_cqefunction hwi_complete_cmdfunction beiscsi_complete_pdufunction beiscsi_hdl_put_handlefunction beiscsi_hdl_purge_handlesfunction beiscsi_hdl_get_handlefunction beiscsi_hdl_fwd_pdufunction beiscsi_hdl_gather_pdufunction beiscsi_hdq_post_handlesfunction beiscsi_hdq_process_complfunction beiscsi_process_mcc_cqfunction beiscsi_mcc_workfunction beiscsi_process_cqfunction be_iopollfunction hwi_write_sgl_v2function hwi_write_sglfunction hwi_write_bufferfunction beiscsi_find_mem_reqfunction beiscsi_alloc_memfunction beiscsi_get_memoryfunction iscsi_init_global_templatesfunction beiscsi_init_wrb_handlefunction hwi_init_async_pdu_ctx
Annotated Snippet
static struct pci_driver beiscsi_pci_driver = {
.name = DRV_NAME,
.probe = beiscsi_dev_probe,
.remove = beiscsi_remove,
.id_table = beiscsi_pci_id_table,
.err_handler = &beiscsi_eeh_handlers
};
static int __init beiscsi_module_init(void)
{
int ret;
beiscsi_scsi_transport =
iscsi_register_transport(&beiscsi_iscsi_transport);
if (!beiscsi_scsi_transport) {
printk(KERN_ERR
"beiscsi_module_init - Unable to register beiscsi transport.\n");
return -ENOMEM;
}
printk(KERN_INFO "In beiscsi_module_init, tt=%p\n",
&beiscsi_iscsi_transport);
ret = pci_register_driver(&beiscsi_pci_driver);
if (ret) {
printk(KERN_ERR
"beiscsi_module_init - Unable to register beiscsi pci driver.\n");
goto unregister_iscsi_transport;
}
return 0;
unregister_iscsi_transport:
iscsi_unregister_transport(&beiscsi_iscsi_transport);
return ret;
}
static void __exit beiscsi_module_exit(void)
{
pci_unregister_driver(&beiscsi_pci_driver);
iscsi_unregister_transport(&beiscsi_iscsi_transport);
}
module_init(beiscsi_module_init);
module_exit(beiscsi_module_exit);
Annotation
- Immediate include surface: `linux/reboot.h`, `linux/delay.h`, `linux/slab.h`, `linux/interrupt.h`, `linux/blkdev.h`, `linux/pci.h`, `linux/string.h`, `linux/kernel.h`.
- Detected declarations: `struct beiscsi_invldt_cmd_tbl`, `function beiscsi_eh_abort`, `function beiscsi_eh_device_reset`, `function beiscsi_unmap_pci_function`, `function beiscsi_map_pci_bars`, `function beiscsi_enable_pci`, `function be_ctrl_init`, `function beiscsi_get_params`, `function hwi_ring_eq_db`, `function be_isr_mcc`.
- 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.