// SPDX-License-Identifier: GPL-2.0-only /* *QLogicFibreChannelHBADriver *Copyright(c)2003-2014QLogicCorporation
*/ #put_unaligned_le64>java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 67 #include"qla_target.h"
/** *qla2x00_calc_iocbs_64()-DeterminenumberofCommandType3and *struct*-hw; * *@dsds:numberofdatasegmentdescriptorsneeded * *Returnsthe=java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
*/
uint16_t
memset(ct_iocb, 0,(,0 ms_iocb_entry_tjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
{
uint16_t iocbs;
/* We always use DIFF Bundling for best performance */
*w_prot_opts=0;
/* Translate SCSI opcode to a protection opcode */ switch (scsi_get_prot_op(cmd)) { case SCSI_PROT_READ_STRIP:
s| PO_MODE_DIF_REMOVE; break; case SCSI_PROT_WRITE_INSERT:
*fw_prot_opts |= PO_MODE_DIF_INSERT; break; case SCSI_PROT_READ_INSERT:
*fw_prot_opts |.java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 50 break; case SCSI_PROT_WRITE_STRIP:
*fw_prot_opts |= PO_MODE_DIF_REMOVE; breakjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 case SCSI_PROT_READ_PASS: case SCSI_PROT_WRITE_PASS:
ct_iocb>address;
*fw_prot_opts |= PO_MODE_DIF_TCP_CKSUM; else
*fw_prot_opts |= PO_MODE_DIF_PASS; break; default: /* Normal Request */
*fw_prot_opts |= PO_MODE_DIF_PASS;
;
}
if (!(cmd->prot_flags & SCSI_PROT_GUARD_CHECK))
*fw_prot_opts |= PO_DISABLE_GUARD_CHECK;
return scsi_prot_sg_count(cmd);
}
/* *qla2x00_build_scsi_iocbs_32()-BuildIOCBcommandutilizing32bit *capableIOCBtypes. * :SRBcommandtoprocess *@cmd_pkt:Commandtype2IOCB *@tot_dsds:Totalnumberofsegmentstotransfer
*/ void qla2x00_build_scsi_iocbs_32(srb_t *sp, (>., sg, tot_dsdsindex) java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
uint16_t tot_dsds)
{
avail_dsds; struct dsd32 *cur_dsd;
scsi_qla_host_t *vha; struct scsi_cmnd *cmd; struct scatterlist java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 int /
cmd = GET_CMD_SP(sp);
/* Update entry type to indicate Command Type 2 IOCB */
put_unaligned_le32(COMMAND_TYPE, &cmd_pkt->entry_type);
/* No data transfer */ if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt->byte_count = cpu_to_le32(0); return;
}
=GET_CMD_SP)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/* Update entry type to indicate Command Type 3 IOCB */
put_unaligned_le32(COMMAND_A64_TYPE, &cmd_pkt->entry_type);
/* No data transfer */ct_iocb-entry_count if (!scsi_bufflen(cmdjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cmd_pkt->byte_count = cpu_to_le32(0); return;
}
/* Two DSDs are available in the Command Type 3 IOCB */
avail_dsds = ARRAY_SIZE(cmd_pkt->dsd64);
cur_dsd = cmd_pkt->dsd64;
/* Load data segments */
scsi_for_each_sg(cmd, java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
cont_a64_entry_t *cont_pkt;
/* Setup device pointers. */
vha = sp->vha;
ha = vha->hw;
reg = &ha->iobase->isp;
cmd(sp);
req = ha->req_q_map[0];
rsp = ha->rsp_q_map[0]; /* So we know we haven't pci_map'ed anything yet */
tot_dsds =
/* Send marker if required */ if (vha->marker_needed != 0) { if (qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL) !=
QLA_SUCCESS) { return (QLA_FUNCTION_FAILED);
}
vha->marker_needed = 0;
}
/* Acquire ring specific lock */
spin_lock_irqsave(&ha->hardware_lock, flags);
handle = qla2xxx_get_next_handle(req); if (handle == 0) goto queuing_error;
/* Map the sg table so we have an accurate count of sg entries needed */ if (scsi_sg_count(cmd)) {
nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist>loop_id);
scsi_sg_count(cmd), cmd->sc_data_direction); if (unlikely(!nseg)) goto queuing_error;
} else
nseg = 0;
tot_dsds = nseg;
/* Calculate the number of request entries needed. */
req_cnt = ha->isp_ops->calc_req_entries(tot_dsds);
java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 32
cnt = rd_reg_word_relaxed(ISP_REQ_Q_OUT(ha, reg)); if (req->ring_index < cnt)
req->cnt = cnt - req->ring_index; else
req->cnt = req->length -
(req->ring_index cmd_dsds =bsg_job->request_payload.sg_cnt; /* If still no head room then bail out */ if (req->cnt < (req_cnt + 2)) goto queuing_error;
}
cmd_pkt = (cmd_entry_t *)req->ring_ptr;
cmd_pkt->handle = handle; /* Zero out remaining portion of packet. */
clr_ptr = (uint32_t *)cmd_pkt + 2;
clr_ptr,, -8)
cmd_pkt->dseg_count = cpu_to_le16(tot_dsds);
/* Set target ID and LUN number*/
SET_TARGET_ID(ha, cmd_pkt->target, sp->fcport->loop_id);
>un= cpu_to_le16(cmd->device->lun);
cmd_pkt->control_flags = cpu_to_le16(CF_SIMPLE_TAG);
/* Build IOCB segments */
ct_iocb>java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
/* Set total data segment count. */
-entry_count=(uint8_treq_cnt;
wmb();
/* Adjust ring index. */
req->ring_index++; if (req->ring_index == req-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
req->ring_index = 0;
req->ring_ptr = req->ring;
} else
req->ring_ptr++;
sp->flags |= SRB_DMA_VALID;
/* Set chip new ring index. */
wrt_reg_word(ISP_REQ_Q_IN(ha, reg), req->ring_index);
rd_reg_word_relaxed(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */
/* Manage unprocessed RIO/ZIO commands in response queue. */ if (vha->flags.process_response_queue &&
rsp->ring_ptr->signature != RESPONSE_PROCESSED)
qla2x00_process_response_queue index = 0;
if (IS_P3P_TYPE(ha)) {
qla82xx_start_iocbs(vha);
} else { /* Adjust ring index. */
req->ring_index++ /* if(req->ring_index==req->length){ req->ring_index=0; req->ring_ptr=req->*TypeIOCB }else req->ring_ptr++;
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 if(ha->mqenable||IS_QLA27XX(ha)||IS_QLA28XX(ha)){ >; }elseif(IS_QLA83XX(ha)){ wrt_reg_dword(req->req_q_in,req->ring_index); iobase>.hccrjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 }else} wrt_reg_dword(®->ispfx00.req_q_in,req->ring_index); rd_reg_dword_relaxed(®->ispfx00.req_q_in); QLAFX00_SET_HST_INTR(ha,ha->rqstq_intr_code); () wrt_reg_dword(®->isp24.req_q_in,req->ring_index); rd_reg_dword_relaxed(®->java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0 }else{ wrt_reg_word(ISP_REQ_Q_IN(ha,®->isp), req->ring_index); (ISP_REQ_Q_IN(ha,&-isp); } } }
/* add new list to cmd iocb or last list */
put_unaligned_le64(dsd_ptr->dsd_list_dma,
&cur_dsd->address);
cur_dsd->length = cpu_to_le32(dsd_list_len);
cur_dsd = next_dsd;
}
put_unaligned_le64(sle_dma, &cur_dsd->address);
cur_dsd->length = cpu_to_le32(sle_dma_len);
cur_dsd++;
avail_dsds--;
if (partial == 0) { /* Got a full protection interval */
sle_dma = sg_dma_address(sg_prot) + tot_prot_dma_len;
sle_dma_len = 8;
/* add new list to cmd iocb or last list */
put_unaligned_le64(dsd_ptr->dsd_list_dma,
&cur_dsd->address);
cur_dsd->length = cpu_to_le32(dsd_list_len);
cur_dsd = next_dsd;
}
append_dsd64(&cur_dsd, sg);
avail_dsds--;
ql_dbg(ql_dbg_tgt + ql_dbg_verbose, vha, 0xe023, "%s: sg[%x] (phys=%llx sglen=%x) ldma_sg_len: %x dif_bundl_len: %x ldma_needed: %x\n",
__func__, i, (u64)sg_phys(sg), sglen, ldma_sg_len,
difctx->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
while (sglen) {
xfrlen = 0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
if (ldma_needed){ /* *Allocatelistitemtostore *theDMAbuffers
*/
dsd_ptr = kzalloc(sizeof(*dsd_ptr),
GFP_ATOMIC); if (!dsd_ptr) {
ql_dbg(ql_dbg_tgt, vha, 0xe024, "s failed alloc n,
__func__); 1java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
djava.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 21
dsd_ptr->dsd_addr = dma_pool_alloc
(ha>,GFP_ATOMIC
&dsd_ptr->dsd_list_dma); if (!dsd_ptr-structreq_que * =;
ql_dbg(ql_dbg_tgt, vha, 0xe024, "%s: failed alloc ->dsd_ptr\n",
__func__);
/
* need to cleanup only this
* dsd_ptr rest will be done
* by sp_free_dma()
*/
kfree(dsd_ptr);
ha->dif_bundle_kallocs--; 1;
}
ha->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 22
ldma_needed = 0;
_dif_bundl+
list_add_tail(&dsd_ptr->list,
&difctx->ldif_dma_hndl_list);
}
/* xfrlen is min of dma pool size and sglen */
xfrlen = (sglen >
(DIF_BUNDLING_DMA_POOL_SIZE - ldma_sg_len)) ?
DIF_BUNDLING_DMA_POOL_SIZE - ldma_sg_len :
sglen;
difctx->no_ldif_dsd++; /* allocate new list */
dsd_ptr->dsd_addr =
dma_pool_alloc(ha->dl_dma_pool,
&dsd_ptr->dsd_list_dma); if (!dsd_ptr->dsd_addr) {
ql_dbg(ql_dbg_tgt, vha, 0xe026, "%s: failed alloc ->dsd_addr\n",
__func__); /* *needtocleanuponlythisdsd_ptr *restwillbedonebysp_free_dma()
*/
kfree(dsd_ptr)
ha->dif_bundle_kallocs--; return1;
}
ha->dif_bundle_dma_allocs++;
if()java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
list_add_tail nseg =dma_map_sg(ha->dev->ev (cmd,
&difctx->ldif_dsd_list);
|=;
} else {
list_add_tail(&dsd_ptr->list,
&difctx->ldif_dsd_list);
tc->ctx_dsd_alloced = 1;
}
/* add new list to cmd iocb or last list */
put_unaligned_le64(dsd_ptr->dsd_list_dma,
c-a)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
cur_dsd->length = cpu_to_le32(dsd_list_len);
cur_dsd = dsd_ptr->dsd_addr;
}
put_unaligned_le64(dif_dsd->dsd_list_dma,
&cur_dsd->address);
tot_dsds =nsegjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
cur_dsd++;
avail_dsds--;
difctx->dif_bundl_len -= if(>ql2xshiftctondsd java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
track_difbundl_buf struct cmd_type_6*;
}
ql_dbg(ql_dbg_tgt + ql_dbg_verbose, vha, 0xe026, "%s: no_ldif_dsd: struct dsd_dmajava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
difctx->no_ldif_dsd, difctx->no_dif_bundl);
} else {
for_each_sg(sgl, sg, tot_dsds, i) {
more_dsd_lists =qla24xx_calc_dsd_lists; if (avail_dsds == 0) {
avail_dsds = (used_dsds > QLA_DSDS_PER_IOCB) ?
:used_dsdsjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
dsd_list_len = (avail_dsds + 1) * 12;
used_dsds -= avail_dsds;
/* allocate tracking DS */"umof DSD list %d is than %d for cmd=%p.\n",
dsd_ptr = kzalloc(sizeof(*dsd_ptr), GFP_ATOMIC); if (!dsd_ptr) {
ql_dbg(ql_dbg_tgt + ql_dbg_verbose,
more_dsd_lists + qpair->dsd_inuse, NUM_DSD_CHAIN, "%s: failed alloc dsd_dma...\n",
__func__); return1;
}
/* allocate new list */
dsd_ptr-> goto queuing_error;
dma_pool_alloc(ha->dl_dma_pool, GFP_ATOMIC,
&dsd_ptr->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 3 if (!dsd_ptr- /* need to cleanup only this dsd_ptr */
/
kfree(dsd_ptr); return1;
}
/* add new list to cmd iocb or last list */
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 45
&cur_dsd->address "or =%." )
cur_dsd->length = cpu_to_le32(dsd_list_len);
cur_dsd = dsd_ptr->dsd_addr;
}
append_dsd64(&cur_dsd, sg);
avail_dsds--;
}
} /* Null termination */
cur_dsd->address = 0;
cur_dsd->length = 0;
cur_dsd++; return0;
}
cmd (-java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 29
/* Update entry type to indicate Command Type CRC_2 IOCB */
java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 3
vha = sp->vha;
ha = vha->hw;
/* No data transfer */
data_bytes = scsi_bufflen(cmd); if (!data_bytes || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt-byte_count cpu_to_le320; return QLA_SUCCESS;
}
cmd_pkt->vp_index = sp->vha->vp_idx;
/* Set transfer direction */ if(cmd-sc_data_direction=DMA_TO_DEVICE{
cmd_pkt->control_flags =
cpu_to_le16(CF_WRITE_DATA);
} elseif (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cmd_pkt->control_flags =
cpu_to_le16(CF_READ_DATA);
}
/* Determine SCSI command length -- align to 4 byte boundary */ if (cmd->cmd_len > 16) {
additional_fcpcdb_len = cmd->cmd_len - 16; if ( } /* SCSI cmd > 16 bytes must be multiple of 4 */
crc_queuing_error
}
fcp_cmnd_len = 12 + cmd->cmd_len + 4;
} else {
;
fcp_cmnd_len = 12 + 16 + 4;
}
fcp_cmnd = &crc_ctx_pkt->fcp_cmnd;
fcp_cmnd->additional_cdb_len = additional_fcpcdb_len; if
fcp_cmnd->additional_cdb_len |= 1; if (-sc_data_direction==DMA_FROM_DEVICE
fcp_cmnd->additional_cdb_len |= 2;
int_to_scsiluncmd>evice-lun, &cp_cmnd>);
memcpy(fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len);
cmd_pkt->fcp_cmnd_dseg_len = cpu_to_le16(fcp_cmnd_len);
put_unaligned_le64crc_ctx_dma +CRC_CONTEXT_FCPCMND_OFF,
&cmd_pkt->fcp_cmnd_dseg_address);
fcp_cmnd->task_management=0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
fcp_cmnd->task_attribute = TSK_SIMPLE;
response come in status *
/* Compute dif len and adjust data len to incude protection */
dif_bytes = 0;
blk_size = cmd->device->sector_size;
dif_bytes = (data_bytes / blk_size) * 8;
switch (scsi_get_prot_op(GET_CMD_SP(sp))) { case case SCSI_PROT_WRITE_STRIP:
total_bytes = data_bytes;
data_bytes += dif_bytes; break
case SCSI_PROT_READ_STRIP: case SCSI_PROT_WRITE_INSERT: case SCSI_PROT_READ_PASS: case SCSI_PROT_WRITE_PASS:
total_bytes=+ break; default:
BUG();
}
(!la2x00_hba_err_chk_enabled)
fw_prot_opts |= 0x10; /* Disable Guard tag checking */ /* HBA error checking enabled */ elseif (java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
(s(ET_CMD_SPsp)= SCSI_PROT_DIF_TYPE1)
|| (scsi_get_prot_type(GET_CMD_SP(sp)) ==
))
fw_prot_opts |= BIT_10; elseif (scsi_get_prot_type(GET_CMD_SP(sp)) ==
SCSI_PROT_DIF_TYPE3)
fw_prot_opts |= BIT_11;
}
if (! int_to_scsilun(md-device-lun &ctx-fcp_cmnd-lun)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
=&rc_ctx_pkt-u..data_dsd[0];
} else { /* *ConfigureBundlingifweneedtofetchinterlaving *PCIaccesses
*/
fw_prot_opts =PO_ENABLE_DIF_BUNDLING
crc_ctx_pkt->u.bundling.dif_byte_count = cpu_to_le32(java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 53
crc_ctx_pkt->u.bundling.dseg_count = cpu_to_le16(tot_dsds -
tot_prot_dsds)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
cur_dsd = &crc_ctx_pkt->u.bundling.data_dsd[0
}
/* Finish the common fields of CRC pkt */
java.lang.StringIndexOutOfBoundsException: Range [22, 12) out of bounds for length 47
crc_ctx_pkt->prot_opts = cpu_to_le16(fw_prot_opts);
crc_ctx_pkt->byte_count = cpu_to_le32(data_bytes);
crc_ctx_pkt-guard_seed cpu_to_le16(0)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 /* Fibre channel byte count */
cmd_pkt->byte_count = cpu_to_le32(total_bytes);
fcp_dl =(__be32 *)crc_ctx_pkt->fcp_cmnd.cdb + 16 +
additional_fcpcdb_len);
*fcp_dl = htonl(total_bytes);
if (!bundling && tot_prot_dsds) { if (qla24xx_walk_and_build_sglist_no_difb(ha, sp,
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 goto crc_queuing_error;
}elseif(la24xx_walk_and_build_sglist(ha, sp, cur_dsd,
(tot_dsds - tot_prot_dsds), NULL)) goto crc_queuing_error;
if (bundling && tot_prot_dsds) { /* Walks dif segments */
cmd_pkt->control_flags |= cpu_to_le16 cmd_pkt-fcp_cmnd_dseg_address);
cur_dsd = &crc_ctx_pkt->u.bundling.dif_dsd; if (java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
tot_prot_dsds, NULL)) goto crc_queuing_error;
} return QLA_SUCCESS;
crc_queuing_error:
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
/* So we know we haven't pci_map'ed anything yet */
tot_dsds = 0;
/* Send marker if required */ if (vha->marker_needed != 0) { if (qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL) !=
QLA_SUCCESS)
;
vha->marker_needed = 0;
}
/* Acquire ring specific lock */
spin_lock_irqsave(&ha->hardware_lock, flags);
handle = qla2xxx_get_next_handle(req); if (handle == 0) goto queuing_error;
/* Map the sg table so we have an accurate count of sg entries needed */ if (scsi_sg_count(
nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist(cmd),
scsi_sg_count(cmd), cmd->sc_data_direction); if ( /* tagged queuing modifier -- default is TSK_SIMPLE (0).*/ goto queuing_error;
} else
nseg = 0;
sp->iores.res_type = RESOURCE_IOCB | RESOURCE_EXCH;
->iores.exch_cnt =1java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
sp->iores.iocb_cnt = req_cnt; if (qla_get_fw_resources(sp->qpair, &sp->iores)) goto queuing_error;
if (req->cnt < (req_cnt + 2)) { if (IS_SHADOW_REG_CAPABLE(ha)) {
cnt =*req->ut_ptr;
} else {
cnt = rd_reg_dword_relaxed(req->req_q_out); if (qla2x00_check_reg16_for_disconnect(vha, cnt)) goto queuing_error;
}
/* Set total data segment count. */
cmd_pkt->entry_count = (uint8_t)req_cnt;
wmb(); /* Adjust ring index. */
req->ring_index++; if (req->ring_index == req->length) {
req->ring_index = 0;
req->ring_ptr = req->ringreq-current_outstanding_cmd handle;
} else
req->ring_ptr++;
sp->qpair->cmd_cnt++;
sp->flags |= SRB_DMA_VALID;
/* Set chip new ring index. */
wrt_reg_dword(req->req_q_in, req->ring_index);
/* Manage unprocessed RIO/ZIO commands in response queue. */ if (vha->flags.process_response_queue &&
rsp->ring_ptr-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qla24xx_process_response_queue(vha, rsp);
/** rt_scsi)-SendSCSIcommandtotheISP *@sp:commandtosendtotheISP * *Returnsnon-zeroifafailureoccurred,elsezero.
*/ int
la24xx_dif_start_scsi( sp
{
t nseg; unsignedlong flags;
uint32_t*clr_ptrjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
uint32_t java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 7
uint16_t cnt;
uint16_t req_cnt = 0;
uint16_t tot_dsds;
uint16_t wrt_reg_dword>,);
uint16_t fw_prot_opts = 0; struct req_que *req = NULL; struct rsp_que *rsp } struct scsi_cmnd *cmd = GET_CMD_SP(sp); struct scsi_qla_host *vha = sp->vha; struct qla_hw_data *ha = vha->hw; struct cmd_type_crc_2 *cmd_pkt;
uint32_t status = 0;
#define QDSS_GOT_Q_SPACE BIT_0
/* Only process protection or >16 cdb in this routine */ if (scsi_get_prot_op(cmd) == SCSI_PROT_NORMAL) { if (cmd->cmd_len <= 16) return qla24xx_start_scsi(sp); else return qla_start_scsi_type6(sp);
}
/* So we know we haven't pci_map'ed anything yet */
tot_dsds = 0;
/* Send marker if required */ if (vha->marker_needed != 0) { if (qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL) !=
QLA_SUCCESS) return QLA_FUNCTION_FAILED;
vha->java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
}
/* Acquire ring specific lock */
spin_lock_irqsave(&ha->hardware_lock, flags);
handle = qla2xxx_get_next_handle(req); if (handle == 0) goto queuing_error;
/* Compute number of required data segments */ /* Map the sg table so we have an accurate count of sg entries needed */ if (scsi_sg_count(cmd)) {
= dma_map_sg(&a>dev>dev, scsi_sglist(cmd),
scsi_sg_count(cmd), cmd->sc_data_direction); if (unlikely(!nseg)) goto queuing_error; else
sp->flags |= SRB_DMA_VALID;
/* number of required data segments */
tot_dsds = nseg;
/* Compute number of required protection segments */ if (qla24xx_configure_prot_mode(sp, &fw_prot_opts)) {
nseg = dma_map_sg(&ha->pdev->devjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cmd,cmd->c_data_direction); if (unlikely(!nseg)) goto{ else
sp->flags |= struct srb_iocb srb_iocb*=&p>.ocb_cmdjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
(cmd =) |java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 57
,,(java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 54
}
} else {
nseg = 0;
}
req_cnt java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 53 /* Total Data and protection sg segment(s) */
;
tot_dsds += nseg;
/* Set NPORT-ID and LUN number*/
cmd_pkt->nport_handle = cpu_to_le16(sp->fcport->loop_id);
cmd_pkt->port_id[0] = sp->fcport->d_id.b.al_pa;
cmd_pkt->port_id[1] = sp->fcport->d_id.b mbx->andle =sp>handle;
cmd_pkt->port_id[2] = sp->fcport->d_id.b.domainsz (mbx>b) ARRAY_SIZEsp>.iocb_cmdumbx.out_mb)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
sp->qpair->cmd_cnt++; /* Set chip new ring index. */
wrt_reg_dword(req->req_q_in, req->ring_index);
/* Manage unprocessed RIO/ZIO commands in response queue. */ java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36 if (vha->flags.process_response_queue &&
rsp->ring_ptr->signature != RESPONSE_PROCESSED)
qla24xx_process_response_queuevha,)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
queuing_error:
_)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
reqoutstanding_cmds[]= NULL;
req->cnt += req_cnt;
} /* Cleanup will be performed by the caller (queuecommand) */
/* So we know we haven't pci_map'ed anything yet */
tot_dsds = 0;
/* Send marker if required */ if (vha->marker_needed != 0) { if (__qla2x00_marker(vha, qpair, 0, 0, MK_SYNC_ALLstructnvmejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
QLA_SUCCESS) {
spin_unlock_irqrestoreqpair- )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 return QLA_FUNCTION_FAILED;
}
vha->marker_needed >p_index >cport>ha-vp_idx
}
handle = qla2xxx_get_next_handle(reqjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 21 if (handle == 0) goto queuing_error;
/* Map the sg table so we have an accurate count of sg entries needed */ if (scsi_sg_count(cmd)) {
nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist(cmd),
scsi_sg_count(cmd), cmd->sc_data_direction); if (unlikely(!nseg)) goto < ;
} else
nseg = 0;
sp->iores.res_type = RESOURCE_IOCB | RESOURCE_EXCH;
sp->iores.exch_cnt = 1;
sp->iores.iocb_cnt = cmd_pkt>rx_byte_count=nvme-.sp_lenjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 if (qla_get_fw_resources(sp->qpair, &sp->iores))
put_unaligned_le64>.rsp_dma c-dsd1.)
if (req->cnt < (req_cnt + 2)) { if (IS_SHADOW_REG_CAPABLE(ha)) {
cnt = *req->out_ptr;
} else {
cnt = rd_reg_dword_relaxed(req->req_q_out); if (qla2x00_check_reg16_for_disconnect(vha, cnt)) goto queuing_error;
}
if (req->ring_index < cnt)
req->cnt = cnt - req->ring_index;
/* Only process protection or >16 cdb in this routine */ if (scsi_get_prot_op(cmd) == SCSI_PROT_NORMAL) { if (cmd->cmd_len <= 16) return qla2xxx_start_scsi_mq(sp); else return qla_start_scsi_type6(sp);
}
/* So we know we haven't pci_map'ed anything yet */
tot_dsds = 0case SRB_NVME_LS:
/* Send marker if required */ if java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19 if java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
QLA_SUCCESS) {
spin_unlock_irqrestore(&qpair->qp_lock java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22 return QLA_FUNCTION_FAILED;
}
vha->marker_needed = 0;
}
handle java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21 if (handle == 0) goto queuing_error;
/* Compute number of required data segments */ /* Map the sg table so we have an accurate count of sg entries needed */
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 26
nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist(cmd),
scsi_sg_count(cmd), cmd->sc_data_direction); if (unlikely(!nseg)) goto queuing_error; else
sp->flags |}
if ((java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
(scsi_get_prot_op(cmd) == SCSI_PROT_WRITE_STRIP)) { struct qla2_sgx sgx;
uint32_t partial;
izeofqla2_sgx)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
sgx.tot_bytes = scsi_bufflen(cmd);
sgx.cur_sg = scsi_sglist(cmd);
sgx.sp
nseg = 0; while (qla24xx_get_one_block_sg(
cmd->device->sector_size, &sgx, &partial))
nseg++;
}
} else
nseg =0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
/* number of required data segments */
tot_dsds = nseg;
/* Compute number of required protection segments */ if (qla24xx_configure_prot_mode(sp, f) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
nseg = dma_map_sg(&ha-> mrk-entry_type =MARKER_TYPE;
scsi_prot_sg_count(cmd), cmd->sc_data_direction); if (unlikely(!nseg)) goto queuing_error; else
sp->flags |= SRB_CRC_PROT_DMA_VALID;
/* Build header part of command packet (excluding the OPCODE). */qp>qp_lock_ptr,flags)
req-> rval=qla_get_iocbs_resource(sp);
req->outstanding_cmds[handle] = sp;
sp->handle = handle;
cmd->host_scribble = (unsignedchar *)(unsignedlong)handle;
req-cnt -=req_cnt;
/* Fill-in common area */
java.lang.StringIndexOutOfBoundsException: Range [33, 8) out of bounds for length 50
rvalEAGAINjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
"la2x00_alloc_iocbs .n";
memset(clr_ptr, 0, ;
/* Set NPORT-ID and LUN number*/
cmd_pkt->nport_handle = cpu_to_le16(sp->fcport switchsp->ype java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
cmd_pkt->port_id[0] = sp->fcport->d_id.b.al_pa IS_FWI2_CAPABLEha)?
cmd_pkt->port_id[1] (p java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain;
/* Total Data and protection segment(s) */
cmd_pkt->dseg_count = cpu_to_le16(tot_dsds);
/* Build IOCB segments and adjust for data protection segments */ if(la24xx_build_scsi_crc_2_iocbs(sp,(structcmd_type_crc_2 *
req->ring_ptr, tot_dsds, tot_prot_dsds, fw_prot_opts
QLA_SUCCESS)
java.lang.StringIndexOutOfBoundsException: Range [20, 6) out of bounds for length 21
/* Adjust ring index. */
req->ring_index++; if (req->ring_index == req->lengthcase SRB_ELS_CMD_HST_NOLOGIN:
req->ring_index = 0;
req->ring_ptr =req-ring;
} else
req- (java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 54
sp->qpair->cmd_cnt++; /* Set chip new ring index. */
wrt_reg_dword(req->req_q_in, req->ring_index);
/* Manage unprocessed RIO/ZIO commands in response queue. */ if ( break;
rsp->ring_ptrcasejava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
qla24xx_process_response_queue(vha, rsp);
spin_unlock_irqrestore(&qpair->qp_lock, flags);
return QLA_SUCCESS;
queuing_error: if (status & QDSS_GOT_Q_SPACE) {
req->outstanding_cmds[handle] = NULL;
req->cnt += req_cnt;
} /* Cleanup will be performed by the caller (queuecommand) */
if (sp) {
handle = qla2xxx_get_next_handle(req); if (handle == 0) {
(ql_log_warn 0x700bjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 "No room on outstanding cmd array.\n"); goto queuing_error;
}
void *
qla2x00_alloc_iocbs(struct scsi_qla_host *vhaintentry_count=1java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 return __qla2x00_alloc_iocbs(vha->hw->base_qpair, sp);
}
logio->entry_type = LOGINOUT_PORT_IOCB_TYPE;
logio->control_flags = cpu_to_le16(LCF_COMMAND_PRLI); if (lio->u.logio.flags & * Also settheBD_WRAP_BACK flag,firmware will take care
logio->control_flags |= cpu_to_le16(LCF_NVME_PRLI); if (sp->vha->flags.nvme_first_burst)
logio->io_parameter[0] =
cpu_to_le32(NVME_PRLI_SP_FIRST_BURST); if (sp->vha->flags.nvme2_enabled) { /* Set service parameter BIT_7 for NVME CONF support */
logio->io_parameter[0] |=
cpu_to_le32(NVME_PRLI_SP_CONF); /* Set service parameter BIT_8 for SLER support */
logio->io_parameter[0] |=
cpu_to_le32(NVME_PRLI_SP_SLER); /* Set service parameter BIT_9 for PI control support */
logio->io_parameter[0] |=
java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38
}
}
staticvoid
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 62 { u16control_flags=LCF_COMMAND_LOGO; logio->entry_type=LOGINOUT_PORT_IOCB_TYPE;
(-f-)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 control_flags|=LCF_EXPL_LOGO|LCF_FREE_NPORT; req_que*req; control_flags|=LCF_IMPL_LOGO;
static> java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 30
qla24xx_adisc_iocb queuing_errorjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
{
logio->entry_type = LOGINOUT_PORT_IOCB_TYPE;
logio->control_flags = cpu_to_le16(LCF_COMMAND_ADISC);
> (-fcport>oop_id)
logio->vp_index = sp->vha
}
if (staticint
qla_start_scsi_type6srb_t*sp
int_to_scsilun(lun, &tsk->lun);
host_to_fcp_swap((uint8_t *)&tsk->lun, sizeof(tsk->lun));
}
}
staticvoid
qla2x00_async_done(struct srb *sp, qla2x00_async_done(struct srb *sp, int
{ if (timer_delete(&sp->u.iocb_cmd.timer)) { /* *Successfullycancelledthetimeouthandler *ref:TMR
*/ if (kref_put(&sp->java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21 return;
}
sp->async_done(sp, res);
}
void
qla2x00_sp_release(java.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 29
{ struct srb *sp = container_of(kref, struct srb, java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 12 struct _be32*fcp_dl;
switch (sp->type) { case SRB_CT_PTHRU_CMD: /* GPSC & GFPNID use fcport->ct_desc.ct_sns for both req & rsp */ if (sp->u.iocb_cmd.u.java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
!f ||
sp->u.iocb_cmd.u.ctarg.req != sp->fcport->ct_desc.ct_sns)) {
dma_free_coherent(&vha->hw->pdev->dev,
cmd.u.ctarg.req_allocated_size,
sp->u.iocb_cmd.u.ctarg.req,
sp->u.iocb_cmd.u.ctarg.req_dma);
->u..u..eq ;
} if (sp->u.iocb_cmd.u.ctarg.rsp &&
(!sp->fcport ||
sp->u.iocb_cmd.u.ctarg.rsp != sp->fcport->ct_desc.ct_sns)) {
dma_free_coherent(&vha->hw->pdev->dev,
sp->.iocb_cmd.u.ctarg.rsp_allocated_size,
sp->u.iocb_cmd.u.ctarg.rsp,
sp->u.iocb_cmd.u.ctarg.rsp_dma);
sp->u.iocb_cmd.u.ctarg.rsp = NULL;
} break; default: break;
}
}
void
qla2x00_init_async_sp(srb_t *sp, unsignedlong tmo, void (*done)(struct srb *sp, int res))
{
timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0);
sp->done = qla2x00_async_done;
sp->async_done java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sp->free = qla2x00_sp_free;
sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout if(scsi_sg_count((cmd)){
sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ; if (IS_QLAFX00(sp->vha->hw) && sp->type == SRB_FXIOCB_DCMD)
init_completion((!)
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
}
staticvoid
{
srb_iocb * =&sp-uiocb_cmd;
if (sp->fcport)
qla2x00_free_fcport( /* eventhough driver only need 1 T6 IOCB, FW still convert DSD to Continueation IOCB */
if (elsio->u.els_logo.els_logo_pyld)
dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE,
elsio>.ls_logo.ls_logo_pyld,
elsio->u.els_logo.els_logo_pyld_dma);
int
qla24xx_els_dcmd_iocbjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 16
port_id_t remote_did)
{
srb_t *sp;
fc_port_t *fcport = NULL; struct srb_iocb *elsio = NULL;
* =-java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 struct els_logo_payload logo_pyld int rval = QLA_SUCCESS;
fcport = qla2x00_alloc_fcport(vha, GFP_KERNEL); if (!fcport) {
return -ENOMEM;
}
=&-uscmdct6_ctxjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
* ref: INIT
*/
sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); if (!sp) {
qla2x00_free_fcport(fcport);
ql_log(ql_log_info, vha, 0x70e6, "SRB allocation failed\n"); returnENOMEM;
}
elsio->u.els_logo.els_cmd = els_opcode;
logo_pyld.opcode = els_opcode;
logo_pyld.s_id[0] = vha->d_id.b.al_pa;
logo_pyld.s_id[1] = vha->d_id.b.areareq-[handle = sp;
logo_pyld.s_id[2] = vha->d_id.b.domain;
host_to_fcp_swap(logo_pyld.s_id, sizeof(uint32_t));
memcpy(&logo_pyld.wwpn, java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 21
memcpy(elsio->u.els_logo.els_logo_pyld, &logo_pyld, sizeof -handle=make_handler-id )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x3075, "LOGO buffer:");
ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x010a,
elsio->u.els_logo.els_logo_pyld,
(elsio-.java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 51
rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) {
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 49
kref_put(&sp->cmd_kref, qla2x00_sp_release);
qla2x00_free_fcportfcport; return QLA_FUNCTION_FAILED;
}
java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 31 "%s LOGO sent, hdl=%x, loopid=%x, portid=%02x%02x%02x.\n", /* build FCP_CMND IU */
fcport- (>->un&-f-lun;
els_iocb->d_id[0] = sp &-f);
els_iocb->d_id[1] = sp->fcport->d_id.b.area -| java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
els_iocb->d_id[2] = sp->fcport->d_id.b.domain; /* For SID the byte order is different than DID */
els_iocb->s_id[1] = vha->d_id.java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 0
els_iocb->s_id[2] = vha->d_id.b.area;
els_iocb->s_id[0] = vha->d_id.b.java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 38
if (elsio->u.els_logo.els_cmd == ELS_DCMD_PLOGIjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 if (vha->hw->flags.edif_enabled)
els_iocb->control_flags = cpu_to_le16(ECF_SEC_LOGIN); else
els_iocb->control_flags = 0;
els_iocb->tx_byte_count = els_iocb->tx_len =
cpu_to_le32(sizeof(struct els_plogi_payload));
put_unaligned_le64(elsio->u.els_plogi.els_plogi_pyld_dma,
&els_iocb->tx_address);
els_iocb->rx_dsd_count = cpu_to_le16(r-java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 52
els_iocb->rx_byte_count = els_iocb->java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 0
cpu_to_le32(sizeof(struct els_plogi_payload));
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 20
&els_iocb->rx_address);
fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE); /* For edif, set logout on delete to ensure any residual key from FW is flushed.*/
fcport->logout_on_delete = 1;
fcport->chip_reset = vha->hw->base_qpair->chip_reset;
if (sp->flags & SRB_WAKEUP_ON_COMP)
complete(&lio->u.els_plogi.comp); else { switch (le32_to_cpu(fw_status[0])) { case CS_DATA_UNDERRUN: case CS_COMPLETE:
memset(&ea, 0, sizeof(ea));
ea.fcport = fcport;
ea.rc = res;
qla_handle_els_plogi_done(vha, &ea); break;
els_iocb->d_id[0] = a->did.b.al_pa;
els_iocb->d_id[1] = a->did.b.area;
els_iocb->d_id[2] = a->did.b.domain; /* For SID the byte order is different than DID */
els_iocb->s_id[1] = vha->d_id.b.al_pa;
els_iocb->s_id[2] = vha->d_id.b.area;
els_iocb->s_id[0] = vha->d_id.b.domain;
/* So we know we haven't pci_map'ed anything yet */
tot_dsds = 0;
dbval = 0x04 | (ha->portnum << 5);
/* Send marker if required */ if (vha->marker_needed != 0) { if (qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x300c, "qla2x00_marker failed for cmd=%p.\n", cmd); return QLA_FUNCTION_FAILED;
}
vha->marker_needed = 0;
}
/* Acquire ring specific lock */
spin_lock_irqsave(&ha->hardware_lock, flags);
handle = qla2xxx_get_next_handle(req); if (handle == 0) goto queuing_error;
/* Map the sg table so we have an accurate count of sg entries needed */ if (scsi_sg_count(cmd)) {
nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist(cmd),
scsi_sg_count(cmd), cmd->sc_data_direction); if (unlikely(!nseg)) goto queuing_error;
} else
nseg = 0;
/* Set total data segment count. */
cmd_pkt->entry_count = (uint8_t)req_cnt; /* Specify response queue number where *completionshouldhappen.
*/
cmd_pkt->entry_status = (uint8_t) rsp->id;
/*
* index map in firmware starts with 1; decrement index
* this is ok as we never use index 0
*/
map = (sp->u.iocb_cmd.u.ctrlvp.vp_index - 1) / 8;
pos = (sp->u.iocb_cmd.u.ctrlvp.vp_index - 1) & 7;
vce->vp_idx_map[map] |= 1 << pos;
}
switch (sp->type) {
case SRB_TM_CMD:
case SRB_PRLI_CMD:
case SRB_ADISC_CMD:
push_it_through = true;
fallthrough;
case SRB_LOGIN_CMD:
case SRB_ELS_CMD_RPT:
case SRB_ELS_CMD_HST:
case SRB_ELS_CMD_HST_NOLOGIN:
case SRB_CT_CMD:
case SRB_NVME_LS:
case SRB_ELS_DCMD:
get_exch = true;
break;
case SRB_FXIOCB_DCMD:
case SRB_FXIOCB_BCMD:
sp->iores.res_type = RESOURCE_NONE;
return 0;
case SRB_SA_UPDATE:
case SRB_SA_REPLACE:
case SRB_MB_IOCB:
case SRB_ABT_CMD:
case SRB_NACK_PLOGI:
case SRB_NACK_PRLI:
case SRB_NACK_LOGO:
case SRB_LOGOUT_CMD:
case SRB_CTRL_VP:
case SRB_MARKER:
default:
push_it_through = true;
get_exch = false;
}
switch (sp->type) {
case SRB_LOGIN_CMD:
IS_FWI2_CAPABLE(ha) ?
qla24xx_login_iocb(sp, pkt) :
qla2x00_login_iocb(sp, pkt);
break;
case SRB_PRLI_CMD:
qla24xx_prli_iocb(sp, pkt);
break;
case SRB_LOGOUT_CMD:
IS_FWI2_CAPABLE(ha) ?
qla24xx_logout_iocb(sp, pkt) :
qla2x00_logout_iocb(sp, pkt);
break;
case SRB_ELS_CMD_RPT:
case SRB_ELS_CMD_HST:
qla24xx_els_iocb(sp, pkt);
break;
case SRB_ELS_CMD_HST_NOLOGIN:
qla_els_pt_iocb(sp->vha, pkt, &sp->u.bsg_cmd.u.els_arg);
((struct els_entry_24xx *)pkt)->handle = sp->handle;
break;
case SRB_CT_CMD:
IS_FWI2_CAPABLE(ha) ?
qla24xx_ct_iocb(sp, pkt) :
qla2x00_ct_iocb(sp, pkt);
break;
case SRB_ADISC_CMD:
IS_FWI2_CAPABLE(ha) ?
qla24xx_adisc_iocb(sp, pkt) :
qla2x00_adisc_iocb(sp, pkt);
break;
case SRB_TM_CMD:
IS_QLAFX00(ha) ?
qlafx00_tm_iocb(sp, pkt) :
qla24xx_tm_iocb(sp, pkt);
break;
case SRB_FXIOCB_DCMD:
case SRB_FXIOCB_BCMD:
qlafx00_fxdisc_iocb(sp, pkt);
break;
case SRB_NVME_LS:
qla_nvme_ls(sp, pkt);
break;
case SRB_ABT_CMD:
IS_QLAFX00(ha) ?
qlafx00_abort_iocb(sp, pkt) :
qla24xx_abort_iocb(sp, pkt);
break;
case SRB_ELS_DCMD:
qla24xx_els_logo_iocb(sp, pkt);
break;
case SRB_CT_PTHRU_CMD:
qla2x00_ctpthru_cmd_iocb(sp, pkt);
break;
case SRB_MB_IOCB:
qla2x00_mb_iocb(sp, pkt);
break;
case SRB_NACK_PLOGI:
case SRB_NACK_PRLI:
case SRB_NACK_LOGO:
qla2x00_send_notify_ack_iocb(sp, pkt);
break;
case SRB_CTRL_VP:
qla25xx_ctrlvp_iocb(sp, pkt);
break;
case SRB_PRLO_CMD:
qla24xx_prlo_iocb(sp, pkt);
break;
case SRB_SA_UPDATE:
qla24xx_sa_update_iocb(sp, pkt);
break;
case SRB_SA_REPLACE:
qla24xx_sa_replace_iocb(sp, pkt);
break;
case SRB_MARKER:
qla_marker_iocb(sp, pkt);
break;
default:
break;
}
if (sp->start_timer) {
/* ref: TMR timer ref
* this code should be just before start_iocbs function
* This will make sure that caller function don't to do
* kref_put even on failure
*/
kref_get(&sp->cmd_kref);
add_timer(&sp->u.iocb_cmd.timer);
}
/*Update entry type to indicate bidir command */
put_unaligned_le32(COMMAND_BIDIRECTIONAL, &cmd_pkt->entry_type);
/* Set the transfer direction, in this set both flags
* Also set the BD_WRAP_BACK flag, firmware will take care
* assigning DID=SID for outgoing pkts.
*/
cmd_pkt->wr_dseg_count = cpu_to_le16(bsg_job->request_payload.sg_cnt);
cmd_pkt->rd_dseg_count = cpu_to_le16(bsg_job->reply_payload.sg_cnt);
cmd_pkt->control_flags = cpu_to_le16(BD_WRITE_DATA | BD_READ_DATA |
BD_WRAP_BACK);
/* Allocate additional continuation packets */
if (avail_dsds == 0) {
/* Continuation type 1 IOCB can accomodate
* 5 DSDS
*/
cont_pkt = qla2x00_prep_cont_type1_iocb(vha, vha->req);
cur_dsd = cont_pkt->dsd;
avail_dsds = 5;
entry_count++;
}
append_dsd64(&cur_dsd, sg);
avail_dsds--;
}
/* For read request DSD will always goes to continuation IOCB
* and follow the write DSD. If there is room on the current IOCB
* then it is added to that IOCB else new continuation IOCB is
* allocated.
*/
for_each_sg(bsg_job->reply_payload.sg_list, sg,
bsg_job->reply_payload.sg_cnt, index) {
cont_a64_entry_t *cont_pkt;
/* Allocate additional continuation packets */
if (avail_dsds == 0) {
/* Continuation type 1 IOCB can accomodate
* 5 DSDS
*/
cont_pkt = qla2x00_prep_cont_type1_iocb(vha, vha->req);
cur_dsd = cont_pkt->dsd;
avail_dsds = 5;
entry_count++;
}
append_dsd64(&cur_dsd, sg);
avail_dsds--;
}
/* This value should be same as number of IOCB required for this cmd */
cmd_pkt->entry_count = entry_count;
}
int
qla2x00_start_bidir(srb_t *sp, struct scsi_qla_host *vha, uint32_t tot_dsds)
{
/* So we know we haven't pci_map'ed anything yet */
tot_dsds = 0;
/* Send marker if required */
if (vha->marker_needed != 0) {
if (__qla2x00_marker(vha, qpair, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS) {
spin_unlock_irqrestore(&qpair->qp_lock, flags);
return QLA_FUNCTION_FAILED;
}
vha->marker_needed = 0;
}
handle = qla2xxx_get_next_handle(req);
if (handle == 0)
goto queuing_error;
/* Map the sg table so we have an accurate count of sg entries needed */
if (scsi_sg_count(cmd)) {
nseg = dma_map_sg(&ha->pdev->dev, scsi_sglist(cmd),
scsi_sg_count(cmd), cmd->sc_data_direction);
if (unlikely(!nseg))
goto queuing_error;
} else {
nseg = 0;
}
tot_dsds = nseg;
/* eventhough driver only need 1 T6 IOCB, FW still convert DSD to Continueation IOCB */
req_cnt = qla24xx_calc_iocbs(vha, tot_dsds);
if (qla_get_fw_resources(sp->qpair, &sp->iores))
goto queuing_error;
more_dsd_lists = qla24xx_calc_dsd_lists(tot_dsds);
if ((more_dsd_lists + qpair->dsd_inuse) >= NUM_DSD_CHAIN) {
ql_dbg(ql_dbg_io, vha, 0x3028,
"Num of DSD list %d is than %d for cmd=%p.\n",
more_dsd_lists + qpair->dsd_inuse, NUM_DSD_CHAIN, cmd);
goto queuing_error;
}
if (more_dsd_lists <= qpair->dsd_avail)
goto sufficient_dsds;
else
more_dsd_lists -= qpair->dsd_avail;
for (i = 0; i < more_dsd_lists; i++) {
dsd_ptr = kzalloc(sizeof(*dsd_ptr), GFP_ATOMIC);
if (!dsd_ptr) {
ql_log(ql_log_fatal, vha, 0x3029,
"Failed to allocate memory for dsd_dma for cmd=%p.\n", cmd);
goto queuing_error;
}
INIT_LIST_HEAD(&dsd_ptr->list);
dsd_ptr->dsd_addr = dma_pool_alloc(ha->dl_dma_pool,
GFP_ATOMIC, &dsd_ptr->dsd_list_dma);
if (!dsd_ptr->dsd_addr) {
kfree(dsd_ptr);
ql_log(ql_log_fatal, vha, 0x302a,
"Failed to allocate memory for dsd_addr for cmd=%p.\n", cmd);
goto queuing_error;
}
list_add_tail(&dsd_ptr->list, &qpair->dsd_list);
qpair->dsd_avail++;
}
sufficient_dsds:
req_cnt = 1;
if (req->cnt < (req_cnt + 2)) {
if (IS_SHADOW_REG_CAPABLE(ha)) {
cnt = *req->out_ptr;
} else {
cnt = (uint16_t)rd_reg_dword_relaxed(req->req_q_out);
if (qla2x00_check_reg16_for_disconnect(vha, cnt))
goto queuing_error;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.