drivers/scsi/qla2xxx/qla_edif.c
Source file repositories/reference/linux-study-clean/drivers/scsi/qla2xxx/qla_edif.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qla2xxx/qla_edif.c- Extension
.c- Size
- 105848 bytes
- Lines
- 3716
- 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
qla_def.hqla_edif.hlinux/kthread.hlinux/vmalloc.hlinux/delay.hscsi/scsi_tcq.h
Detected Declarations
struct edb_nodefunction qla_edb_node_freefunction list_for_each_entry_safefunction qla2x00_sa_replace_iocb_timeoutfunction qla_edif_list_add_sa_update_indexfunction qla_edif_list_delete_sa_indexfunction qla_post_sa_replace_workfunction qla_edif_sa_ctl_initfunction qla_bsg_checkfunction qla2x00_find_fcport_by_pidfunction qla_edif_app_checkfunction qla_edif_free_sa_ctlfunction qla_edif_add_sa_index_to_freepoolfunction __qla2x00_release_all_sadbfunction qla2x00_release_all_sadbfunction list_for_each_entry_safefunction list_for_each_entry_safefunction qla_delete_n2n_sess_and_waitfunction qla_edif_app_startfunction list_for_each_entry_safefunction qla_edif_app_stopfunction list_for_each_entry_safefunction qla_edif_app_chk_sa_updatefunction qla_edif_app_authokfunction qla_edif_app_authfailfunction actionfunction qla_edif_app_getfcinfofunction list_for_each_entry_safefunction qla_edif_app_getstatsfunction list_for_each_entry_safefunction qla_edif_ackfunction qla_edif_consume_dbellfunction __qla_edif_dbell_bsg_donefunction qla_edif_dbell_bsg_donefunction qla_edif_dbell_bsgfunction qla_edif_app_mgmtfunction qla_edif_add_sa_ctlfunction qla_edif_flush_sa_ctl_listsfunction list_for_each_entry_safefunction list_for_each_entry_safefunction qla_edif_find_sa_ctl_by_indexfunction list_for_each_entry_safefunction qla24xx_check_sadb_avail_slotfunction qla24xx_sadb_updatefunction qla_enode_freefunction qla_enode_initfunction qla_enode_stopfunction qla_enode_clear
Annotated Snippet
struct edb_node {
struct list_head list;
uint32_t ntype;
union {
port_id_t plogi_did;
uint32_t async;
port_id_t els_sid;
struct edif_sa_update_aen sa_aen;
} u;
};
static struct els_sub_cmd {
uint16_t cmd;
const char *str;
} sc_str[] = {
{SEND_ELS, "send ELS"},
{SEND_ELS_REPLY, "send ELS Reply"},
{PULL_ELS, "retrieve ELS"},
};
const char *sc_to_str(uint16_t cmd)
{
int i;
struct els_sub_cmd *e;
for (i = 0; i < ARRAY_SIZE(sc_str); i++) {
e = sc_str + i;
if (cmd == e->cmd)
return e->str;
}
return "unknown";
}
static struct edb_node *qla_edb_getnext(scsi_qla_host_t *vha)
{
unsigned long flags;
struct edb_node *edbnode = NULL;
spin_lock_irqsave(&vha->e_dbell.db_lock, flags);
/* db nodes are fifo - no qualifications done */
if (!list_empty(&vha->e_dbell.head)) {
edbnode = list_first_entry(&vha->e_dbell.head,
struct edb_node, list);
list_del_init(&edbnode->list);
}
spin_unlock_irqrestore(&vha->e_dbell.db_lock, flags);
return edbnode;
}
static void qla_edb_node_free(scsi_qla_host_t *vha, struct edb_node *node)
{
list_del_init(&node->list);
kfree(node);
}
static struct edif_list_entry *qla_edif_list_find_sa_index(fc_port_t *fcport,
uint16_t handle)
{
struct edif_list_entry *entry;
struct edif_list_entry *tentry;
struct list_head *indx_list = &fcport->edif.edif_indx_list;
list_for_each_entry_safe(entry, tentry, indx_list, next) {
if (entry->handle == handle)
return entry;
}
return NULL;
}
/* timeout called when no traffic and delayed rx sa_index delete */
static void qla2x00_sa_replace_iocb_timeout(struct timer_list *t)
{
struct edif_list_entry *edif_entry = timer_container_of(edif_entry, t,
timer);
fc_port_t *fcport = edif_entry->fcport;
struct scsi_qla_host *vha = fcport->vha;
struct edif_sa_ctl *sa_ctl;
uint16_t nport_handle;
unsigned long flags = 0;
ql_dbg(ql_dbg_edif, vha, 0x3069,
"%s: nport_handle 0x%x, SA REPL Delay Timeout, %8phC portid=%06x\n",
__func__, edif_entry->handle, fcport->port_name, fcport->d_id.b24);
/*
* if delete_sa_index is valid then no one has serviced this
* delayed delete
Annotation
- Immediate include surface: `qla_def.h`, `qla_edif.h`, `linux/kthread.h`, `linux/vmalloc.h`, `linux/delay.h`, `scsi/scsi_tcq.h`.
- Detected declarations: `struct edb_node`, `function qla_edb_node_free`, `function list_for_each_entry_safe`, `function qla2x00_sa_replace_iocb_timeout`, `function qla_edif_list_add_sa_update_index`, `function qla_edif_list_delete_sa_index`, `function qla_post_sa_replace_work`, `function qla_edif_sa_ctl_init`, `function qla_bsg_check`, `function qla2x00_find_fcport_by_pid`.
- 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.