Lines Matching refs:ocp

290 	struct efct_scsi_tgt_io *ocp =  in efct_lio_check_stop_free()  local
292 struct efct_io *io = container_of(ocp, struct efct_io, tgt_io); in efct_lio_check_stop_free()
310 struct efct_scsi_tgt_io *ocp = in efct_lio_aborted_task() local
312 struct efct_io *io = container_of(ocp, struct efct_io, tgt_io); in efct_lio_aborted_task()
316 if (ocp->rsp_sent) in efct_lio_aborted_task()
320 ocp->aborting = true; in efct_lio_aborted_task()
321 ocp->err = EFCT_SCSI_STATUS_ABORTED; in efct_lio_aborted_task()
328 struct efct_scsi_tgt_io *ocp = in efct_lio_release_cmd() local
330 struct efct_io *io = container_of(ocp, struct efct_io, tgt_io); in efct_lio_release_cmd()
355 struct efct_scsi_tgt_io *ocp = in efct_lio_get_cmd_state() local
357 struct efct_io *io = container_of(ocp, struct efct_io, tgt_io); in efct_lio_get_cmd_state()
365 struct efct_scsi_tgt_io *ocp = &io->tgt_io; in efct_lio_sg_map() local
366 struct se_cmd *cmd = &ocp->cmd; in efct_lio_sg_map()
368 ocp->seg_map_cnt = dma_map_sg(&io->efct->pci->dev, cmd->t_data_sg, in efct_lio_sg_map()
370 if (ocp->seg_map_cnt == 0) in efct_lio_sg_map()
378 struct efct_scsi_tgt_io *ocp = &io->tgt_io; in efct_lio_sg_unmap() local
379 struct se_cmd *cmd = &ocp->cmd; in efct_lio_sg_unmap()
381 if (WARN_ON(!ocp->seg_map_cnt || !cmd->t_data_sg)) in efct_lio_sg_unmap()
385 ocp->seg_map_cnt, cmd->data_direction); in efct_lio_sg_unmap()
386 ocp->seg_map_cnt = 0; in efct_lio_sg_unmap()
394 struct efct_scsi_tgt_io *ocp = &io->tgt_io; in efct_lio_status_done() local
400 ocp->err = scsi_status; in efct_lio_status_done()
402 if (ocp->seg_map_cnt) in efct_lio_status_done()
406 scsi_status, ocp->err, flags, ocp->ddir); in efct_lio_status_done()
420 struct efct_scsi_tgt_io *ocp = in efct_lio_write_pending() local
422 struct efct_io *io = container_of(ocp, struct efct_io, tgt_io); in efct_lio_write_pending()
432 if (ocp->seg_cnt == 0) { in efct_lio_write_pending()
433 ocp->seg_cnt = cmd->t_data_nents; in efct_lio_write_pending()
434 ocp->cur_seg = 0; in efct_lio_write_pending()
440 curcnt = (ocp->seg_map_cnt - ocp->cur_seg); in efct_lio_write_pending()
443 for (cnt = 0, sg = cmd->t_data_sg; cnt < ocp->cur_seg; cnt++, in efct_lio_write_pending()
452 ocp->cur_seg++; in efct_lio_write_pending()
455 if (ocp->cur_seg == ocp->seg_cnt) in efct_lio_write_pending()
465 struct efct_scsi_tgt_io *ocp = in efct_lio_queue_data_in() local
467 struct efct_io *io = container_of(ocp, struct efct_io, tgt_io); in efct_lio_queue_data_in()
475 if (ocp->seg_cnt == 0) { in efct_lio_queue_data_in()
477 ocp->seg_cnt = cmd->t_data_nents; in efct_lio_queue_data_in()
478 ocp->cur_seg = 0; in efct_lio_queue_data_in()
496 curcnt = min(ocp->seg_map_cnt - ocp->cur_seg, io->sgl_allocated); in efct_lio_queue_data_in()
499 sg = &cmd->t_data_sg[ocp->cur_seg]; in efct_lio_queue_data_in()
502 if (ocp->transferred_len + sg_dma_len(sg) >= cmd->data_length) in efct_lio_queue_data_in()
503 sgl[cnt].len = cmd->data_length - ocp->transferred_len; in efct_lio_queue_data_in()
507 ocp->transferred_len += sgl[cnt].len; in efct_lio_queue_data_in()
509 ocp->cur_seg++; in efct_lio_queue_data_in()
511 if (ocp->transferred_len == cmd->data_length) in efct_lio_queue_data_in()
515 if (ocp->transferred_len == cmd->data_length) { in efct_lio_queue_data_in()
517 ocp->seg_cnt = ocp->cur_seg; in efct_lio_queue_data_in()
535 struct efct_scsi_tgt_io *ocp = &io->tgt_io; in efct_lio_send_resp() local
540 ocp->rsp_sent = true; in efct_lio_send_resp()
565 ocp->rsp_sent = true; in efct_lio_send_resp()
573 struct efct_scsi_tgt_io *ocp = &io->tgt_io; in efct_lio_datamove_done() local
579 ocp->err = scsi_status; in efct_lio_datamove_done()
581 efct_lio_io_printf(io, "seg_map_cnt=%d\n", ocp->seg_map_cnt); in efct_lio_datamove_done()
582 if (ocp->seg_map_cnt) { in efct_lio_datamove_done()
583 if (ocp->err == EFCT_SCSI_STATUS_GOOD && in efct_lio_datamove_done()
584 ocp->cur_seg < ocp->seg_cnt) { in efct_lio_datamove_done()
588 ocp->cur_seg); in efct_lio_datamove_done()
589 if (ocp->ddir == DMA_TO_DEVICE) in efct_lio_datamove_done()
590 rc = efct_lio_write_pending(&ocp->cmd); in efct_lio_datamove_done()
592 rc = efct_lio_queue_data_in(&ocp->cmd); in efct_lio_datamove_done()
596 ocp->err = EFCT_SCSI_STATUS_ERROR; in efct_lio_datamove_done()
607 if (ocp->ddir == DMA_TO_DEVICE) { in efct_lio_datamove_done()
655 struct efct_scsi_tgt_io *ocp = in efct_lio_queue_status() local
657 struct efct_io *io = container_of(ocp, struct efct_io, tgt_io); in efct_lio_queue_status()
682 ocp->rsp_sent = true; in efct_lio_queue_status()
688 struct efct_scsi_tgt_io *ocp = in efct_lio_queue_tm_rsp() local
690 struct efct_io *tmfio = container_of(ocp, struct efct_io, tgt_io); in efct_lio_queue_tm_rsp()
1323 struct efct_scsi_tgt_io *ocp = &io->tgt_io; in efct_scsi_recv_cmd() local
1331 memset(ocp, 0, sizeof(struct efct_scsi_tgt_io)); in efct_scsi_recv_cmd()
1339 ocp->task_attr = TCM_SIMPLE_TAG; in efct_scsi_recv_cmd()
1341 ocp->task_attr = TCM_HEAD_TAG; in efct_scsi_recv_cmd()
1343 ocp->task_attr = TCM_ORDERED_TAG; in efct_scsi_recv_cmd()
1345 ocp->task_attr = TCM_ACA_TAG; in efct_scsi_recv_cmd()
1350 ocp->ddir = DMA_TO_DEVICE; in efct_scsi_recv_cmd()
1354 ocp->ddir = DMA_FROM_DEVICE; in efct_scsi_recv_cmd()
1358 ocp->ddir = DMA_BIDIRECTIONAL; in efct_scsi_recv_cmd()
1362 ocp->ddir = DMA_NONE; in efct_scsi_recv_cmd()
1366 ocp->lun = lun; in efct_scsi_recv_cmd()
1374 &ocp->cmd); in efct_scsi_recv_cmd()
1381 ocp->lun, io->exp_xfer_len, ocp->task_attr, in efct_scsi_recv_cmd()
1382 ocp->ddir, TARGET_SCF_ACK_KREF); in efct_scsi_recv_cmd()
1402 struct efct_scsi_tgt_io *ocp = &tmfio->tgt_io; in efct_scsi_recv_tmf() local
1407 memset(ocp, 0, sizeof(struct efct_scsi_tgt_io)); in efct_scsi_recv_tmf()
1448 rc = target_submit_tmr(&ocp->cmd, se_sess, NULL, lun, ocp, tmr_func, in efct_scsi_recv_tmf()