Lines Matching full:io

15 #define scsi_io_printf(io, fmt, ...) \  argument
16 efc_log_debug(io->efct, "[%s]" SCSI_IOFMT fmt, \
17 io->node->display_name, io->instance_index,\
18 io->init_task_tag, io->tgt_task_tag, io->hw_tag, ##__VA_ARGS__)
23 #define scsi_io_trace(io, fmt, ...) \ argument
25 if (EFCT_LOG_ENABLE_SCSI_TRACE(io->efct)) \
26 scsi_io_printf(io, fmt, ##__VA_ARGS__); \
34 struct efct_io *io; in efct_scsi_io_alloc() local
41 io = efct_io_pool_io_alloc(efct->xport->io_pool); in efct_scsi_io_alloc()
42 if (!io) { in efct_scsi_io_alloc()
43 efc_log_err(efct, "IO alloc Failed\n"); in efct_scsi_io_alloc()
49 kref_init(&io->ref); in efct_scsi_io_alloc()
50 io->release = _efct_scsi_io_free; in efct_scsi_io_alloc()
53 io->efct = efct; in efct_scsi_io_alloc()
54 io->node = node; in efct_scsi_io_alloc()
58 io->io_type = EFCT_IO_TYPE_IO; in efct_scsi_io_alloc()
59 io->display_name = "scsi_io"; in efct_scsi_io_alloc()
61 io->cmd_ini = false; in efct_scsi_io_alloc()
62 io->cmd_tgt = true; in efct_scsi_io_alloc()
65 INIT_LIST_HEAD(&io->list_entry); in efct_scsi_io_alloc()
67 list_add(&io->list_entry, &node->active_ios); in efct_scsi_io_alloc()
71 return io; in efct_scsi_io_alloc()
77 struct efct_io *io = container_of(arg, struct efct_io, ref); in _efct_scsi_io_free() local
78 struct efct *efct = io->efct; in _efct_scsi_io_free()
79 struct efct_node *node = io->node; in _efct_scsi_io_free()
82 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in _efct_scsi_io_free()
84 if (io->io_free) { in _efct_scsi_io_free()
85 efc_log_err(efct, "IO already freed.\n"); in _efct_scsi_io_free()
90 list_del_init(&io->list_entry); in _efct_scsi_io_free()
94 io->node = NULL; in _efct_scsi_io_free()
95 efct_io_pool_io_free(efct->xport->io_pool, io); in _efct_scsi_io_free()
99 efct_scsi_io_free(struct efct_io *io) in efct_scsi_io_free() argument
101 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in efct_scsi_io_free()
102 WARN_ON(!refcount_read(&io->ref.refcount)); in efct_scsi_io_free()
103 kref_put(&io->ref, io->release); in efct_scsi_io_free()
111 struct efct_io *io = app; in efct_target_io_cb() local
116 if (!io || !io->efct) { in efct_target_io_cb()
117 pr_err("%s: IO can not be NULL\n", __func__); in efct_target_io_cb()
121 scsi_io_trace(io, "status x%x ext_status x%x\n", status, ext_status); in efct_target_io_cb()
123 efct = io->efct; in efct_target_io_cb()
125 io->transferred += length; in efct_target_io_cb()
127 if (!io->scsi_tgt_cb) { in efct_target_io_cb()
133 cb = io->scsi_tgt_cb; in efct_target_io_cb()
136 io->scsi_tgt_cb = NULL; in efct_target_io_cb()
142 if (status == 0 && io->auto_resp) in efct_target_io_cb()
181 /* target IO timed out */ in efct_target_io_cb()
186 /* Target IO cancelled by HW */ in efct_target_io_cb()
195 cb(io, scsi_stat, flags, io->scsi_tgt_cb_arg); in efct_target_io_cb()
229 static void efc_log_sgl(struct efct_io *io) in efc_log_sgl() argument
231 struct efct_hw_io *hio = io->hio; in efc_log_sgl()
237 scsi_io_trace(io, "def_sgl at 0x%x 0x%08x\n", in efc_log_sgl()
244 scsi_io_trace(io, "SGL %2d 0x%08x 0x%08x 0x%08x 0x%08x\n", in efc_log_sgl()
256 struct efct_io *io = arg; in efct_scsi_check_pending_async_cb() local
258 if (io) { in efct_scsi_check_pending_async_cb()
259 efct_hw_done_t cb = io->hw_cb; in efct_scsi_check_pending_async_cb()
261 if (!io->hw_cb) in efct_scsi_check_pending_async_cb()
264 io->hw_cb = NULL; in efct_scsi_check_pending_async_cb()
265 (cb)(io->hio, 0, SLI4_FC_WCQE_STATUS_DISPATCH_ERROR, 0, io); in efct_scsi_check_pending_async_cb()
270 efct_scsi_io_dispatch_hw_io(struct efct_io *io, struct efct_hw_io *hio) in efct_scsi_io_dispatch_hw_io() argument
273 struct efct *efct = io->efct; in efct_scsi_io_dispatch_hw_io()
275 /* Got a HW IO; in efct_scsi_io_dispatch_hw_io()
276 * update ini/tgt_task_tag with HW IO info and dispatch in efct_scsi_io_dispatch_hw_io()
278 io->hio = hio; in efct_scsi_io_dispatch_hw_io()
279 if (io->cmd_tgt) in efct_scsi_io_dispatch_hw_io()
280 io->tgt_task_tag = hio->indicator; in efct_scsi_io_dispatch_hw_io()
281 else if (io->cmd_ini) in efct_scsi_io_dispatch_hw_io()
282 io->init_task_tag = hio->indicator; in efct_scsi_io_dispatch_hw_io()
283 io->hw_tag = hio->reqtag; in efct_scsi_io_dispatch_hw_io()
285 hio->eq = io->hw_priv; in efct_scsi_io_dispatch_hw_io()
288 switch (io->wq_steering) { in efct_scsi_io_dispatch_hw_io()
300 switch (io->io_type) { in efct_scsi_io_dispatch_hw_io()
302 rc = efct_scsi_build_sgls(&efct->hw, io->hio, in efct_scsi_io_dispatch_hw_io()
303 io->sgl, io->sgl_count, io->hio_type); in efct_scsi_io_dispatch_hw_io()
308 efc_log_sgl(io); in efct_scsi_io_dispatch_hw_io()
310 if (io->app_id) in efct_scsi_io_dispatch_hw_io()
311 io->iparam.fcp_tgt.app_id = io->app_id; in efct_scsi_io_dispatch_hw_io()
313 io->iparam.fcp_tgt.vpi = io->node->vpi; in efct_scsi_io_dispatch_hw_io()
314 io->iparam.fcp_tgt.rpi = io->node->rpi; in efct_scsi_io_dispatch_hw_io()
315 io->iparam.fcp_tgt.s_id = io->node->port_fc_id; in efct_scsi_io_dispatch_hw_io()
316 io->iparam.fcp_tgt.d_id = io->node->node_fc_id; in efct_scsi_io_dispatch_hw_io()
317 io->iparam.fcp_tgt.xmit_len = io->wire_len; in efct_scsi_io_dispatch_hw_io()
319 rc = efct_hw_io_send(&io->efct->hw, io->hio_type, io->hio, in efct_scsi_io_dispatch_hw_io()
320 &io->iparam, io->hw_cb, io); in efct_scsi_io_dispatch_hw_io()
323 scsi_io_printf(io, "Unknown IO type=%d\n", io->io_type); in efct_scsi_io_dispatch_hw_io()
331 efct_scsi_io_dispatch_no_hw_io(struct efct_io *io) in efct_scsi_io_dispatch_no_hw_io() argument
335 switch (io->io_type) { in efct_scsi_io_dispatch_no_hw_io()
339 hio_to_abort = io->io_to_abort->hio; in efct_scsi_io_dispatch_no_hw_io()
343 * If "IO to abort" does not have an in efct_scsi_io_dispatch_no_hw_io()
344 * associated HW IO, immediately make callback with in efct_scsi_io_dispatch_no_hw_io()
347 * started, so we don't have a HW IO. in efct_scsi_io_dispatch_no_hw_io()
354 scsi_io_printf(io, "IO: not active\n"); in efct_scsi_io_dispatch_no_hw_io()
355 ((efct_hw_done_t)io->hw_cb)(io->hio, 0, in efct_scsi_io_dispatch_no_hw_io()
356 SLI4_FC_WCQE_STATUS_SUCCESS, 0, io); in efct_scsi_io_dispatch_no_hw_io()
361 /* HW IO is valid, abort it */ in efct_scsi_io_dispatch_no_hw_io()
362 scsi_io_printf(io, "aborting\n"); in efct_scsi_io_dispatch_no_hw_io()
363 rc = efct_hw_io_abort(&io->efct->hw, hio_to_abort, in efct_scsi_io_dispatch_no_hw_io()
364 io->send_abts, io->hw_cb, io); in efct_scsi_io_dispatch_no_hw_io()
367 efct_hw_done_t cb = io->hw_cb; in efct_scsi_io_dispatch_no_hw_io()
371 scsi_io_printf(io, "Failed to abort IO rc=%d\n", in efct_scsi_io_dispatch_no_hw_io()
374 cb(io->hio, 0, status, 0, io); in efct_scsi_io_dispatch_no_hw_io()
381 scsi_io_printf(io, "Unknown IO type=%d\n", io->io_type); in efct_scsi_io_dispatch_no_hw_io()
392 struct efct_io *io = NULL; in efct_scsi_dispatch_pending() local
400 io = list_first_entry(&xport->io_pending_list, struct efct_io, in efct_scsi_dispatch_pending()
402 list_del_init(&io->io_pending_link); in efct_scsi_dispatch_pending()
405 if (!io) { in efct_scsi_dispatch_pending()
410 if (io->io_type == EFCT_IO_TYPE_ABORT) { in efct_scsi_dispatch_pending()
416 * No HW IO available.Put IO back on in efct_scsi_dispatch_pending()
419 list_add(&xport->io_pending_list, &io->io_pending_link); in efct_scsi_dispatch_pending()
420 io = NULL; in efct_scsi_dispatch_pending()
422 hio->eq = io->hw_priv; in efct_scsi_dispatch_pending()
426 /* Must drop the lock before dispatching the IO */ in efct_scsi_dispatch_pending()
429 if (!io) in efct_scsi_dispatch_pending()
433 * We pulled an IO off the pending list, in efct_scsi_dispatch_pending()
434 * and either got an HW IO or don't need one in efct_scsi_dispatch_pending()
438 status = efct_scsi_io_dispatch_no_hw_io(io); in efct_scsi_dispatch_pending()
440 status = efct_scsi_io_dispatch_hw_io(io, hio); in efct_scsi_dispatch_pending()
449 efct_scsi_check_pending_async_cb, io)) { in efct_scsi_dispatch_pending()
454 return io; in efct_scsi_dispatch_pending()
461 struct efct_io *io = NULL; in efct_scsi_check_pending() local
484 * active IO and the abort is on the pending list. in efct_scsi_check_pending()
490 list_for_each_entry(io, &xport->io_pending_list, io_pending_link) { in efct_scsi_check_pending()
491 if (io->io_type == EFCT_IO_TYPE_ABORT && io->io_to_abort->hio) { in efct_scsi_check_pending()
492 /* This IO has a HW IO, so it is in efct_scsi_check_pending()
496 list_del_init(&io->io_pending_link); in efct_scsi_check_pending()
505 if (efct_scsi_io_dispatch_no_hw_io(io)) { in efct_scsi_check_pending()
507 efct_scsi_check_pending_async_cb, io)) { in efct_scsi_check_pending()
517 efct_scsi_io_dispatch(struct efct_io *io, void *cb) in efct_scsi_io_dispatch() argument
520 struct efct *efct = io->efct; in efct_scsi_io_dispatch()
524 io->hw_cb = cb; in efct_scsi_io_dispatch()
527 * if this IO already has a HW IO, then this is either in efct_scsi_io_dispatch()
528 * not the first phase of the IO. Send it to the HW. in efct_scsi_io_dispatch()
530 if (io->hio) in efct_scsi_io_dispatch()
531 return efct_scsi_io_dispatch_hw_io(io, io->hio); in efct_scsi_io_dispatch()
534 * We don't already have a HW IO associated with the IO. First check in efct_scsi_io_dispatch()
535 * the pending list. If not empty, add IO to the tail and process the in efct_scsi_io_dispatch()
542 * the put at the front of the IO pending in efct_scsi_io_dispatch()
545 if (io->low_latency) { in efct_scsi_io_dispatch()
546 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch()
547 list_add(&xport->io_pending_list, &io->io_pending_link); in efct_scsi_io_dispatch()
549 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch()
550 list_add_tail(&io->io_pending_link, in efct_scsi_io_dispatch()
564 * We don't have a HW IO associated with the IO and there's nothing in efct_scsi_io_dispatch()
565 * on the pending list. Attempt to allocate a HW IO and dispatch it. in efct_scsi_io_dispatch()
567 hio = efct_hw_io_alloc(&io->efct->hw); in efct_scsi_io_dispatch()
569 /* Couldn't get a HW IO. Save this IO on the pending list */ in efct_scsi_io_dispatch()
571 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch()
572 list_add_tail(&io->io_pending_link, &xport->io_pending_list); in efct_scsi_io_dispatch()
580 /* We successfully allocated a HW IO; dispatch to HW */ in efct_scsi_io_dispatch()
581 return efct_scsi_io_dispatch_hw_io(io, hio); in efct_scsi_io_dispatch()
585 efct_scsi_io_dispatch_abort(struct efct_io *io, void *cb) in efct_scsi_io_dispatch_abort() argument
587 struct efct *efct = io->efct; in efct_scsi_io_dispatch_abort()
591 io->hw_cb = cb; in efct_scsi_io_dispatch_abort()
594 * For aborts, we don't need a HW IO, but we still want in efct_scsi_io_dispatch_abort()
601 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch_abort()
602 list_add_tail(&io->io_pending_link, &xport->io_pending_list); in efct_scsi_io_dispatch_abort()
614 return efct_scsi_io_dispatch_no_hw_io(io); in efct_scsi_io_dispatch_abort()
618 efct_scsi_xfer_data(struct efct_io *io, u32 flags, in efct_scsi_xfer_data() argument
626 io->sgl_count = sgl_count; in efct_scsi_xfer_data()
628 efct = io->efct; in efct_scsi_xfer_data()
630 scsi_io_trace(io, "%s wire_len %llu\n", in efct_scsi_xfer_data()
634 io->hio_type = type; in efct_scsi_xfer_data()
636 io->scsi_tgt_cb = cb; in efct_scsi_xfer_data()
637 io->scsi_tgt_cb_arg = arg; in efct_scsi_xfer_data()
639 residual = io->exp_xfer_len - io->transferred; in efct_scsi_xfer_data()
640 io->wire_len = (xwire_len < residual) ? xwire_len : residual; in efct_scsi_xfer_data()
641 residual = (xwire_len - io->wire_len); in efct_scsi_xfer_data()
643 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_scsi_xfer_data()
644 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in efct_scsi_xfer_data()
645 io->iparam.fcp_tgt.offset = io->transferred; in efct_scsi_xfer_data()
646 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in efct_scsi_xfer_data()
647 io->iparam.fcp_tgt.timeout = io->timeout; in efct_scsi_xfer_data()
653 ((io->transferred + io->wire_len) == io->exp_xfer_len) && in efct_scsi_xfer_data()
655 io->iparam.fcp_tgt.flags |= SLI4_IO_AUTO_GOOD_RESPONSE; in efct_scsi_xfer_data()
656 io->auto_resp = true; in efct_scsi_xfer_data()
658 io->auto_resp = false; in efct_scsi_xfer_data()
662 io->xfer_req = io->wire_len; in efct_scsi_xfer_data()
667 io->transferred += residual; in efct_scsi_xfer_data()
672 struct efct_scsi_sgl *sgl_ptr = &io->sgl[sgl_count - 1]; in efct_scsi_xfer_data()
683 io->sgl_count--; in efct_scsi_xfer_data()
690 io->low_latency = (flags & EFCT_SCSI_LOW_LATENCY) != 0; in efct_scsi_xfer_data()
691 io->wq_steering = (flags & EFCT_SCSI_WQ_STEERING_MASK) >> in efct_scsi_xfer_data()
693 io->wq_class = (flags & EFCT_SCSI_WQ_CLASS_MASK) >> in efct_scsi_xfer_data()
707 return efct_scsi_io_dispatch(io, efct_target_io_cb); in efct_scsi_xfer_data()
711 efct_scsi_send_rd_data(struct efct_io *io, u32 flags, in efct_scsi_send_rd_data() argument
715 return efct_scsi_xfer_data(io, flags, sgl, sgl_count, in efct_scsi_send_rd_data()
717 enable_tsend_auto_resp(io->efct), cb, arg); in efct_scsi_send_rd_data()
721 efct_scsi_recv_wr_data(struct efct_io *io, u32 flags, in efct_scsi_recv_wr_data() argument
725 return efct_scsi_xfer_data(io, flags, sgl, sgl_count, len, in efct_scsi_recv_wr_data()
727 enable_treceive_auto_resp(io->efct), cb, arg); in efct_scsi_recv_wr_data()
731 efct_scsi_send_resp(struct efct_io *io, u32 flags, in efct_scsi_send_resp() argument
744 efct = io->efct; in efct_scsi_send_resp()
753 residual = io->exp_xfer_len - io->transferred; in efct_scsi_send_resp()
756 io->wire_len = 0; in efct_scsi_send_resp()
757 io->hio_type = EFCT_HW_IO_TARGET_RSP; in efct_scsi_send_resp()
759 io->scsi_tgt_cb = cb; in efct_scsi_send_resp()
760 io->scsi_tgt_cb_arg = arg; in efct_scsi_send_resp()
762 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_scsi_send_resp()
763 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in efct_scsi_send_resp()
764 io->iparam.fcp_tgt.offset = 0; in efct_scsi_send_resp()
765 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in efct_scsi_send_resp()
766 io->iparam.fcp_tgt.timeout = io->timeout; in efct_scsi_send_resp()
769 io->low_latency = (flags & EFCT_SCSI_LOW_LATENCY) != 0; in efct_scsi_send_resp()
770 io->wq_steering = (flags & EFCT_SCSI_WQ_STEERING_MASK) >> in efct_scsi_send_resp()
772 io->wq_class = (flags & EFCT_SCSI_WQ_CLASS_MASK) >> in efct_scsi_send_resp()
776 struct fcp_resp_with_ext *fcprsp = io->rspbuf.virt; in efct_scsi_send_resp()
784 sns_data = (u8 *)io->rspbuf.virt + sizeof(*fcprsp); in efct_scsi_send_resp()
790 io->wire_len += sizeof(*fcprsp); in efct_scsi_send_resp()
821 io->wire_len += sense_data_length; in efct_scsi_send_resp()
824 io->sgl[0].addr = io->rspbuf.phys; in efct_scsi_send_resp()
825 io->sgl[0].dif_addr = 0; in efct_scsi_send_resp()
826 io->sgl[0].len = io->wire_len; in efct_scsi_send_resp()
827 io->sgl_count = 1; in efct_scsi_send_resp()
831 io->iparam.fcp_tgt.flags |= SLI4_IO_AUTO_GOOD_RESPONSE; in efct_scsi_send_resp()
833 return efct_scsi_io_dispatch(io, efct_target_io_cb); in efct_scsi_send_resp()
840 struct efct_io *io = app; in efct_target_bls_resp_cb() local
844 efct = io->efct; in efct_target_bls_resp_cb()
848 io_error_log(io, "s=%#x x=%#x\n", status, ext_status); in efct_target_bls_resp_cb()
854 if (io->bls_cb) { in efct_target_bls_resp_cb()
855 efct_scsi_io_cb_t bls_cb = io->bls_cb; in efct_target_bls_resp_cb()
856 void *bls_cb_arg = io->bls_cb_arg; in efct_target_bls_resp_cb()
858 io->bls_cb = NULL; in efct_target_bls_resp_cb()
859 io->bls_cb_arg = NULL; in efct_target_bls_resp_cb()
862 bls_cb(io, bls_status, 0, bls_cb_arg); in efct_target_bls_resp_cb()
870 efct_target_send_bls_resp(struct efct_io *io, in efct_target_send_bls_resp() argument
873 struct efct_node *node = io->node; in efct_target_send_bls_resp()
874 struct sli_bls_params *bls = &io->iparam.bls; in efct_target_send_bls_resp()
879 /* fill out IO structure with everything needed to send BA_ACC */ in efct_target_send_bls_resp()
880 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_target_send_bls_resp()
881 bls->ox_id = io->init_task_tag; in efct_target_send_bls_resp()
882 bls->rx_id = io->abort_rx_id; in efct_target_send_bls_resp()
883 bls->vpi = io->node->vpi; in efct_target_send_bls_resp()
884 bls->rpi = io->node->rpi; in efct_target_send_bls_resp()
886 bls->d_id = io->node->node_fc_id; in efct_target_send_bls_resp()
894 /* generic io fields have already been populated */ in efct_target_send_bls_resp()
897 io->io_type = EFCT_IO_TYPE_BLS_RESP; in efct_target_send_bls_resp()
898 io->display_name = "bls_rsp"; in efct_target_send_bls_resp()
899 io->hio_type = EFCT_HW_BLS_ACC; in efct_target_send_bls_resp()
900 io->bls_cb = cb; in efct_target_send_bls_resp()
901 io->bls_cb_arg = arg; in efct_target_send_bls_resp()
903 /* dispatch IO */ in efct_target_send_bls_resp()
905 efct_target_bls_resp_cb, io); in efct_target_send_bls_resp()
912 struct efct_io *io = app; in efct_bls_send_rjt_cb() local
914 efct_scsi_io_free(io); in efct_bls_send_rjt_cb()
919 efct_bls_send_rjt(struct efct_io *io, struct fc_frame_header *hdr) in efct_bls_send_rjt() argument
921 struct efct_node *node = io->node; in efct_bls_send_rjt()
922 struct sli_bls_params *bls = &io->iparam.bls; in efct_bls_send_rjt()
928 io->io_type = EFCT_IO_TYPE_BLS_RESP; in efct_bls_send_rjt()
929 io->display_name = "ba_rjt"; in efct_bls_send_rjt()
930 io->hio_type = EFCT_HW_BLS_RJT; in efct_bls_send_rjt()
931 io->init_task_tag = be16_to_cpu(hdr->fh_ox_id); in efct_bls_send_rjt()
934 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_bls_send_rjt()
937 bls->vpi = io->node->vpi; in efct_bls_send_rjt()
938 bls->rpi = io->node->rpi; in efct_bls_send_rjt()
940 bls->d_id = io->node->node_fc_id; in efct_bls_send_rjt()
948 io); in efct_bls_send_rjt()
951 efct_scsi_io_free(io); in efct_bls_send_rjt()
952 io = NULL; in efct_bls_send_rjt()
954 return io; in efct_bls_send_rjt()
958 efct_scsi_send_tmf_resp(struct efct_io *io, in efct_scsi_send_tmf_resp() argument
970 io->wire_len = 0; in efct_scsi_send_tmf_resp()
994 io->hio_type = EFCT_HW_IO_TARGET_RSP; in efct_scsi_send_tmf_resp()
996 io->scsi_tgt_cb = cb; in efct_scsi_send_tmf_resp()
997 io->scsi_tgt_cb_arg = arg; in efct_scsi_send_tmf_resp()
999 if (io->tmf_cmd == EFCT_SCSI_TMF_ABORT_TASK) { in efct_scsi_send_tmf_resp()
1000 rc = efct_target_send_bls_resp(io, cb, arg); in efct_scsi_send_tmf_resp()
1005 fcprsp = io->rspbuf.virt; in efct_scsi_send_tmf_resp()
1016 io->wire_len = sizeof(*fcprsp); in efct_scsi_send_tmf_resp()
1021 io->sgl[0].addr = io->rspbuf.phys; in efct_scsi_send_tmf_resp()
1022 io->sgl[0].dif_addr = 0; in efct_scsi_send_tmf_resp()
1023 io->sgl[0].len = io->wire_len; in efct_scsi_send_tmf_resp()
1024 io->sgl_count = 1; in efct_scsi_send_tmf_resp()
1026 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_scsi_send_tmf_resp()
1027 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in efct_scsi_send_tmf_resp()
1028 io->iparam.fcp_tgt.offset = 0; in efct_scsi_send_tmf_resp()
1029 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in efct_scsi_send_tmf_resp()
1030 io->iparam.fcp_tgt.timeout = io->timeout; in efct_scsi_send_tmf_resp()
1032 rc = efct_scsi_io_dispatch(io, efct_target_io_cb); in efct_scsi_send_tmf_resp()
1041 struct efct_io *io = app; in efct_target_abort_cb() local
1047 efct = io->efct; in efct_target_abort_cb()
1049 if (!io->abort_cb) in efct_target_abort_cb()
1052 abort_cb = io->abort_cb; in efct_target_abort_cb()
1053 abort_cb_arg = io->abort_cb_arg; in efct_target_abort_cb()
1055 io->abort_cb = NULL; in efct_target_abort_cb()
1056 io->abort_cb_arg = NULL; in efct_target_abort_cb()
1084 abort_cb(io->io_to_abort, scsi_status, 0, abort_cb_arg); in efct_target_abort_cb()
1087 /* done with IO to abort,efct_ref_get(): efct_scsi_tgt_abort_io() */ in efct_target_abort_cb()
1088 kref_put(&io->io_to_abort->ref, io->io_to_abort->release); in efct_target_abort_cb()
1090 efct_io_pool_io_free(efct->xport->io_pool, io); in efct_target_abort_cb()
1097 efct_scsi_tgt_abort_io(struct efct_io *io, efct_scsi_io_cb_t cb, void *arg) in efct_scsi_tgt_abort_io() argument
1104 efct = io->efct; in efct_scsi_tgt_abort_io()
1107 /* take a reference on IO being aborted */ in efct_scsi_tgt_abort_io()
1108 if (kref_get_unless_zero(&io->ref) == 0) { in efct_scsi_tgt_abort_io()
1110 scsi_io_printf(io, "command no longer active\n"); in efct_scsi_tgt_abort_io()
1115 * allocate a new IO to send the abort request. Use efct_io_alloc() in efct_scsi_tgt_abort_io()
1116 * directly, as we need an IO object that will not fail allocation in efct_scsi_tgt_abort_io()
1122 kref_put(&io->ref, io->release); in efct_scsi_tgt_abort_io()
1129 abort_io->node = io->node; in efct_scsi_tgt_abort_io()
1134 abort_io->io_to_abort = io; in efct_scsi_tgt_abort_io()
1139 /* now dispatch IO */ in efct_scsi_tgt_abort_io()
1142 kref_put(&io->ref, io->release); in efct_scsi_tgt_abort_io()
1147 efct_scsi_io_complete(struct efct_io *io) in efct_scsi_io_complete() argument
1149 if (io->io_free) { in efct_scsi_io_complete()
1150 efc_log_debug(io->efct, "completion for non-busy io tag 0x%x\n", in efct_scsi_io_complete()
1151 io->tag); in efct_scsi_io_complete()
1155 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in efct_scsi_io_complete()
1156 kref_put(&io->ref, io->release); in efct_scsi_io_complete()