drivers/scsi/qla2xxx/qla_gs.c
Source file repositories/reference/linux-study-clean/drivers/scsi/qla2xxx/qla_gs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qla2xxx/qla_gs.c- Extension
.c- Size
- 109516 bytes
- Lines
- 3889
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
qla_def.hqla_target.hlinux/utsname.h
Detected Declarations
function qla2x00_prep_ms_iocbfunction qla24xx_prep_ms_iocbfunction qla2x00_prep_ct_reqfunction qla2x00_chk_ms_statusfunction qla2x00_ga_nxtfunction qla2x00_gid_pt_rsp_sizefunction qla2x00_gid_ptfunction qla2x00_gpn_idfunction qla2x00_gnn_idfunction qla2x00_async_sns_sp_donefunction qla2x00_rft_idfunction qla_async_rftidfunction qla2x00_rff_idfunction qla_async_rffidfunction qla2x00_rnn_idfunction qla_async_rnnidfunction qla2x00_get_sym_node_namefunction qla2x00_rsnn_nnfunction qla_async_rsnn_nnfunction qla2x00_prep_sns_cmdfunction qla2x00_sns_ga_nxtfunction qla2x00_sns_gid_ptfunction qla2x00_sns_gpn_idfunction qla2x00_sns_gnn_idfunction qla2x00_sns_rft_idfunction qla2x00_sns_rnn_idfunction qla2x00_mgmt_svr_loginfunction qla2x00_prep_ms_fdmi_iocbfunction qla24xx_prep_ms_fdmi_iocbfunction qla2x00_update_ms_fdmi_iocbfunction qla2x00_prep_ct_fdmi_reqfunction qla25xx_fdmi_port_speed_capabilityfunction qla25xx_fdmi_port_speed_currentlyfunction qla2x00_hba_attributesfunction qla2x00_port_attributesfunction qla2x00_fdmi_rhbafunction qla2x00_fdmi_dhbafunction qla2x00_fdmi_rprtfunction qla2x00_fdmi_rpafunction qla2x00_fdmi_registerfunction qla2x00_gfpn_idfunction qla24xx_prep_ct_fm_reqfunction qla2x00_port_speed_capabilityfunction qla2x00_gff_idfunction qla24xx_post_gpsc_workfunction qla24xx_handle_gpsc_eventfunction qla24xx_async_gpsc_sp_donefunction qla24xx_async_gpsc
Annotated Snippet
switch (comp_status) {
case CS_COMPLETE:
case CS_DATA_UNDERRUN:
case CS_DATA_OVERRUN: /* Overrun? */
if (ct_rsp->header.response !=
cpu_to_be16(CT_ACCEPT_RESPONSE)) {
ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x2077,
"%s failed rejected request on port_id: %02x%02x%02x Completion status 0x%x, response 0x%x\n",
routine, vha->d_id.b.domain,
vha->d_id.b.area, vha->d_id.b.al_pa,
comp_status, ct_rsp->header.response);
ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha,
0x2078, ct_rsp,
offsetof(typeof(*ct_rsp), rsp));
rval = QLA_INVALID_COMMAND;
} else
rval = QLA_SUCCESS;
break;
case CS_PORT_LOGGED_OUT:
if (IS_FWI2_CAPABLE(ha)) {
if (le16_to_cpu(ms_pkt->loop_id.extended) ==
NPH_SNS)
lid_is_sns = true;
} else {
if (le16_to_cpu(ms_pkt->loop_id.extended) ==
SIMPLE_NAME_SERVER)
lid_is_sns = true;
}
if (lid_is_sns) {
ql_dbg(ql_dbg_async, vha, 0x502b,
"%s failed, Name server has logged out",
routine);
rval = QLA_NOT_LOGGED_IN;
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
}
break;
case CS_TIMEOUT:
rval = QLA_FUNCTION_TIMEOUT;
fallthrough;
default:
ql_dbg(ql_dbg_disc, vha, 0x2033,
"%s failed, completion status (%x) on port_id: "
"%02x%02x%02x.\n", routine, comp_status,
vha->d_id.b.domain, vha->d_id.b.area,
vha->d_id.b.al_pa);
break;
}
}
return rval;
}
/**
* qla2x00_ga_nxt() - SNS scan for fabric devices via GA_NXT command.
* @vha: HA context
* @fcport: fcport entry to updated
*
* Returns 0 on success.
*/
int
qla2x00_ga_nxt(scsi_qla_host_t *vha, fc_port_t *fcport)
{
int rval;
ms_iocb_entry_t *ms_pkt;
struct ct_sns_req *ct_req;
struct ct_sns_rsp *ct_rsp;
struct qla_hw_data *ha = vha->hw;
struct ct_arg arg;
if (IS_QLA2100(ha) || IS_QLA2200(ha))
return qla2x00_sns_ga_nxt(vha, fcport);
arg.iocb = ha->ms_iocb;
arg.req_dma = ha->ct_sns_dma;
arg.rsp_dma = ha->ct_sns_dma;
arg.req_size = GA_NXT_REQ_SIZE;
arg.rsp_size = GA_NXT_RSP_SIZE;
arg.nport_handle = NPH_SNS;
/* Issue GA_NXT */
/* Prepare common MS IOCB */
ms_pkt = ha->isp_ops->prep_ms_iocb(vha, &arg);
/* Prepare CT request */
ct_req = qla2x00_prep_ct_req(ha->ct_sns, GA_NXT_CMD,
GA_NXT_RSP_SIZE);
ct_rsp = &ha->ct_sns->p.rsp;
/* Prepare CT arguments -- port_id */
Annotation
- Immediate include surface: `qla_def.h`, `qla_target.h`, `linux/utsname.h`.
- Detected declarations: `function qla2x00_prep_ms_iocb`, `function qla24xx_prep_ms_iocb`, `function qla2x00_prep_ct_req`, `function qla2x00_chk_ms_status`, `function qla2x00_ga_nxt`, `function qla2x00_gid_pt_rsp_size`, `function qla2x00_gid_pt`, `function qla2x00_gpn_id`, `function qla2x00_gnn_id`, `function qla2x00_async_sns_sp_done`.
- 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.