drivers/scsi/elx/efct/efct_xport.c
Source file repositories/reference/linux-study-clean/drivers/scsi/elx/efct/efct_xport.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/elx/efct/efct_xport.c- Extension
.c- Size
- 28815 bytes
- Lines
- 1112
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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
efct_driver.hefct_unsol.h
Detected Declarations
function efct_xport_allocfunction efct_xport_init_debugfsfunction efct_xport_delete_debugfsfunction efct_xport_attachfunction efct_xport_link_stats_cbfunction efct_xport_host_stats_cbfunction efct_xport_async_link_stats_cbfunction efct_xport_async_host_stats_cbfunction efct_xport_stats_timer_cbfunction efct_xport_config_stats_timerfunction efct_xport_initializefunction efct_xport_statusfunction efct_get_link_supported_speedsfunction efct_scsi_new_devicefunction efct_attach_fc_transportfunction efct_attach_vport_fc_transportfunction efct_scsi_reg_fc_transportfunction efct_scsi_release_fc_transportfunction efct_xport_detachfunction efct_xport_domain_free_cbfunction efct_xport_controlfunction efct_xport_freefunction efct_release_fc_transportfunction efct_xport_remove_hostfunction efct_scsi_del_devicefunction efct_get_host_port_idfunction efct_get_host_port_typefunction efct_get_host_vport_typefunction efct_get_host_port_statefunction efct_get_host_speedfunction efct_get_host_fabric_namefunction efct_get_statsfunction efct_reset_statsfunction efct_issue_lipfunction efct_scsi_new_vportfunction efct_scsi_del_vportfunction efct_vport_createfunction efct_vport_deletefunction efct_vport_disable
Annotated Snippet
if (IS_ERR(efct->sess_debugfs_dir)) {
efc_log_err(efct,
"failed to create debugfs entry for sessions\n");
goto debugfs_fail;
}
atomic_inc(&efct_debugfs_count);
}
return 0;
debugfs_fail:
return -EIO;
}
static void efct_xport_delete_debugfs(struct efct *efct)
{
/* Remove session debugfs directory */
debugfs_remove(efct->sess_debugfs_dir);
efct->sess_debugfs_dir = NULL;
atomic_dec(&efct_debugfs_count);
if (atomic_read(&efct_debugfs_count) == 0) {
/* remove root debugfs directory */
debugfs_remove(efct_debugfs_root);
efct_debugfs_root = NULL;
}
}
int
efct_xport_attach(struct efct_xport *xport)
{
struct efct *efct = xport->efct;
int rc;
rc = efct_hw_setup(&efct->hw, efct, efct->pci);
if (rc) {
efc_log_err(efct, "%s: Can't setup hardware\n", efct->desc);
return rc;
}
efct_hw_parse_filter(&efct->hw, (void *)efct->filter_def);
xport->io_pool = efct_io_pool_create(efct, efct->hw.config.n_sgl);
if (!xport->io_pool) {
efc_log_err(efct, "Can't allocate IO pool\n");
return -ENOMEM;
}
return 0;
}
static void
efct_xport_link_stats_cb(int status, u32 num_counters,
struct efct_hw_link_stat_counts *counters, void *arg)
{
union efct_xport_stats_u *result = arg;
result->stats.link_stats.link_failure_error_count =
counters[EFCT_HW_LINK_STAT_LINK_FAILURE_COUNT].counter;
result->stats.link_stats.loss_of_sync_error_count =
counters[EFCT_HW_LINK_STAT_LOSS_OF_SYNC_COUNT].counter;
result->stats.link_stats.primitive_sequence_error_count =
counters[EFCT_HW_LINK_STAT_PRIMITIVE_SEQ_COUNT].counter;
result->stats.link_stats.invalid_transmission_word_error_count =
counters[EFCT_HW_LINK_STAT_INVALID_XMIT_WORD_COUNT].counter;
result->stats.link_stats.crc_error_count =
counters[EFCT_HW_LINK_STAT_CRC_COUNT].counter;
complete(&result->stats.done);
}
static void
efct_xport_host_stats_cb(int status, u32 num_counters,
struct efct_hw_host_stat_counts *counters, void *arg)
{
union efct_xport_stats_u *result = arg;
result->stats.host_stats.transmit_kbyte_count =
counters[EFCT_HW_HOST_STAT_TX_KBYTE_COUNT].counter;
result->stats.host_stats.receive_kbyte_count =
counters[EFCT_HW_HOST_STAT_RX_KBYTE_COUNT].counter;
result->stats.host_stats.transmit_frame_count =
counters[EFCT_HW_HOST_STAT_TX_FRAME_COUNT].counter;
result->stats.host_stats.receive_frame_count =
counters[EFCT_HW_HOST_STAT_RX_FRAME_COUNT].counter;
complete(&result->stats.done);
}
static void
Annotation
- Immediate include surface: `efct_driver.h`, `efct_unsol.h`.
- Detected declarations: `function efct_xport_alloc`, `function efct_xport_init_debugfs`, `function efct_xport_delete_debugfs`, `function efct_xport_attach`, `function efct_xport_link_stats_cb`, `function efct_xport_host_stats_cb`, `function efct_xport_async_link_stats_cb`, `function efct_xport_async_host_stats_cb`, `function efct_xport_stats_timer_cb`, `function efct_xport_config_stats_timer`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source 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.