drivers/scsi/aic94xx/aic94xx_tmf.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aic94xx/aic94xx_tmf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aic94xx/aic94xx_tmf.c- Extension
.c- Size
- 19282 bytes
- Lines
- 687
- 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
linux/spinlock.hlinux/gfp.haic94xx.haic94xx_sas.haic94xx_hwi.h
Detected Declarations
struct tasklet_completion_statusstruct tc_resp_sb_structenum clear_nexus_phasefunction Copyrightfunction asd_clear_nexus_tasklet_completefunction asd_clear_nexus_timedoutfunction asd_clear_nexus_hafunction asd_clear_nexus_portfunction asd_clear_nexus_I_Tfunction asd_I_T_nexus_resetfunction asd_clear_nexus_I_T_Lfunction asd_clear_nexus_tagfunction asd_clear_nexus_indexfunction asd_tmf_timedoutfunction asd_get_tmf_resp_taskletfunction asd_tmf_tasklet_completefunction asd_clear_nexusfunction SAS_TASK_STATE_ABORTEDfunction asd_initiate_ssp_tmffunction asd_abort_task_setfunction asd_clear_task_setfunction asd_lu_resetfunction asd_query_task
Annotated Snippet
struct tasklet_completion_status {
int dl_opcode;
int tmf_state;
u8 tag_valid:1;
__be16 tag;
};
#define DECLARE_TCS(tcs) \
struct tasklet_completion_status tcs = { \
.dl_opcode = 0, \
.tmf_state = 0, \
.tag_valid = 0, \
.tag = 0, \
}
static void asd_clear_nexus_tasklet_complete(struct asd_ascb *ascb,
struct done_list_struct *dl)
{
struct tasklet_completion_status *tcs = ascb->uldd_task;
ASD_DPRINTK("%s: here\n", __func__);
if (!timer_delete(&ascb->timer)) {
ASD_DPRINTK("%s: couldn't delete timer\n", __func__);
return;
}
ASD_DPRINTK("%s: opcode: 0x%x\n", __func__, dl->opcode);
tcs->dl_opcode = dl->opcode;
complete(ascb->completion);
asd_ascb_free(ascb);
}
static void asd_clear_nexus_timedout(struct timer_list *t)
{
struct asd_ascb *ascb = timer_container_of(ascb, t, timer);
struct tasklet_completion_status *tcs = ascb->uldd_task;
ASD_DPRINTK("%s: here\n", __func__);
tcs->dl_opcode = TMF_RESP_FUNC_FAILED;
complete(ascb->completion);
}
#define CLEAR_NEXUS_PRE \
struct asd_ascb *ascb; \
struct scb *scb; \
int res; \
DECLARE_COMPLETION_ONSTACK(completion); \
DECLARE_TCS(tcs); \
\
ASD_DPRINTK("%s: PRE\n", __func__); \
res = 1; \
ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); \
if (!ascb) \
return -ENOMEM; \
\
ascb->completion = &completion; \
ascb->uldd_task = &tcs; \
scb = ascb->scb; \
scb->header.opcode = CLEAR_NEXUS
#define CLEAR_NEXUS_POST \
ASD_DPRINTK("%s: POST\n", __func__); \
res = asd_enqueue_internal(ascb, asd_clear_nexus_tasklet_complete, \
asd_clear_nexus_timedout); \
if (res) \
goto out_err; \
ASD_DPRINTK("%s: clear nexus posted, waiting...\n", __func__); \
wait_for_completion(&completion); \
res = tcs.dl_opcode; \
if (res == TC_NO_ERROR) \
res = TMF_RESP_FUNC_COMPLETE; \
return res; \
out_err: \
asd_ascb_free(ascb); \
return res
int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha)
{
struct asd_ha_struct *asd_ha = sas_ha->lldd_ha;
CLEAR_NEXUS_PRE;
scb->clear_nexus.nexus = NEXUS_ADAPTER;
CLEAR_NEXUS_POST;
}
int asd_clear_nexus_port(struct asd_sas_port *port)
{
struct asd_ha_struct *asd_ha = port->ha->lldd_ha;
CLEAR_NEXUS_PRE;
scb->clear_nexus.nexus = NEXUS_PORT;
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/gfp.h`, `aic94xx.h`, `aic94xx_sas.h`, `aic94xx_hwi.h`.
- Detected declarations: `struct tasklet_completion_status`, `struct tc_resp_sb_struct`, `enum clear_nexus_phase`, `function Copyright`, `function asd_clear_nexus_tasklet_complete`, `function asd_clear_nexus_timedout`, `function asd_clear_nexus_ha`, `function asd_clear_nexus_port`, `function asd_clear_nexus_I_T`, `function asd_I_T_nexus_reset`.
- 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.