Lines Matching refs:prm

1684 	struct qla_tgt_sess_work_param *prm;  in qlt_sched_sess_work()  local
1687 prm = kzalloc(sizeof(*prm), GFP_ATOMIC); in qlt_sched_sess_work()
1688 if (!prm) { in qlt_sched_sess_work()
1698 type, prm, param, param_size, tgt); in qlt_sched_sess_work()
1700 prm->type = type; in qlt_sched_sess_work()
1701 memcpy(&prm->tm_iocb, param, param_size); in qlt_sched_sess_work()
1704 list_add_tail(&prm->sess_works_list_entry, &tgt->sess_works_list); in qlt_sched_sess_work()
2451 static int qlt_pci_map_calc_cnt(struct qla_tgt_prm *prm) in qlt_pci_map_calc_cnt() argument
2453 struct qla_tgt_cmd *cmd = prm->cmd; in qlt_pci_map_calc_cnt()
2457 prm->sg = (struct scatterlist *)cmd->sg; in qlt_pci_map_calc_cnt()
2458 prm->seg_cnt = dma_map_sg(&cmd->qpair->pdev->dev, cmd->sg, in qlt_pci_map_calc_cnt()
2460 if (unlikely(prm->seg_cnt == 0)) in qlt_pci_map_calc_cnt()
2463 prm->cmd->sg_mapped = 1; in qlt_pci_map_calc_cnt()
2470 if (prm->seg_cnt > QLA_TGT_DATASEGS_PER_CMD_24XX) in qlt_pci_map_calc_cnt()
2471 prm->req_cnt += DIV_ROUND_UP(prm->seg_cnt - in qlt_pci_map_calc_cnt()
2478 prm->seg_cnt = DIV_ROUND_UP(cmd->bufflen, cmd->blk_sz); in qlt_pci_map_calc_cnt()
2479 prm->tot_dsds = prm->seg_cnt; in qlt_pci_map_calc_cnt()
2481 prm->tot_dsds = prm->seg_cnt; in qlt_pci_map_calc_cnt()
2484 prm->prot_sg = cmd->prot_sg; in qlt_pci_map_calc_cnt()
2485 prm->prot_seg_cnt = dma_map_sg(&cmd->qpair->pdev->dev, in qlt_pci_map_calc_cnt()
2488 if (unlikely(prm->prot_seg_cnt == 0)) in qlt_pci_map_calc_cnt()
2494 prm->prot_seg_cnt = DIV_ROUND_UP(cmd->bufflen, in qlt_pci_map_calc_cnt()
2496 prm->tot_dsds += prm->prot_seg_cnt; in qlt_pci_map_calc_cnt()
2498 prm->tot_dsds += prm->prot_seg_cnt; in qlt_pci_map_calc_cnt()
2505 ql_dbg_qp(ql_dbg_tgt, prm->cmd->qpair, 0xe04d, in qlt_pci_map_calc_cnt()
2507 0, prm->cmd->sg_cnt); in qlt_pci_map_calc_cnt()
2616 struct qla_tgt_prm *prm) in qlt_24xx_build_ctio_pkt() argument
2620 struct atio_from_isp *atio = &prm->cmd->atio; in qlt_24xx_build_ctio_pkt()
2622 struct qla_tgt_cmd *cmd = prm->cmd; in qlt_24xx_build_ctio_pkt()
2625 prm->pkt = pkt; in qlt_24xx_build_ctio_pkt()
2629 pkt->entry_count = (uint8_t)prm->req_cnt; in qlt_24xx_build_ctio_pkt()
2630 pkt->vp_index = prm->cmd->vp_idx; in qlt_24xx_build_ctio_pkt()
2641 qpair->req->outstanding_cmds[h] = (srb_t *)prm->cmd; in qlt_24xx_build_ctio_pkt()
2645 pkt->nport_handle = cpu_to_le16(prm->cmd->loop_id); in qlt_24xx_build_ctio_pkt()
2653 pkt->u.status0.relative_offset = cpu_to_le32(prm->cmd->offset); in qlt_24xx_build_ctio_pkt()
2657 prm->cmd->sess->edif.rx_bytes += cmd->bufflen; in qlt_24xx_build_ctio_pkt()
2659 prm->cmd->sess->edif.tx_bytes += cmd->bufflen; in qlt_24xx_build_ctio_pkt()
2671 static void qlt_load_cont_data_segments(struct qla_tgt_prm *prm) in qlt_load_cont_data_segments() argument
2677 while (prm->seg_cnt > 0) { in qlt_load_cont_data_segments()
2680 prm->cmd->qpair->req); in qlt_load_cont_data_segments()
2699 cnt < QLA_TGT_DATASEGS_PER_CONT_24XX && prm->seg_cnt; in qlt_load_cont_data_segments()
2700 cnt++, prm->seg_cnt--) { in qlt_load_cont_data_segments()
2701 append_dsd64(&cur_dsd, prm->sg); in qlt_load_cont_data_segments()
2702 prm->sg = sg_next(prm->sg); in qlt_load_cont_data_segments()
2711 static void qlt_load_data_segments(struct qla_tgt_prm *prm) in qlt_load_data_segments() argument
2715 struct ctio7_to_24xx *pkt24 = (struct ctio7_to_24xx *)prm->pkt; in qlt_load_data_segments()
2717 pkt24->u.status0.transfer_length = cpu_to_le32(prm->cmd->bufflen); in qlt_load_data_segments()
2723 if (prm->seg_cnt) in qlt_load_data_segments()
2724 pkt24->dseg_count = cpu_to_le16(prm->seg_cnt); in qlt_load_data_segments()
2726 if (prm->seg_cnt == 0) { in qlt_load_data_segments()
2737 (cnt < QLA_TGT_DATASEGS_PER_CMD_24XX) && prm->seg_cnt; in qlt_load_data_segments()
2738 cnt++, prm->seg_cnt--) { in qlt_load_data_segments()
2739 append_dsd64(&cur_dsd, prm->sg); in qlt_load_data_segments()
2740 prm->sg = sg_next(prm->sg); in qlt_load_data_segments()
2743 qlt_load_cont_data_segments(prm); in qlt_load_data_segments()
2751 static void qlt_print_dif_err(struct qla_tgt_prm *prm) in qlt_print_dif_err() argument
2757 if (prm->sense_buffer && (prm->sense_buffer[12] == 0x10)) { in qlt_print_dif_err()
2758 cmd = prm->cmd; in qlt_print_dif_err()
2761 switch (prm->sense_buffer[13]) { in qlt_print_dif_err()
2799 struct qla_tgt_prm *prm, int xmit_type, uint8_t scsi_status, in qlt_pre_xmit_response() argument
2805 prm->cmd = cmd; in qlt_pre_xmit_response()
2806 prm->tgt = cmd->tgt; in qlt_pre_xmit_response()
2807 prm->pkt = NULL; in qlt_pre_xmit_response()
2808 prm->rq_result = scsi_status; in qlt_pre_xmit_response()
2809 prm->sense_buffer = &cmd->sense_buffer[0]; in qlt_pre_xmit_response()
2810 prm->sense_buffer_len = TRANSPORT_SENSE_BUFFER; in qlt_pre_xmit_response()
2811 prm->sg = NULL; in qlt_pre_xmit_response()
2812 prm->seg_cnt = -1; in qlt_pre_xmit_response()
2813 prm->req_cnt = 1; in qlt_pre_xmit_response()
2814 prm->residual = 0; in qlt_pre_xmit_response()
2815 prm->add_status_pkt = 0; in qlt_pre_xmit_response()
2816 prm->prot_sg = NULL; in qlt_pre_xmit_response()
2817 prm->prot_seg_cnt = 0; in qlt_pre_xmit_response()
2818 prm->tot_dsds = 0; in qlt_pre_xmit_response()
2821 if (qlt_pci_map_calc_cnt(prm) != 0) in qlt_pre_xmit_response()
2825 *full_req_cnt = prm->req_cnt; in qlt_pre_xmit_response()
2828 prm->residual = se_cmd->residual_count; in qlt_pre_xmit_response()
2831 prm->residual, se_cmd->tag, in qlt_pre_xmit_response()
2833 cmd->bufflen, prm->rq_result); in qlt_pre_xmit_response()
2834 prm->rq_result |= SS_RESIDUAL_UNDER; in qlt_pre_xmit_response()
2836 prm->residual = se_cmd->residual_count; in qlt_pre_xmit_response()
2839 prm->residual, se_cmd->tag, se_cmd->t_task_cdb ? in qlt_pre_xmit_response()
2840 se_cmd->t_task_cdb[0] : 0, cmd->bufflen, prm->rq_result); in qlt_pre_xmit_response()
2841 prm->rq_result |= SS_RESIDUAL_OVER; in qlt_pre_xmit_response()
2850 if (QLA_TGT_SENSE_VALID(prm->sense_buffer) || in qlt_pre_xmit_response()
2852 (prm->rq_result != 0))) { in qlt_pre_xmit_response()
2853 prm->add_status_pkt = 1; in qlt_pre_xmit_response()
2876 struct qla_tgt_prm *prm) in qlt_24xx_init_ctio_to_isp() argument
2878 prm->sense_buffer_len = min_t(uint32_t, prm->sense_buffer_len, in qlt_24xx_init_ctio_to_isp()
2881 if (qlt_need_explicit_conf(prm->cmd, 0)) { in qlt_24xx_init_ctio_to_isp()
2886 ctio->u.status0.residual = cpu_to_le32(prm->residual); in qlt_24xx_init_ctio_to_isp()
2887 ctio->u.status0.scsi_status = cpu_to_le16(prm->rq_result); in qlt_24xx_init_ctio_to_isp()
2888 if (QLA_TGT_SENSE_VALID(prm->sense_buffer)) { in qlt_24xx_init_ctio_to_isp()
2891 if (qlt_need_explicit_conf(prm->cmd, 1)) { in qlt_24xx_init_ctio_to_isp()
2892 if ((prm->rq_result & SS_SCSI_STATUS_BYTE) != 0) { in qlt_24xx_init_ctio_to_isp()
2893 ql_dbg_qp(ql_dbg_tgt, prm->cmd->qpair, 0xe017, in qlt_24xx_init_ctio_to_isp()
2911 cpu_to_le16(prm->sense_buffer_len); in qlt_24xx_init_ctio_to_isp()
2912 for (i = 0; i < prm->sense_buffer_len/4; i++) { in qlt_24xx_init_ctio_to_isp()
2916 &((uint32_t *)prm->sense_buffer)[i]); in qlt_24xx_init_ctio_to_isp()
2920 qlt_print_dif_err(prm); in qlt_24xx_init_ctio_to_isp()
3065 qlt_build_ctio_crc2_pkt(struct qla_qpair *qpair, struct qla_tgt_prm *prm) in qlt_build_ctio_crc2_pkt() argument
3077 struct qla_tgt_cmd *cmd = prm->cmd; in qlt_build_ctio_crc2_pkt()
3080 struct atio_from_isp *atio = &prm->cmd->atio; in qlt_build_ctio_crc2_pkt()
3088 prm->pkt = pkt; in qlt_build_ctio_crc2_pkt()
3094 prm->prot_sg, prm->prot_seg_cnt, se_cmd->t_task_lba); in qlt_build_ctio_crc2_pkt()
3167 qpair->req->outstanding_cmds[h] = (srb_t *)prm->cmd; in qlt_build_ctio_crc2_pkt()
3171 pkt->nport_handle = cpu_to_le16(prm->cmd->loop_id); in qlt_build_ctio_crc2_pkt()
3182 pkt->relative_offset = cpu_to_le32(prm->cmd->offset); in qlt_build_ctio_crc2_pkt()
3190 pkt->dseg_count = cpu_to_le16(prm->tot_dsds); in qlt_build_ctio_crc2_pkt()
3224 cpu_to_le16(prm->tot_dsds - prm->prot_seg_cnt); in qlt_build_ctio_crc2_pkt()
3246 if (!bundling && prm->prot_seg_cnt) { in qlt_build_ctio_crc2_pkt()
3248 prm->tot_dsds, &tc)) in qlt_build_ctio_crc2_pkt()
3251 (prm->tot_dsds - prm->prot_seg_cnt), &tc)) in qlt_build_ctio_crc2_pkt()
3254 if (bundling && prm->prot_seg_cnt) { in qlt_build_ctio_crc2_pkt()
3260 prm->prot_seg_cnt, cmd)) in qlt_build_ctio_crc2_pkt()
3282 struct qla_tgt_prm prm; in qlt_xmit_response() local
3299 res = qlt_pre_xmit_response(cmd, &prm, xmit_type, scsi_status, in qlt_xmit_response()
3331 res = qlt_build_ctio_crc2_pkt(qpair, &prm); in qlt_xmit_response()
3333 res = qlt_24xx_build_ctio_pkt(qpair, &prm); in qlt_xmit_response()
3339 pkt = (struct ctio7_to_24xx *)prm.pkt; in qlt_xmit_response()
3347 qlt_load_data_segments(&prm); in qlt_xmit_response()
3349 if (prm.add_status_pkt == 0) { in qlt_xmit_response()
3352 cpu_to_le16(prm.rq_result); in qlt_xmit_response()
3355 cpu_to_le32(prm.residual); in qlt_xmit_response()
3403 &prm); in qlt_xmit_response()
3406 qlt_24xx_init_ctio_to_isp(pkt, &prm); in qlt_xmit_response()
3436 struct qla_tgt_prm prm; in qlt_rdy_to_xfer() local
3441 memset(&prm, 0, sizeof(prm)); in qlt_rdy_to_xfer()
3442 prm.cmd = cmd; in qlt_rdy_to_xfer()
3443 prm.tgt = tgt; in qlt_rdy_to_xfer()
3444 prm.sg = NULL; in qlt_rdy_to_xfer()
3445 prm.req_cnt = 1; in qlt_rdy_to_xfer()
3465 if (qlt_pci_map_calc_cnt(&prm) != 0) in qlt_rdy_to_xfer()
3470 res = qlt_check_reserve_free_req(qpair, prm.req_cnt); in qlt_rdy_to_xfer()
3474 res = qlt_build_ctio_crc2_pkt(qpair, &prm); in qlt_rdy_to_xfer()
3476 res = qlt_24xx_build_ctio_pkt(qpair, &prm); in qlt_rdy_to_xfer()
3479 qpair->req->cnt += prm.req_cnt; in qlt_rdy_to_xfer()
3483 pkt = (struct ctio7_to_24xx *)prm.pkt; in qlt_rdy_to_xfer()
3488 qlt_load_data_segments(&prm); in qlt_rdy_to_xfer()
6300 struct qla_tgt_sess_work_param *prm) in qlt_abort_work() argument
6314 s_id = le_id_to_be(prm->abts.fcp_hdr_le.s_id); in qlt_abort_work()
6341 rc = __qlt_24xx_handle_abts(vha, &prm->abts, sess); in qlt_abort_work()
6355 qlt_24xx_send_abts_resp(ha->base_qpair, &prm->abts, in qlt_abort_work()
6361 struct qla_tgt_sess_work_param *prm) in qlt_tmr_work() argument
6363 struct atio_from_isp *a = &prm->tm_iocb2; in qlt_tmr_work()
6379 s_id = prm->tm_iocb2.u.isp24.fcp_hdr.s_id; in qlt_tmr_work()
6420 qlt_send_term_exchange(ha->base_qpair, NULL, &prm->tm_iocb2, 1, 0); in qlt_tmr_work()
6433 struct qla_tgt_sess_work_param *prm = list_entry( in qlt_sess_work_fn() local
6434 tgt->sess_works_list.next, typeof(*prm), in qlt_sess_work_fn()
6441 list_del(&prm->sess_works_list_entry); in qlt_sess_work_fn()
6445 switch (prm->type) { in qlt_sess_work_fn()
6447 qlt_abort_work(tgt, prm); in qlt_sess_work_fn()
6450 qlt_tmr_work(tgt, prm); in qlt_sess_work_fn()
6459 kfree(prm); in qlt_sess_work_fn()