Lines Matching full:wr
193 * csio_scsi_init_cmd_wr - Initialize the SCSI CMD WR.
196 * @size: Size of WR (including FW WR + immed data + rsp SG entry
205 struct fw_scsi_cmd_wr *wr = (struct fw_scsi_cmd_wr *)addr; in csio_scsi_init_cmd_wr() local
209 wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_CMD_WR) | in csio_scsi_init_cmd_wr()
211 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) | in csio_scsi_init_cmd_wr()
215 wr->cookie = (uintptr_t) req; in csio_scsi_init_cmd_wr()
216 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); in csio_scsi_init_cmd_wr()
217 wr->tmo_val = (uint8_t) req->tmo; in csio_scsi_init_cmd_wr()
218 wr->r3 = 0; in csio_scsi_init_cmd_wr()
219 memset(&wr->r5, 0, 8); in csio_scsi_init_cmd_wr()
225 wr->rsp_dmalen = cpu_to_be32(dma_buf->len); in csio_scsi_init_cmd_wr()
226 wr->rsp_dmaaddr = cpu_to_be64(dma_buf->paddr); in csio_scsi_init_cmd_wr()
228 wr->r6 = 0; in csio_scsi_init_cmd_wr()
230 wr->u.fcoe.ctl_pri = 0; in csio_scsi_init_cmd_wr()
231 wr->u.fcoe.cp_en_class = 0; in csio_scsi_init_cmd_wr()
232 wr->u.fcoe.r4_lo[0] = 0; in csio_scsi_init_cmd_wr()
233 wr->u.fcoe.r4_lo[1] = 0; in csio_scsi_init_cmd_wr()
241 (sizeof(struct fw_scsi_cmd_wr) + /* WR size */ \
248 * csio_scsi_cmd - Create a SCSI CMD WR.
251 * Gets a WR slot in the ingress queue and initializes it with SCSI CMD WR.
267 /* Initialize WR in one shot */ in csio_scsi_cmd()
273 * Make a temporary copy of the WR and write back in csio_scsi_cmd()
274 * the copy into the WR pair. in csio_scsi_cmd()
352 * csio_scsi_init_read_wr - Initialize the READ SCSI WR.
355 * @size: Size of WR (including FW WR + immed data + rsp SG entry + data SGL
364 struct fw_scsi_read_wr *wr = (struct fw_scsi_read_wr *)wrp; in csio_scsi_init_read_wr() local
370 wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_READ_WR) | in csio_scsi_init_read_wr()
372 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) | in csio_scsi_init_read_wr()
374 wr->cookie = (uintptr_t)req; in csio_scsi_init_read_wr()
375 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); in csio_scsi_init_read_wr()
376 wr->tmo_val = (uint8_t)(req->tmo); in csio_scsi_init_read_wr()
377 wr->use_xfer_cnt = 1; in csio_scsi_init_read_wr()
378 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); in csio_scsi_init_read_wr()
379 wr->ini_xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); in csio_scsi_init_read_wr()
384 wr->rsp_dmalen = cpu_to_be32(dma_buf->len); in csio_scsi_init_read_wr()
385 wr->rsp_dmaaddr = cpu_to_be64(dma_buf->paddr); in csio_scsi_init_read_wr()
387 wr->r4 = 0; in csio_scsi_init_read_wr()
389 wr->u.fcoe.ctl_pri = 0; in csio_scsi_init_read_wr()
390 wr->u.fcoe.cp_en_class = 0; in csio_scsi_init_read_wr()
391 wr->u.fcoe.r3_lo[0] = 0; in csio_scsi_init_read_wr()
392 wr->u.fcoe.r3_lo[1] = 0; in csio_scsi_init_read_wr()
396 /* Move WR pointer past command and immediate data */ in csio_scsi_init_read_wr()
405 * csio_scsi_init_write_wr - Initialize the WRITE SCSI WR.
408 * @size: Size of WR (including FW WR + immed data + rsp SG entry + data SGL
417 struct fw_scsi_write_wr *wr = (struct fw_scsi_write_wr *)wrp; in csio_scsi_init_write_wr() local
423 wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_WRITE_WR) | in csio_scsi_init_write_wr()
425 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) | in csio_scsi_init_write_wr()
427 wr->cookie = (uintptr_t)req; in csio_scsi_init_write_wr()
428 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); in csio_scsi_init_write_wr()
429 wr->tmo_val = (uint8_t)(req->tmo); in csio_scsi_init_write_wr()
430 wr->use_xfer_cnt = 1; in csio_scsi_init_write_wr()
431 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); in csio_scsi_init_write_wr()
432 wr->ini_xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); in csio_scsi_init_write_wr()
437 wr->rsp_dmalen = cpu_to_be32(dma_buf->len); in csio_scsi_init_write_wr()
438 wr->rsp_dmaaddr = cpu_to_be64(dma_buf->paddr); in csio_scsi_init_write_wr()
440 wr->r4 = 0; in csio_scsi_init_write_wr()
442 wr->u.fcoe.ctl_pri = 0; in csio_scsi_init_write_wr()
443 wr->u.fcoe.cp_en_class = 0; in csio_scsi_init_write_wr()
444 wr->u.fcoe.r3_lo[0] = 0; in csio_scsi_init_write_wr()
445 wr->u.fcoe.r3_lo[1] = 0; in csio_scsi_init_write_wr()
449 /* Move WR pointer past command and immediate data */ in csio_scsi_init_write_wr()
457 /* Calculate WR size needed for fw_scsi_read_wr/fw_scsi_write_wr */
460 (sz) = sizeof(struct fw_scsi_##oper##_wr) + /* WR size */ \
471 * csio_scsi_read - Create a SCSI READ WR.
474 * Gets a WR slot in the ingress queue and initializes it with
475 * SCSI READ WR.
492 /* Initialize WR in one shot */ in csio_scsi_read()
497 * Make a temporary copy of the WR and write back in csio_scsi_read()
498 * the copy into the WR pair. in csio_scsi_read()
508 * csio_scsi_write - Create a SCSI WRITE WR.
511 * Gets a WR slot in the ingress queue and initializes it with
512 * SCSI WRITE WR.
529 /* Initialize WR in one shot */ in csio_scsi_write()
534 * Make a temporary copy of the WR and write back in csio_scsi_write()
535 * the copy into the WR pair. in csio_scsi_write()
549 * If contiguous,driver posts SGLs in the WR otherwise post internal
637 * csio_scsi_init_abrt_cls_wr - Initialize an ABORT/CLOSE WR.
640 * @size: Size of WR
651 struct fw_scsi_abrt_cls_wr *wr = (struct fw_scsi_abrt_cls_wr *)addr; in csio_scsi_init_abrt_cls_wr() local
653 wr->op_immdlen = cpu_to_be32(FW_WR_OP_V(FW_SCSI_ABRT_CLS_WR)); in csio_scsi_init_abrt_cls_wr()
654 wr->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(rn->flowid) | in csio_scsi_init_abrt_cls_wr()
658 wr->cookie = (uintptr_t) req; in csio_scsi_init_abrt_cls_wr()
659 wr->iqid = cpu_to_be16(csio_q_physiqid(hw, req->iq_idx)); in csio_scsi_init_abrt_cls_wr()
660 wr->tmo_val = (uint8_t) req->tmo; in csio_scsi_init_abrt_cls_wr()
662 wr->sub_opcode_to_chk_all_io = in csio_scsi_init_abrt_cls_wr()
665 wr->r3[0] = 0; in csio_scsi_init_abrt_cls_wr()
666 wr->r3[1] = 0; in csio_scsi_init_abrt_cls_wr()
667 wr->r3[2] = 0; in csio_scsi_init_abrt_cls_wr()
668 wr->r3[3] = 0; in csio_scsi_init_abrt_cls_wr()
670 wr->t_cookie = (uintptr_t) req; in csio_scsi_init_abrt_cls_wr()
685 /* Initialize WR in one shot */ in csio_scsi_abrt_cls()
690 * Make a temporary copy of the WR and write back in csio_scsi_abrt_cls()
691 * the copy into the WR pair. in csio_scsi_abrt_cls()
919 * Check if original I/O WR completed before the Abort in csio_scsis_aborting()
971 * cleanup paths, if the FW forgot to reply to the ABORT WR in csio_scsis_aborting()
1009 * Check if original I/O WR completed before the Close in csio_scsis_closing()
1083 * csio_scsi_cmpl_handler - WR completion handler for SCSI.
1085 * @wr: The completed WR from the ingress queue.
1086 * @len: Length of the WR.
1089 * @scsiwr: Pointer to SCSI WR.
1091 * This is the WR completion handler called per completion from the
1093 * header where the actual WR is present.
1094 * It then gets the status, WR handle (ioreq pointer) and the len of
1095 * the WR, based on WR opcode. Only on a non-good status is the entire
1096 * WR copied into the WR cache (ioreq->fw_wr).
1097 * The ioreq corresponding to the WR is returned to the caller.
1102 csio_scsi_cmpl_handler(struct csio_hw *hw, void *wr, uint32_t len, in csio_scsi_cmpl_handler() argument
1112 cpl = (struct cpl_fw6_msg *)((uintptr_t)wr + sizeof(__be64)); in csio_scsi_cmpl_handler()
1146 csio_warn(hw, "WR with invalid opcode in SCSI IQ: %x\n", *tempwr); in csio_scsi_cmpl_handler()
1710 csio_err(hw, "Unknown SCSI FW WR status:%d req:%p cmnd:%p\n", in csio_scsi_err_handler()