drivers/scsi/elx/efct/efct_lio.c
Source file repositories/reference/linux-study-clean/drivers/scsi/elx/efct/efct_lio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/elx/efct/efct_lio.c- Extension
.c- Size
- 45453 bytes
- Lines
- 1684
- 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.
- 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
target/target_core_base.htarget/target_core_fabric.hefct_driver.hefct_lio.h
Detected Declarations
function efct_format_wwnfunction efct_lio_parse_wwnfunction efct_lio_parse_npiv_wwnfunction efct_lio_tpg_enable_showfunction efct_lio_tpg_enable_storefunction efct_lio_npiv_tpg_enable_showfunction efct_lio_npiv_tpg_enable_storefunction efct_lio_get_tagfunction efct_lio_get_npiv_tagfunction efct_lio_check_demo_modefunction efct_lio_check_demo_mode_cachefunction efct_lio_check_demo_write_protectfunction efct_lio_npiv_check_demo_write_protectfunction efct_lio_check_prod_write_protectfunction efct_lio_npiv_check_prod_write_protectfunction efct_lio_check_stop_freefunction efct_lio_abort_tgt_cbfunction efct_lio_aborted_taskfunction efct_lio_release_cmdfunction efct_lio_close_sessionfunction efct_lio_get_cmd_statefunction efct_lio_sg_mapfunction efct_lio_sg_unmapfunction efct_lio_status_donefunction efct_lio_write_pendingfunction efct_lio_queue_data_infunction efct_lio_send_respfunction efct_lio_datamove_donefunction efct_lio_tmf_donefunction efct_lio_null_tmf_donefunction efct_lio_queue_statusfunction efct_lio_queue_tm_rspfunction efct_lio_make_nportfunction efct_lio_npiv_make_nportfunction efct_lio_drop_nportfunction efct_lio_npiv_drop_nportfunction list_for_each_entry_safefunction efct_lio_make_tpgfunction efct_lio_drop_tpgfunction efct_lio_npiv_make_tpgfunction efct_lio_npiv_drop_tpgfunction efct_lio_init_nodeaclfunction efct_lio_check_demo_mode_login_onlyfunction efct_lio_npiv_check_demo_mode_login_onlyfunction efct_get_vport_tpgfunction _efct_tgt_node_freefunction efct_session_cbfunction efct_scsi_tgt_new_device
Annotated Snippet
if (ret) {
efct->tgt_efct.lio_nport = NULL;
efc_log_debug(efct, "cannot bring port online\n");
return ret;
}
} else if (op == 0) {
efc_log_debug(efct, "disable portal group %d\n", tpg->tpgt);
if (efc->domain && efc->domain->nport)
efct_scsi_tgt_del_nport(efc, efc->domain->nport);
tpg->enabled = false;
} else {
return -EINVAL;
}
return count;
}
static ssize_t
efct_lio_npiv_tpg_enable_show(struct config_item *item, char *page)
{
struct se_portal_group *se_tpg = to_tpg(item);
struct efct_lio_tpg *tpg =
container_of(se_tpg, struct efct_lio_tpg, tpg);
return snprintf(page, PAGE_SIZE, "%d\n", tpg->enabled);
}
static ssize_t
efct_lio_npiv_tpg_enable_store(struct config_item *item, const char *page,
size_t count)
{
struct se_portal_group *se_tpg = to_tpg(item);
struct efct_lio_tpg *tpg =
container_of(se_tpg, struct efct_lio_tpg, tpg);
struct efct_lio_vport *lio_vport = tpg->vport;
struct efct *efct;
struct efc *efc;
unsigned long op;
if (kstrtoul(page, 0, &op) < 0)
return -EINVAL;
if (!lio_vport) {
pr_err("Unable to find vport\n");
return -EINVAL;
}
efct = lio_vport->efct;
efc = efct->efcport;
if (op == 1) {
tpg->enabled = true;
efc_log_debug(efct, "enable portal group %d\n", tpg->tpgt);
if (efc->domain) {
int ret;
ret = efc_nport_vport_new(efc->domain,
lio_vport->npiv_wwpn,
lio_vport->npiv_wwnn,
U32_MAX, false, true,
NULL, NULL);
if (ret != 0) {
efc_log_err(efct, "Failed to create Vport\n");
return ret;
}
return count;
}
if (!(efc_vport_create_spec(efc, lio_vport->npiv_wwnn,
lio_vport->npiv_wwpn, U32_MAX,
false, true, NULL, NULL)))
return -ENOMEM;
} else if (op == 0) {
efc_log_debug(efct, "disable portal group %d\n", tpg->tpgt);
tpg->enabled = false;
/* only physical nport should exist, free lio_nport
* allocated in efct_lio_make_nport
*/
if (efc->domain) {
efc_nport_vport_del(efct->efcport, efc->domain,
lio_vport->npiv_wwpn,
lio_vport->npiv_wwnn);
return count;
}
} else {
Annotation
- Immediate include surface: `target/target_core_base.h`, `target/target_core_fabric.h`, `efct_driver.h`, `efct_lio.h`.
- Detected declarations: `function efct_format_wwn`, `function efct_lio_parse_wwn`, `function efct_lio_parse_npiv_wwn`, `function efct_lio_tpg_enable_show`, `function efct_lio_tpg_enable_store`, `function efct_lio_npiv_tpg_enable_show`, `function efct_lio_npiv_tpg_enable_store`, `function efct_lio_get_tag`, `function efct_lio_get_npiv_tag`, `function efct_lio_check_demo_mode`.
- 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.
- 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.