Lines Matching refs:mcmd

1178 static int qlt_reset(struct scsi_qla_host *vha, void *iocb, int mcmd)  in qlt_reset()  argument
1210 mcmd, loop_id); in qlt_reset()
1212 return qlt_issue_task_mgmt(sess, 0, mcmd, iocb, QLA24XX_MGMT_SEND_NACK); in qlt_reset()
1726 static int qlt_build_abts_resp_iocb(struct qla_tgt_mgmt_cmd *mcmd) in qlt_build_abts_resp_iocb() argument
1728 struct scsi_qla_host *vha = mcmd->vha; in qlt_build_abts_resp_iocb()
1735 struct abts_recv_from_24xx *abts = &mcmd->orig_iocb.abts; in qlt_build_abts_resp_iocb()
1736 struct qla_qpair *qpair = mcmd->qpair; in qlt_build_abts_resp_iocb()
1740 ha, mcmd->fc_tm_rsp); in qlt_build_abts_resp_iocb()
1762 qpair->req->outstanding_cmds[h] = (srb_t *)mcmd; in qlt_build_abts_resp_iocb()
1785 if (mcmd->fc_tm_rsp == FCP_TMF_CMPL) { in qlt_build_abts_resp_iocb()
1888 struct qla_qpair *qpair, response_t *pkt, struct qla_tgt_mgmt_cmd *mcmd) in qlt_24xx_retry_term_exchange() argument
1902 if (mcmd) in qlt_24xx_retry_term_exchange()
1904 entry = &mcmd->orig_iocb.abts; in qlt_24xx_retry_term_exchange()
1923 if (mcmd) { in qlt_24xx_retry_term_exchange()
1926 if (mcmd->flags & QLA24XX_MGMT_ABORT_IO_ATTR_VALID) in qlt_24xx_retry_term_exchange()
1927 tmp |= (mcmd->abort_io_attr << 9); in qlt_24xx_retry_term_exchange()
1943 (mcmd && mcmd->flags & QLA24XX_MGMT_ABORT_IO_ATTR_VALID) ? 1 : 0); in qlt_24xx_retry_term_exchange()
1952 if (mcmd) in qlt_24xx_retry_term_exchange()
1953 qlt_build_abts_resp_iocb(mcmd); in qlt_24xx_retry_term_exchange()
2028 struct qla_tgt_mgmt_cmd *mcmd = in qlt_do_tmr_work() local
2030 struct qla_hw_data *ha = mcmd->vha->hw; in qlt_do_tmr_work()
2035 switch (mcmd->tmr_func) { in qlt_do_tmr_work()
2037 tag = le32_to_cpu(mcmd->orig_iocb.abts.exchange_addr_to_abort); in qlt_do_tmr_work()
2044 rc = ha->tgt.tgt_ops->handle_tmr(mcmd, mcmd->unpacked_lun, in qlt_do_tmr_work()
2045 mcmd->tmr_func, tag); in qlt_do_tmr_work()
2048 spin_lock_irqsave(mcmd->qpair->qp_lock_ptr, flags); in qlt_do_tmr_work()
2049 switch (mcmd->tmr_func) { in qlt_do_tmr_work()
2051 mcmd->fc_tm_rsp = FCP_TMF_REJECTED; in qlt_do_tmr_work()
2052 qlt_build_abts_resp_iocb(mcmd); in qlt_do_tmr_work()
2059 qlt_send_busy(mcmd->qpair, &mcmd->orig_iocb.atio, in qlt_do_tmr_work()
2066 qlt_send_notify_ack(mcmd->qpair, in qlt_do_tmr_work()
2067 &mcmd->orig_iocb.imm_ntfy, 0, 0, 0, 0, 0, 0); in qlt_do_tmr_work()
2070 spin_unlock_irqrestore(mcmd->qpair->qp_lock_ptr, flags); in qlt_do_tmr_work()
2072 ql_dbg(ql_dbg_tgt_mgt, mcmd->vha, 0xf052, in qlt_do_tmr_work()
2074 mcmd->vha->vp_idx, rc); in qlt_do_tmr_work()
2075 mempool_free(mcmd, qla_tgt_mgmt_cmd_mempool); in qlt_do_tmr_work()
2084 struct qla_tgt_mgmt_cmd *mcmd; in __qlt_24xx_handle_abts() local
2091 mcmd = mempool_alloc(qla_tgt_mgmt_cmd_mempool, GFP_ATOMIC); in __qlt_24xx_handle_abts()
2092 if (mcmd == NULL) { in __qlt_24xx_handle_abts()
2098 memset(mcmd, 0, sizeof(*mcmd)); in __qlt_24xx_handle_abts()
2099 mcmd->cmd_type = TYPE_TGT_TMCMD; in __qlt_24xx_handle_abts()
2100 mcmd->sess = sess; in __qlt_24xx_handle_abts()
2101 memcpy(&mcmd->orig_iocb.abts, abts, sizeof(mcmd->orig_iocb.abts)); in __qlt_24xx_handle_abts()
2102 mcmd->reset_count = ha->base_qpair->chip_reset; in __qlt_24xx_handle_abts()
2103 mcmd->tmr_func = QLA_TGT_ABTS; in __qlt_24xx_handle_abts()
2104 mcmd->qpair = h->qpair; in __qlt_24xx_handle_abts()
2105 mcmd->vha = vha; in __qlt_24xx_handle_abts()
2111 mcmd->se_cmd.cpuid = h->cpuid; in __qlt_24xx_handle_abts()
2119 mcmd->qpair = abort_cmd->qpair; in __qlt_24xx_handle_abts()
2120 mcmd->se_cmd.cpuid = abort_cmd->se_cmd.cpuid; in __qlt_24xx_handle_abts()
2121 mcmd->abort_io_attr = abort_cmd->atio.u.isp24.attr; in __qlt_24xx_handle_abts()
2122 mcmd->flags = QLA24XX_MGMT_ABORT_IO_ATTR_VALID; in __qlt_24xx_handle_abts()
2126 INIT_WORK(&mcmd->work, qlt_do_tmr_work); in __qlt_24xx_handle_abts()
2127 queue_work_on(mcmd->se_cmd.cpuid, qla_tgt_wq, &mcmd->work); in __qlt_24xx_handle_abts()
2207 struct qla_tgt_mgmt_cmd *mcmd, uint32_t resp_code) in qlt_24xx_send_task_mgmt_ctio() argument
2209 struct scsi_qla_host *ha = mcmd->vha; in qlt_24xx_send_task_mgmt_ctio()
2210 struct atio_from_isp *atio = &mcmd->orig_iocb.atio; in qlt_24xx_send_task_mgmt_ctio()
2230 ctio->nport_handle = cpu_to_le16(mcmd->sess->loop_id); in qlt_24xx_send_task_mgmt_ctio()
2253 void qlt_free_mcmd(struct qla_tgt_mgmt_cmd *mcmd) in qlt_free_mcmd() argument
2255 mempool_free(mcmd, qla_tgt_mgmt_cmd_mempool); in qlt_free_mcmd()
2328 void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *mcmd) in qlt_xmit_tm_rsp() argument
2330 struct scsi_qla_host *vha = mcmd->sess->vha; in qlt_xmit_tm_rsp()
2333 struct qla_qpair *qpair = mcmd->qpair; in qlt_xmit_tm_rsp()
2338 mcmd, mcmd->fc_tm_rsp, mcmd->flags); in qlt_xmit_tm_rsp()
2342 if (!vha->flags.online || mcmd->reset_count != qpair->chip_reset) { in qlt_xmit_tm_rsp()
2350 mcmd->reset_count, qpair->chip_reset); in qlt_xmit_tm_rsp()
2351 ha->tgt.tgt_ops->free_mcmd(mcmd); in qlt_xmit_tm_rsp()
2356 if (mcmd->flags == QLA24XX_MGMT_SEND_NACK) { in qlt_xmit_tm_rsp()
2357 switch (mcmd->orig_iocb.imm_ntfy.u.isp24.status_subcode) { in qlt_xmit_tm_rsp()
2363 mcmd->sess->port_name, mcmd->fc_tm_rsp, in qlt_xmit_tm_rsp()
2364 mcmd->flags); in qlt_xmit_tm_rsp()
2365 qlt_schedule_sess_for_deletion(mcmd->sess); in qlt_xmit_tm_rsp()
2369 &mcmd->orig_iocb.imm_ntfy, 0, 0, 0, 0, 0, 0); in qlt_xmit_tm_rsp()
2373 if (mcmd->orig_iocb.atio.u.raw.entry_type == ABTS_RECV_24XX) { in qlt_xmit_tm_rsp()
2374 qlt_build_abts_resp_iocb(mcmd); in qlt_xmit_tm_rsp()
2377 qlt_24xx_send_task_mgmt_ctio(qpair, mcmd, in qlt_xmit_tm_rsp()
2378 mcmd->fc_tm_rsp); in qlt_xmit_tm_rsp()
2389 ha->tgt.tgt_ops->free_mcmd(mcmd); in qlt_xmit_tm_rsp()
4397 struct qla_tgt_mgmt_cmd *mcmd; in qlt_issue_task_mgmt() local
4401 mcmd = mempool_alloc(qla_tgt_mgmt_cmd_mempool, GFP_ATOMIC); in qlt_issue_task_mgmt()
4402 if (!mcmd) { in qlt_issue_task_mgmt()
4409 memset(mcmd, 0, sizeof(*mcmd)); in qlt_issue_task_mgmt()
4410 mcmd->sess = sess; in qlt_issue_task_mgmt()
4413 memcpy(&mcmd->orig_iocb.imm_ntfy, iocb, in qlt_issue_task_mgmt()
4414 sizeof(mcmd->orig_iocb.imm_ntfy)); in qlt_issue_task_mgmt()
4416 mcmd->tmr_func = fn; in qlt_issue_task_mgmt()
4417 mcmd->flags = flags; in qlt_issue_task_mgmt()
4418 mcmd->reset_count = ha->base_qpair->chip_reset; in qlt_issue_task_mgmt()
4419 mcmd->qpair = h->qpair; in qlt_issue_task_mgmt()
4420 mcmd->vha = vha; in qlt_issue_task_mgmt()
4421 mcmd->se_cmd.cpuid = h->cpuid; in qlt_issue_task_mgmt()
4422 mcmd->unpacked_lun = lun; in qlt_issue_task_mgmt()
4431 h = qlt_find_qphint(vha, mcmd->unpacked_lun); in qlt_issue_task_mgmt()
4432 mcmd->qpair = h->qpair; in qlt_issue_task_mgmt()
4433 mcmd->se_cmd.cpuid = h->cpuid; in qlt_issue_task_mgmt()
4445 INIT_WORK(&mcmd->work, qlt_do_tmr_work); in qlt_issue_task_mgmt()
4446 queue_work_on(mcmd->se_cmd.cpuid, qla_tgt_wq, in qlt_issue_task_mgmt()
4447 &mcmd->work); in qlt_issue_task_mgmt()
4484 struct qla_tgt_mgmt_cmd *mcmd; in __qlt_abort_task() local
4488 mcmd = mempool_alloc(qla_tgt_mgmt_cmd_mempool, GFP_ATOMIC); in __qlt_abort_task()
4489 if (mcmd == NULL) { in __qlt_abort_task()
4495 memset(mcmd, 0, sizeof(*mcmd)); in __qlt_abort_task()
4497 mcmd->sess = sess; in __qlt_abort_task()
4498 memcpy(&mcmd->orig_iocb.imm_ntfy, iocb, in __qlt_abort_task()
4499 sizeof(mcmd->orig_iocb.imm_ntfy)); in __qlt_abort_task()
4503 mcmd->reset_count = ha->base_qpair->chip_reset; in __qlt_abort_task()
4504 mcmd->tmr_func = QLA_TGT_2G_ABORT_TASK; in __qlt_abort_task()
4505 mcmd->qpair = ha->base_qpair; in __qlt_abort_task()
4507 rc = ha->tgt.tgt_ops->handle_tmr(mcmd, unpacked_lun, mcmd->tmr_func, in __qlt_abort_task()
4513 mempool_free(mcmd, qla_tgt_mgmt_cmd_mempool); in __qlt_abort_task()
5705 struct qla_tgt_mgmt_cmd *mcmd; in qlt_handle_abts_completion() local
5708 mcmd = qlt_ctio_to_cmd(vha, rsp, pkt->handle, pkt); in qlt_handle_abts_completion()
5709 if (mcmd == NULL && h != QLA_TGT_SKIP_HANDLE) { in qlt_handle_abts_completion()
5716 if (mcmd) in qlt_handle_abts_completion()
5717 vha = mcmd->vha; in qlt_handle_abts_completion()
5728 ha->tgt.tgt_ops->free_mcmd(mcmd); in qlt_handle_abts_completion()
5732 pkt, mcmd); in qlt_handle_abts_completion()
5739 ha->tgt.tgt_ops->free_mcmd(mcmd); in qlt_handle_abts_completion()
5741 } else if (mcmd) { in qlt_handle_abts_completion()
5742 ha->tgt.tgt_ops->free_mcmd(mcmd); in qlt_handle_abts_completion()