drivers/scsi/elx/libefc/efc_node.c
Source file repositories/reference/linux-study-clean/drivers/scsi/elx/libefc/efc_node.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/elx/libefc/efc_node.c- Extension
.c- Size
- 26756 bytes
- Lines
- 1103
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
efc.h
Detected Declarations
function Copyrightfunction efc_node_findfunction _efc_node_freefunction efc_node_freefunction efc_dma_copy_infunction efc_node_attachfunction efc_node_fcid_displayfunction efc_node_update_display_namefunction efc_node_send_ls_io_cleanupfunction efc_node_handle_implicit_logofunction efc_node_handle_explicit_logofunction efc_node_purge_pendingfunction list_for_each_entry_safefunction __efc_node_shutdownfunction efc_node_check_els_quiescedfunction efc_node_initiate_cleanupfunction __efc_node_wait_els_shutdownfunction __efc_node_wait_node_freefunction __efc_node_wait_ios_shutdownfunction __efc_node_commonfunction efc_node_save_sparmsfunction efc_node_post_eventfunction efc_node_transitionfunction efc_node_build_eui_namefunction efc_node_get_wwpnfunction efc_node_get_wwnnfunction efc_node_check_els_reqfunction efc_node_check_ns_reqfunction efc_els_io_list_emptyfunction efc_node_pausefunction __efc_node_pausedfunction statefunction efc_node_recv_els_framefunction efc_node_recv_ct_framefunction efc_node_recv_fcp_cmdfunction efc_process_node_pendingfunction efc_scsi_sess_reg_completefunction efc_scsi_del_initiator_completefunction efc_scsi_del_target_completefunction efc_scsi_io_list_emptyfunction efc_node_post_els_respfunction efc_node_post_shutdown
Annotated Snippet
if (fc_id == FC_FID_DOM_MGR) {
snprintf(buffer, buffer_length, "dctl%02x",
(fc_id & 0x0000ff));
} else {
snprintf(buffer, buffer_length, "%06x", fc_id);
}
break;
}
}
void
efc_node_update_display_name(struct efc_node *node)
{
u32 port_id = node->rnode.fc_id;
struct efc_nport *nport = node->nport;
char portid_display[16];
efc_node_fcid_display(port_id, portid_display, sizeof(portid_display));
snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
nport->display_name, portid_display);
}
void
efc_node_send_ls_io_cleanup(struct efc_node *node)
{
if (node->send_ls_acc != EFC_NODE_SEND_LS_ACC_NONE) {
efc_log_debug(node->efc, "[%s] cleaning up LS_ACC oxid=0x%x\n",
node->display_name, node->ls_acc_oxid);
node->send_ls_acc = EFC_NODE_SEND_LS_ACC_NONE;
node->ls_acc_io = NULL;
}
}
static void efc_node_handle_implicit_logo(struct efc_node *node)
{
int rc;
/*
* currently, only case for implicit logo is PLOGI
* recvd. Thus, node's ELS IO pending list won't be
* empty (PLOGI will be on it)
*/
WARN_ON(node->send_ls_acc != EFC_NODE_SEND_LS_ACC_PLOGI);
node_printf(node, "Reason: implicit logout, re-authenticate\n");
/* Re-attach node with the same HW node resources */
node->req_free = false;
rc = efc_node_attach(node);
efc_node_transition(node, __efc_d_wait_node_attach, NULL);
node->els_io_enabled = true;
if (rc < 0)
efc_node_post_event(node, EFC_EVT_NODE_ATTACH_FAIL, NULL);
}
static void efc_node_handle_explicit_logo(struct efc_node *node)
{
s8 pend_frames_empty;
unsigned long flags = 0;
/* cleanup any pending LS_ACC ELSs */
efc_node_send_ls_io_cleanup(node);
spin_lock_irqsave(&node->pend_frames_lock, flags);
pend_frames_empty = list_empty(&node->pend_frames);
spin_unlock_irqrestore(&node->pend_frames_lock, flags);
/*
* there are two scenarios where we want to keep
* this node alive:
* 1. there are pending frames that need to be
* processed or
* 2. we're an initiator and the remote node is
* a target and we need to re-authenticate
*/
node_printf(node, "Shutdown: explicit logo pend=%d ", !pend_frames_empty);
node_printf(node, "nport.ini=%d node.tgt=%d\n",
node->nport->enable_ini, node->targ);
if (!pend_frames_empty || (node->nport->enable_ini && node->targ)) {
u8 send_plogi = false;
if (node->nport->enable_ini && node->targ) {
/*
* we're an initiator and
* node shutting down is a target;
* we'll need to re-authenticate in
* initial state
*/
Annotation
- Immediate include surface: `efc.h`.
- Detected declarations: `function Copyright`, `function efc_node_find`, `function _efc_node_free`, `function efc_node_free`, `function efc_dma_copy_in`, `function efc_node_attach`, `function efc_node_fcid_display`, `function efc_node_update_display_name`, `function efc_node_send_ls_io_cleanup`, `function efc_node_handle_implicit_logo`.
- 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.