• Home
  • Raw
  • Download

Lines Matching refs:prm

1638 	struct qla_tgt_sess_work_param *prm;  in qlt_sched_sess_work()  local
1641 prm = kzalloc(sizeof(*prm), GFP_ATOMIC); in qlt_sched_sess_work()
1642 if (!prm) { in qlt_sched_sess_work()
1652 type, prm, param, param_size, tgt); in qlt_sched_sess_work()
1654 prm->type = type; in qlt_sched_sess_work()
1655 memcpy(&prm->tm_iocb, param, param_size); in qlt_sched_sess_work()
1658 list_add_tail(&prm->sess_works_list_entry, &tgt->sess_works_list); in qlt_sched_sess_work()
2398 static int qlt_pci_map_calc_cnt(struct qla_tgt_prm *prm) in qlt_pci_map_calc_cnt() argument
2400 struct qla_tgt_cmd *cmd = prm->cmd; in qlt_pci_map_calc_cnt()
2404 prm->sg = (struct scatterlist *)cmd->sg; in qlt_pci_map_calc_cnt()
2405 prm->seg_cnt = dma_map_sg(&cmd->qpair->pdev->dev, cmd->sg, in qlt_pci_map_calc_cnt()
2407 if (unlikely(prm->seg_cnt == 0)) in qlt_pci_map_calc_cnt()
2410 prm->cmd->sg_mapped = 1; in qlt_pci_map_calc_cnt()
2417 if (prm->seg_cnt > QLA_TGT_DATASEGS_PER_CMD_24XX) in qlt_pci_map_calc_cnt()
2418 prm->req_cnt += DIV_ROUND_UP(prm->seg_cnt - in qlt_pci_map_calc_cnt()
2425 prm->seg_cnt = DIV_ROUND_UP(cmd->bufflen, cmd->blk_sz); in qlt_pci_map_calc_cnt()
2426 prm->tot_dsds = prm->seg_cnt; in qlt_pci_map_calc_cnt()
2428 prm->tot_dsds = prm->seg_cnt; in qlt_pci_map_calc_cnt()
2431 prm->prot_sg = cmd->prot_sg; in qlt_pci_map_calc_cnt()
2432 prm->prot_seg_cnt = dma_map_sg(&cmd->qpair->pdev->dev, in qlt_pci_map_calc_cnt()
2435 if (unlikely(prm->prot_seg_cnt == 0)) in qlt_pci_map_calc_cnt()
2441 prm->prot_seg_cnt = DIV_ROUND_UP(cmd->bufflen, in qlt_pci_map_calc_cnt()
2443 prm->tot_dsds += prm->prot_seg_cnt; in qlt_pci_map_calc_cnt()
2445 prm->tot_dsds += prm->prot_seg_cnt; in qlt_pci_map_calc_cnt()
2452 ql_dbg_qp(ql_dbg_tgt, prm->cmd->qpair, 0xe04d, in qlt_pci_map_calc_cnt()
2454 0, prm->cmd->sg_cnt); in qlt_pci_map_calc_cnt()
2563 struct qla_tgt_prm *prm) in qlt_24xx_build_ctio_pkt() argument
2567 struct atio_from_isp *atio = &prm->cmd->atio; in qlt_24xx_build_ctio_pkt()
2571 prm->pkt = pkt; in qlt_24xx_build_ctio_pkt()
2575 pkt->entry_count = (uint8_t)prm->req_cnt; in qlt_24xx_build_ctio_pkt()
2576 pkt->vp_index = prm->cmd->vp_idx; in qlt_24xx_build_ctio_pkt()
2587 qpair->req->outstanding_cmds[h] = (srb_t *)prm->cmd; in qlt_24xx_build_ctio_pkt()
2591 pkt->nport_handle = cpu_to_le16(prm->cmd->loop_id); in qlt_24xx_build_ctio_pkt()
2599 pkt->u.status0.relative_offset = cpu_to_le32(prm->cmd->offset); in qlt_24xx_build_ctio_pkt()
2608 static void qlt_load_cont_data_segments(struct qla_tgt_prm *prm) in qlt_load_cont_data_segments() argument
2614 while (prm->seg_cnt > 0) { in qlt_load_cont_data_segments()
2617 prm->cmd->qpair->req); in qlt_load_cont_data_segments()
2636 cnt < QLA_TGT_DATASEGS_PER_CONT_24XX && prm->seg_cnt; in qlt_load_cont_data_segments()
2637 cnt++, prm->seg_cnt--) { in qlt_load_cont_data_segments()
2638 append_dsd64(&cur_dsd, prm->sg); in qlt_load_cont_data_segments()
2639 prm->sg = sg_next(prm->sg); in qlt_load_cont_data_segments()
2648 static void qlt_load_data_segments(struct qla_tgt_prm *prm) in qlt_load_data_segments() argument
2652 struct ctio7_to_24xx *pkt24 = (struct ctio7_to_24xx *)prm->pkt; in qlt_load_data_segments()
2654 pkt24->u.status0.transfer_length = cpu_to_le32(prm->cmd->bufflen); in qlt_load_data_segments()
2660 if (prm->seg_cnt) in qlt_load_data_segments()
2661 pkt24->dseg_count = cpu_to_le16(prm->seg_cnt); in qlt_load_data_segments()
2663 if (prm->seg_cnt == 0) { in qlt_load_data_segments()
2674 (cnt < QLA_TGT_DATASEGS_PER_CMD_24XX) && prm->seg_cnt; in qlt_load_data_segments()
2675 cnt++, prm->seg_cnt--) { in qlt_load_data_segments()
2676 append_dsd64(&cur_dsd, prm->sg); in qlt_load_data_segments()
2677 prm->sg = sg_next(prm->sg); in qlt_load_data_segments()
2680 qlt_load_cont_data_segments(prm); in qlt_load_data_segments()
2688 static void qlt_print_dif_err(struct qla_tgt_prm *prm) in qlt_print_dif_err() argument
2694 if (prm->sense_buffer && (prm->sense_buffer[12] == 0x10)) { in qlt_print_dif_err()
2695 cmd = prm->cmd; in qlt_print_dif_err()
2698 switch (prm->sense_buffer[13]) { in qlt_print_dif_err()
2736 struct qla_tgt_prm *prm, int xmit_type, uint8_t scsi_status, in qlt_pre_xmit_response() argument
2742 prm->cmd = cmd; in qlt_pre_xmit_response()
2743 prm->tgt = cmd->tgt; in qlt_pre_xmit_response()
2744 prm->pkt = NULL; in qlt_pre_xmit_response()
2745 prm->rq_result = scsi_status; in qlt_pre_xmit_response()
2746 prm->sense_buffer = &cmd->sense_buffer[0]; in qlt_pre_xmit_response()
2747 prm->sense_buffer_len = TRANSPORT_SENSE_BUFFER; in qlt_pre_xmit_response()
2748 prm->sg = NULL; in qlt_pre_xmit_response()
2749 prm->seg_cnt = -1; in qlt_pre_xmit_response()
2750 prm->req_cnt = 1; in qlt_pre_xmit_response()
2751 prm->residual = 0; in qlt_pre_xmit_response()
2752 prm->add_status_pkt = 0; in qlt_pre_xmit_response()
2753 prm->prot_sg = NULL; in qlt_pre_xmit_response()
2754 prm->prot_seg_cnt = 0; in qlt_pre_xmit_response()
2755 prm->tot_dsds = 0; in qlt_pre_xmit_response()
2758 if (qlt_pci_map_calc_cnt(prm) != 0) in qlt_pre_xmit_response()
2762 *full_req_cnt = prm->req_cnt; in qlt_pre_xmit_response()
2765 prm->residual = se_cmd->residual_count; in qlt_pre_xmit_response()
2768 prm->residual, se_cmd->tag, in qlt_pre_xmit_response()
2770 cmd->bufflen, prm->rq_result); in qlt_pre_xmit_response()
2771 prm->rq_result |= SS_RESIDUAL_UNDER; in qlt_pre_xmit_response()
2773 prm->residual = se_cmd->residual_count; in qlt_pre_xmit_response()
2776 prm->residual, se_cmd->tag, se_cmd->t_task_cdb ? in qlt_pre_xmit_response()
2777 se_cmd->t_task_cdb[0] : 0, cmd->bufflen, prm->rq_result); in qlt_pre_xmit_response()
2778 prm->rq_result |= SS_RESIDUAL_OVER; in qlt_pre_xmit_response()
2787 if (QLA_TGT_SENSE_VALID(prm->sense_buffer) || in qlt_pre_xmit_response()
2789 (prm->rq_result != 0))) { in qlt_pre_xmit_response()
2790 prm->add_status_pkt = 1; in qlt_pre_xmit_response()
2813 struct qla_tgt_prm *prm) in qlt_24xx_init_ctio_to_isp() argument
2815 prm->sense_buffer_len = min_t(uint32_t, prm->sense_buffer_len, in qlt_24xx_init_ctio_to_isp()
2818 if (qlt_need_explicit_conf(prm->cmd, 0)) { in qlt_24xx_init_ctio_to_isp()
2823 ctio->u.status0.residual = cpu_to_le32(prm->residual); in qlt_24xx_init_ctio_to_isp()
2824 ctio->u.status0.scsi_status = cpu_to_le16(prm->rq_result); in qlt_24xx_init_ctio_to_isp()
2825 if (QLA_TGT_SENSE_VALID(prm->sense_buffer)) { in qlt_24xx_init_ctio_to_isp()
2828 if (qlt_need_explicit_conf(prm->cmd, 1)) { in qlt_24xx_init_ctio_to_isp()
2829 if ((prm->rq_result & SS_SCSI_STATUS_BYTE) != 0) { in qlt_24xx_init_ctio_to_isp()
2830 ql_dbg_qp(ql_dbg_tgt, prm->cmd->qpair, 0xe017, in qlt_24xx_init_ctio_to_isp()
2848 cpu_to_le16(prm->sense_buffer_len); in qlt_24xx_init_ctio_to_isp()
2849 for (i = 0; i < prm->sense_buffer_len/4; i++) { in qlt_24xx_init_ctio_to_isp()
2853 &((uint32_t *)prm->sense_buffer)[i]); in qlt_24xx_init_ctio_to_isp()
2857 qlt_print_dif_err(prm); in qlt_24xx_init_ctio_to_isp()
3002 qlt_build_ctio_crc2_pkt(struct qla_qpair *qpair, struct qla_tgt_prm *prm) in qlt_build_ctio_crc2_pkt() argument
3014 struct qla_tgt_cmd *cmd = prm->cmd; in qlt_build_ctio_crc2_pkt()
3017 struct atio_from_isp *atio = &prm->cmd->atio; in qlt_build_ctio_crc2_pkt()
3025 prm->pkt = pkt; in qlt_build_ctio_crc2_pkt()
3031 prm->prot_sg, prm->prot_seg_cnt, se_cmd->t_task_lba); in qlt_build_ctio_crc2_pkt()
3104 qpair->req->outstanding_cmds[h] = (srb_t *)prm->cmd; in qlt_build_ctio_crc2_pkt()
3108 pkt->nport_handle = cpu_to_le16(prm->cmd->loop_id); in qlt_build_ctio_crc2_pkt()
3119 pkt->relative_offset = cpu_to_le32(prm->cmd->offset); in qlt_build_ctio_crc2_pkt()
3127 pkt->dseg_count = cpu_to_le16(prm->tot_dsds); in qlt_build_ctio_crc2_pkt()
3161 cpu_to_le16(prm->tot_dsds - prm->prot_seg_cnt); in qlt_build_ctio_crc2_pkt()
3183 if (!bundling && prm->prot_seg_cnt) { in qlt_build_ctio_crc2_pkt()
3185 prm->tot_dsds, &tc)) in qlt_build_ctio_crc2_pkt()
3188 (prm->tot_dsds - prm->prot_seg_cnt), &tc)) in qlt_build_ctio_crc2_pkt()
3191 if (bundling && prm->prot_seg_cnt) { in qlt_build_ctio_crc2_pkt()
3197 prm->prot_seg_cnt, cmd)) in qlt_build_ctio_crc2_pkt()
3219 struct qla_tgt_prm prm; in qlt_xmit_response() local
3236 res = qlt_pre_xmit_response(cmd, &prm, xmit_type, scsi_status, in qlt_xmit_response()
3268 res = qlt_build_ctio_crc2_pkt(qpair, &prm); in qlt_xmit_response()
3270 res = qlt_24xx_build_ctio_pkt(qpair, &prm); in qlt_xmit_response()
3276 pkt = (struct ctio7_to_24xx *)prm.pkt; in qlt_xmit_response()
3284 qlt_load_data_segments(&prm); in qlt_xmit_response()
3286 if (prm.add_status_pkt == 0) { in qlt_xmit_response()
3289 cpu_to_le16(prm.rq_result); in qlt_xmit_response()
3291 cpu_to_le32(prm.residual); in qlt_xmit_response()
3338 &prm); in qlt_xmit_response()
3341 qlt_24xx_init_ctio_to_isp(pkt, &prm); in qlt_xmit_response()
3371 struct qla_tgt_prm prm; in qlt_rdy_to_xfer() local
3376 memset(&prm, 0, sizeof(prm)); in qlt_rdy_to_xfer()
3377 prm.cmd = cmd; in qlt_rdy_to_xfer()
3378 prm.tgt = tgt; in qlt_rdy_to_xfer()
3379 prm.sg = NULL; in qlt_rdy_to_xfer()
3380 prm.req_cnt = 1; in qlt_rdy_to_xfer()
3400 if (qlt_pci_map_calc_cnt(&prm) != 0) in qlt_rdy_to_xfer()
3405 res = qlt_check_reserve_free_req(qpair, prm.req_cnt); in qlt_rdy_to_xfer()
3409 res = qlt_build_ctio_crc2_pkt(qpair, &prm); in qlt_rdy_to_xfer()
3411 res = qlt_24xx_build_ctio_pkt(qpair, &prm); in qlt_rdy_to_xfer()
3414 qpair->req->cnt += prm.req_cnt; in qlt_rdy_to_xfer()
3418 pkt = (struct ctio7_to_24xx *)prm.pkt; in qlt_rdy_to_xfer()
3423 qlt_load_data_segments(&prm); in qlt_rdy_to_xfer()
6155 struct qla_tgt_sess_work_param *prm) in qlt_abort_work() argument
6169 s_id = le_id_to_be(prm->abts.fcp_hdr_le.s_id); in qlt_abort_work()
6196 rc = __qlt_24xx_handle_abts(vha, &prm->abts, sess); in qlt_abort_work()
6210 qlt_24xx_send_abts_resp(ha->base_qpair, &prm->abts, in qlt_abort_work()
6216 struct qla_tgt_sess_work_param *prm) in qlt_tmr_work() argument
6218 struct atio_from_isp *a = &prm->tm_iocb2; in qlt_tmr_work()
6234 s_id = prm->tm_iocb2.u.isp24.fcp_hdr.s_id; in qlt_tmr_work()
6275 qlt_send_term_exchange(ha->base_qpair, NULL, &prm->tm_iocb2, 1, 0); in qlt_tmr_work()
6288 struct qla_tgt_sess_work_param *prm = list_entry( in qlt_sess_work_fn() local
6289 tgt->sess_works_list.next, typeof(*prm), in qlt_sess_work_fn()
6296 list_del(&prm->sess_works_list_entry); in qlt_sess_work_fn()
6300 switch (prm->type) { in qlt_sess_work_fn()
6302 qlt_abort_work(tgt, prm); in qlt_sess_work_fn()
6305 qlt_tmr_work(tgt, prm); in qlt_sess_work_fn()
6314 kfree(prm); in qlt_sess_work_fn()