drivers/scsi/elx/libefc/efc_device.c
Source file repositories/reference/linux-study-clean/drivers/scsi/elx/libefc/efc_device.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/elx/libefc/efc_device.c- Extension
.c- Size
- 41036 bytes
- Lines
- 1603
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
efc.hefc_device.hefc_fabric.h
Detected Declarations
function Copyrightfunction __efc_d_commonfunction __efc_d_wait_del_nodefunction __efc_d_wait_del_ini_tgtfunction __efc_d_initiate_shutdownfunction __efc_d_wait_loopfunction efc_send_ls_acc_after_attachfunction efc_process_prli_payloadfunction __efc_d_wait_plogi_acc_cmplfunction __efc_d_wait_logo_rspfunction efc_node_init_devicefunction efc_d_check_plogi_topologyfunction __efc_d_initfunction __efc_d_wait_plogi_rspfunction __efc_d_wait_plogi_rsp_recvd_prlifunction __efc_d_wait_domain_attachfunction __efc_d_wait_topology_notifyfunction __efc_d_wait_node_attachfunction __efc_d_wait_attach_evt_shutdownfunction __efc_d_port_logged_infunction __efc_d_wait_logo_acc_cmplfunction __efc_d_device_readyfunction __efc_d_device_gonefunction __efc_d_wait_adisc_rsp
Annotated Snippet
if (node->init && !node->targ) {
efc_log_info(node->efc,
"[%s] delete (initiator) WWPN %s WWNN %s\n",
node->display_name,
node->wwpn, node->wwnn);
efc_node_transition(node,
__efc_d_wait_del_node,
NULL);
if (node->nport->enable_tgt)
rc = efc->tt.scsi_del_node(efc, node,
EFC_SCSI_INITIATOR_DELETED);
if (rc == EFC_SCSI_CALL_COMPLETE || rc < 0)
efc_node_post_event(node,
EFC_EVT_NODE_DEL_INI_COMPLETE, NULL);
} else if (node->targ && !node->init) {
efc_log_info(node->efc,
"[%s] delete (target) WWPN %s WWNN %s\n",
node->display_name,
node->wwpn, node->wwnn);
efc_node_transition(node,
__efc_d_wait_del_node,
NULL);
if (node->nport->enable_ini)
rc = efc->tt.scsi_del_node(efc, node,
EFC_SCSI_TARGET_DELETED);
if (rc == EFC_SCSI_CALL_COMPLETE)
efc_node_post_event(node,
EFC_EVT_NODE_DEL_TGT_COMPLETE, NULL);
} else if (node->init && node->targ) {
efc_log_info(node->efc,
"[%s] delete (I+T) WWPN %s WWNN %s\n",
node->display_name, node->wwpn, node->wwnn);
efc_node_transition(node, __efc_d_wait_del_ini_tgt,
NULL);
if (node->nport->enable_tgt)
rc = efc->tt.scsi_del_node(efc, node,
EFC_SCSI_INITIATOR_DELETED);
if (rc == EFC_SCSI_CALL_COMPLETE)
efc_node_post_event(node,
EFC_EVT_NODE_DEL_INI_COMPLETE, NULL);
/* assume no wait needed */
rc = EFC_SCSI_CALL_COMPLETE;
if (node->nport->enable_ini)
rc = efc->tt.scsi_del_node(efc, node,
EFC_SCSI_TARGET_DELETED);
if (rc == EFC_SCSI_CALL_COMPLETE)
efc_node_post_event(node,
EFC_EVT_NODE_DEL_TGT_COMPLETE, NULL);
}
/* we've initiated the upcalls as needed, now kick off the node
* detach to precipitate the aborting of outstanding exchanges
* associated with said node
*
* Beware: if we've made upcall(s), we've already transitioned
* to a new state by the time we execute this.
* consider doing this before the upcalls?
*/
if (node->attached) {
/* issue hw node free; don't care if succeeds right
* away or sometime later, will check node->attached
* later in shutdown process
*/
rc = efc_cmd_node_detach(efc, &node->rnode);
if (rc < 0)
node_printf(node,
"Failed freeing HW node, rc=%d\n",
rc);
}
/* if neither initiator nor target, proceed to cleanup */
if (!node->init && !node->targ) {
/*
* node has either been detached or is in
* the process of being detached,
* call common node's initiate cleanup function
*/
efc_node_initiate_cleanup(node);
}
break;
}
case EFC_EVT_ALL_CHILD_NODES_FREE:
/* Ignore, this can happen if an ELS is
* aborted while in a delay/retry state
Annotation
- Immediate include surface: `efc.h`, `efc_device.h`, `efc_fabric.h`.
- Detected declarations: `function Copyright`, `function __efc_d_common`, `function __efc_d_wait_del_node`, `function __efc_d_wait_del_ini_tgt`, `function __efc_d_initiate_shutdown`, `function __efc_d_wait_loop`, `function efc_send_ls_acc_after_attach`, `function efc_process_prli_payload`, `function __efc_d_wait_plogi_acc_cmpl`, `function __efc_d_wait_logo_rsp`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
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.