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
43 io = efct_io_pool_io_alloc(efct->xport->io_pool); in efct_scsi_io_alloc()
44 if (!io) { in efct_scsi_io_alloc()
45 efc_log_err(efct, "IO alloc Failed\n"); in efct_scsi_io_alloc()
51 kref_init(&io->ref); in efct_scsi_io_alloc()
52 io->release = _efct_scsi_io_free; in efct_scsi_io_alloc()
55 io->efct = efct; in efct_scsi_io_alloc()
56 io->node = node; in efct_scsi_io_alloc()
60 io->io_type = EFCT_IO_TYPE_IO; in efct_scsi_io_alloc()
61 io->display_name = "scsi_io"; in efct_scsi_io_alloc()
63 io->cmd_ini = false; in efct_scsi_io_alloc()
64 io->cmd_tgt = true; in efct_scsi_io_alloc()
67 INIT_LIST_HEAD(&io->list_entry); in efct_scsi_io_alloc()
68 list_add(&io->list_entry, &node->active_ios); in efct_scsi_io_alloc()
72 return io; in efct_scsi_io_alloc()
78 struct efct_io *io = container_of(arg, struct efct_io, ref); in _efct_scsi_io_free() local
79 struct efct *efct = io->efct; in _efct_scsi_io_free()
80 struct efct_node *node = io->node; in _efct_scsi_io_free()
83 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in _efct_scsi_io_free()
85 if (io->io_free) { in _efct_scsi_io_free()
86 efc_log_err(efct, "IO already freed.\n"); in _efct_scsi_io_free()
91 list_del_init(&io->list_entry); in _efct_scsi_io_free()
95 io->node = NULL; in _efct_scsi_io_free()
96 efct_io_pool_io_free(efct->xport->io_pool, io); in _efct_scsi_io_free()
100 efct_scsi_io_free(struct efct_io *io) in efct_scsi_io_free() argument
102 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in efct_scsi_io_free()
103 WARN_ON(!refcount_read(&io->ref.refcount)); in efct_scsi_io_free()
104 kref_put(&io->ref, io->release); in efct_scsi_io_free()
112 struct efct_io *io = app; in efct_target_io_cb() local
117 if (!io || !io->efct) { in efct_target_io_cb()
118 pr_err("%s: IO can not be NULL\n", __func__); in efct_target_io_cb()
122 scsi_io_trace(io, "status x%x ext_status x%x\n", status, ext_status); in efct_target_io_cb()
124 efct = io->efct; in efct_target_io_cb()
126 io->transferred += length; in efct_target_io_cb()
128 if (!io->scsi_tgt_cb) { in efct_target_io_cb()
134 cb = io->scsi_tgt_cb; in efct_target_io_cb()
137 io->scsi_tgt_cb = NULL; in efct_target_io_cb()
143 if (status == 0 && io->auto_resp) in efct_target_io_cb()
182 /* target IO timed out */ in efct_target_io_cb()
187 /* Target IO cancelled by HW */ in efct_target_io_cb()
196 cb(io, scsi_stat, flags, io->scsi_tgt_cb_arg); in efct_target_io_cb()
230 static void efc_log_sgl(struct efct_io *io) in efc_log_sgl() argument
232 struct efct_hw_io *hio = io->hio; in efc_log_sgl()
238 scsi_io_trace(io, "def_sgl at 0x%x 0x%08x\n", in efc_log_sgl()
245 scsi_io_trace(io, "SGL %2d 0x%08x 0x%08x 0x%08x 0x%08x\n", in efc_log_sgl()
257 struct efct_io *io = arg; in efct_scsi_check_pending_async_cb() local
259 if (io) { in efct_scsi_check_pending_async_cb()
260 efct_hw_done_t cb = io->hw_cb; in efct_scsi_check_pending_async_cb()
262 if (!io->hw_cb) in efct_scsi_check_pending_async_cb()
265 io->hw_cb = NULL; in efct_scsi_check_pending_async_cb()
266 (cb)(io->hio, 0, SLI4_FC_WCQE_STATUS_DISPATCH_ERROR, 0, io); in efct_scsi_check_pending_async_cb()
271 efct_scsi_io_dispatch_hw_io(struct efct_io *io, struct efct_hw_io *hio) in efct_scsi_io_dispatch_hw_io() argument
274 struct efct *efct = io->efct; in efct_scsi_io_dispatch_hw_io()
276 /* Got a HW IO; in efct_scsi_io_dispatch_hw_io()
277 * update ini/tgt_task_tag with HW IO info and dispatch in efct_scsi_io_dispatch_hw_io()
279 io->hio = hio; in efct_scsi_io_dispatch_hw_io()
280 if (io->cmd_tgt) in efct_scsi_io_dispatch_hw_io()
281 io->tgt_task_tag = hio->indicator; in efct_scsi_io_dispatch_hw_io()
282 else if (io->cmd_ini) in efct_scsi_io_dispatch_hw_io()
283 io->init_task_tag = hio->indicator; in efct_scsi_io_dispatch_hw_io()
284 io->hw_tag = hio->reqtag; in efct_scsi_io_dispatch_hw_io()
286 hio->eq = io->hw_priv; in efct_scsi_io_dispatch_hw_io()
289 switch (io->wq_steering) { in efct_scsi_io_dispatch_hw_io()
301 switch (io->io_type) { in efct_scsi_io_dispatch_hw_io()
303 rc = efct_scsi_build_sgls(&efct->hw, io->hio, in efct_scsi_io_dispatch_hw_io()
304 io->sgl, io->sgl_count, io->hio_type); in efct_scsi_io_dispatch_hw_io()
309 efc_log_sgl(io); in efct_scsi_io_dispatch_hw_io()
311 if (io->app_id) in efct_scsi_io_dispatch_hw_io()
312 io->iparam.fcp_tgt.app_id = io->app_id; in efct_scsi_io_dispatch_hw_io()
314 io->iparam.fcp_tgt.vpi = io->node->vpi; in efct_scsi_io_dispatch_hw_io()
315 io->iparam.fcp_tgt.rpi = io->node->rpi; in efct_scsi_io_dispatch_hw_io()
316 io->iparam.fcp_tgt.s_id = io->node->port_fc_id; in efct_scsi_io_dispatch_hw_io()
317 io->iparam.fcp_tgt.d_id = io->node->node_fc_id; in efct_scsi_io_dispatch_hw_io()
318 io->iparam.fcp_tgt.xmit_len = io->wire_len; in efct_scsi_io_dispatch_hw_io()
320 rc = efct_hw_io_send(&io->efct->hw, io->hio_type, io->hio, in efct_scsi_io_dispatch_hw_io()
321 &io->iparam, io->hw_cb, io); in efct_scsi_io_dispatch_hw_io()
324 scsi_io_printf(io, "Unknown IO type=%d\n", io->io_type); in efct_scsi_io_dispatch_hw_io()
332 efct_scsi_io_dispatch_no_hw_io(struct efct_io *io) in efct_scsi_io_dispatch_no_hw_io() argument
336 switch (io->io_type) { in efct_scsi_io_dispatch_no_hw_io()
340 hio_to_abort = io->io_to_abort->hio; in efct_scsi_io_dispatch_no_hw_io()
344 * If "IO to abort" does not have an in efct_scsi_io_dispatch_no_hw_io()
345 * associated HW IO, immediately make callback with in efct_scsi_io_dispatch_no_hw_io()
348 * started, so we don't have a HW IO. in efct_scsi_io_dispatch_no_hw_io()
355 scsi_io_printf(io, "IO: not active\n"); in efct_scsi_io_dispatch_no_hw_io()
356 ((efct_hw_done_t)io->hw_cb)(io->hio, 0, in efct_scsi_io_dispatch_no_hw_io()
357 SLI4_FC_WCQE_STATUS_SUCCESS, 0, io); in efct_scsi_io_dispatch_no_hw_io()
362 /* HW IO is valid, abort it */ in efct_scsi_io_dispatch_no_hw_io()
363 scsi_io_printf(io, "aborting\n"); in efct_scsi_io_dispatch_no_hw_io()
364 rc = efct_hw_io_abort(&io->efct->hw, hio_to_abort, in efct_scsi_io_dispatch_no_hw_io()
365 io->send_abts, io->hw_cb, io); in efct_scsi_io_dispatch_no_hw_io()
368 efct_hw_done_t cb = io->hw_cb; in efct_scsi_io_dispatch_no_hw_io()
372 scsi_io_printf(io, "Failed to abort IO rc=%d\n", in efct_scsi_io_dispatch_no_hw_io()
375 cb(io->hio, 0, status, 0, io); in efct_scsi_io_dispatch_no_hw_io()
382 scsi_io_printf(io, "Unknown IO type=%d\n", io->io_type); in efct_scsi_io_dispatch_no_hw_io()
393 struct efct_io *io = NULL; in efct_scsi_dispatch_pending() local
401 io = list_first_entry(&xport->io_pending_list, struct efct_io, in efct_scsi_dispatch_pending()
403 list_del_init(&io->io_pending_link); in efct_scsi_dispatch_pending()
406 if (!io) { in efct_scsi_dispatch_pending()
411 if (io->io_type == EFCT_IO_TYPE_ABORT) { in efct_scsi_dispatch_pending()
417 * No HW IO available.Put IO back on in efct_scsi_dispatch_pending()
420 list_add(&xport->io_pending_list, &io->io_pending_link); in efct_scsi_dispatch_pending()
421 io = NULL; in efct_scsi_dispatch_pending()
423 hio->eq = io->hw_priv; in efct_scsi_dispatch_pending()
427 /* Must drop the lock before dispatching the IO */ in efct_scsi_dispatch_pending()
430 if (!io) in efct_scsi_dispatch_pending()
434 * We pulled an IO off the pending list, in efct_scsi_dispatch_pending()
435 * and either got an HW IO or don't need one in efct_scsi_dispatch_pending()
439 status = efct_scsi_io_dispatch_no_hw_io(io); in efct_scsi_dispatch_pending()
441 status = efct_scsi_io_dispatch_hw_io(io, hio); in efct_scsi_dispatch_pending()
450 efct_scsi_check_pending_async_cb, io)) { in efct_scsi_dispatch_pending()
455 return io; in efct_scsi_dispatch_pending()
462 struct efct_io *io = NULL; in efct_scsi_check_pending() local
485 * active IO and the abort is on the pending list. in efct_scsi_check_pending()
491 list_for_each_entry(io, &xport->io_pending_list, io_pending_link) { in efct_scsi_check_pending()
492 if (io->io_type == EFCT_IO_TYPE_ABORT && io->io_to_abort->hio) { in efct_scsi_check_pending()
493 /* This IO has a HW IO, so it is in efct_scsi_check_pending()
497 list_del_init(&io->io_pending_link); in efct_scsi_check_pending()
506 if (efct_scsi_io_dispatch_no_hw_io(io)) { in efct_scsi_check_pending()
508 efct_scsi_check_pending_async_cb, io)) { in efct_scsi_check_pending()
518 efct_scsi_io_dispatch(struct efct_io *io, void *cb) in efct_scsi_io_dispatch() argument
521 struct efct *efct = io->efct; in efct_scsi_io_dispatch()
525 io->hw_cb = cb; in efct_scsi_io_dispatch()
528 * if this IO already has a HW IO, then this is either in efct_scsi_io_dispatch()
529 * not the first phase of the IO. Send it to the HW. in efct_scsi_io_dispatch()
531 if (io->hio) in efct_scsi_io_dispatch()
532 return efct_scsi_io_dispatch_hw_io(io, io->hio); in efct_scsi_io_dispatch()
535 * We don't already have a HW IO associated with the IO. First check in efct_scsi_io_dispatch()
536 * the pending list. If not empty, add IO to the tail and process the in efct_scsi_io_dispatch()
543 * the put at the front of the IO pending in efct_scsi_io_dispatch()
546 if (io->low_latency) { in efct_scsi_io_dispatch()
547 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch()
548 list_add(&xport->io_pending_list, &io->io_pending_link); in efct_scsi_io_dispatch()
550 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch()
551 list_add_tail(&io->io_pending_link, in efct_scsi_io_dispatch()
565 * We don't have a HW IO associated with the IO and there's nothing in efct_scsi_io_dispatch()
566 * on the pending list. Attempt to allocate a HW IO and dispatch it. in efct_scsi_io_dispatch()
568 hio = efct_hw_io_alloc(&io->efct->hw); in efct_scsi_io_dispatch()
570 /* Couldn't get a HW IO. Save this IO on the pending list */ in efct_scsi_io_dispatch()
572 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch()
573 list_add_tail(&io->io_pending_link, &xport->io_pending_list); in efct_scsi_io_dispatch()
581 /* We successfully allocated a HW IO; dispatch to HW */ in efct_scsi_io_dispatch()
582 return efct_scsi_io_dispatch_hw_io(io, hio); in efct_scsi_io_dispatch()
586 efct_scsi_io_dispatch_abort(struct efct_io *io, void *cb) in efct_scsi_io_dispatch_abort() argument
588 struct efct *efct = io->efct; in efct_scsi_io_dispatch_abort()
592 io->hw_cb = cb; in efct_scsi_io_dispatch_abort()
595 * For aborts, we don't need a HW IO, but we still want in efct_scsi_io_dispatch_abort()
602 INIT_LIST_HEAD(&io->io_pending_link); in efct_scsi_io_dispatch_abort()
603 list_add_tail(&io->io_pending_link, &xport->io_pending_list); in efct_scsi_io_dispatch_abort()
615 return efct_scsi_io_dispatch_no_hw_io(io); in efct_scsi_io_dispatch_abort()
619 efct_scsi_xfer_data(struct efct_io *io, u32 flags, in efct_scsi_xfer_data() argument
627 io->sgl_count = sgl_count; in efct_scsi_xfer_data()
629 efct = io->efct; in efct_scsi_xfer_data()
631 scsi_io_trace(io, "%s wire_len %llu\n", in efct_scsi_xfer_data()
635 io->hio_type = type; in efct_scsi_xfer_data()
637 io->scsi_tgt_cb = cb; in efct_scsi_xfer_data()
638 io->scsi_tgt_cb_arg = arg; in efct_scsi_xfer_data()
640 residual = io->exp_xfer_len - io->transferred; in efct_scsi_xfer_data()
641 io->wire_len = (xwire_len < residual) ? xwire_len : residual; in efct_scsi_xfer_data()
642 residual = (xwire_len - io->wire_len); in efct_scsi_xfer_data()
644 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_scsi_xfer_data()
645 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in efct_scsi_xfer_data()
646 io->iparam.fcp_tgt.offset = io->transferred; in efct_scsi_xfer_data()
647 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in efct_scsi_xfer_data()
648 io->iparam.fcp_tgt.timeout = io->timeout; in efct_scsi_xfer_data()
654 ((io->transferred + io->wire_len) == io->exp_xfer_len) && in efct_scsi_xfer_data()
656 io->iparam.fcp_tgt.flags |= SLI4_IO_AUTO_GOOD_RESPONSE; in efct_scsi_xfer_data()
657 io->auto_resp = true; in efct_scsi_xfer_data()
659 io->auto_resp = false; in efct_scsi_xfer_data()
663 io->xfer_req = io->wire_len; in efct_scsi_xfer_data()
668 io->transferred += residual; in efct_scsi_xfer_data()
673 struct efct_scsi_sgl *sgl_ptr = &io->sgl[sgl_count - 1]; in efct_scsi_xfer_data()
684 io->sgl_count--; in efct_scsi_xfer_data()
691 io->low_latency = (flags & EFCT_SCSI_LOW_LATENCY) != 0; in efct_scsi_xfer_data()
692 io->wq_steering = (flags & EFCT_SCSI_WQ_STEERING_MASK) >> in efct_scsi_xfer_data()
694 io->wq_class = (flags & EFCT_SCSI_WQ_CLASS_MASK) >> in efct_scsi_xfer_data()
708 return efct_scsi_io_dispatch(io, efct_target_io_cb); in efct_scsi_xfer_data()
712 efct_scsi_send_rd_data(struct efct_io *io, u32 flags, in efct_scsi_send_rd_data() argument
716 return efct_scsi_xfer_data(io, flags, sgl, sgl_count, in efct_scsi_send_rd_data()
718 enable_tsend_auto_resp(io->efct), cb, arg); in efct_scsi_send_rd_data()
722 efct_scsi_recv_wr_data(struct efct_io *io, u32 flags, in efct_scsi_recv_wr_data() argument
726 return efct_scsi_xfer_data(io, flags, sgl, sgl_count, len, in efct_scsi_recv_wr_data()
728 enable_treceive_auto_resp(io->efct), cb, arg); in efct_scsi_recv_wr_data()
732 efct_scsi_send_resp(struct efct_io *io, u32 flags, in efct_scsi_send_resp() argument
745 efct = io->efct; in efct_scsi_send_resp()
754 residual = io->exp_xfer_len - io->transferred; in efct_scsi_send_resp()
757 io->wire_len = 0; in efct_scsi_send_resp()
758 io->hio_type = EFCT_HW_IO_TARGET_RSP; in efct_scsi_send_resp()
760 io->scsi_tgt_cb = cb; in efct_scsi_send_resp()
761 io->scsi_tgt_cb_arg = arg; in efct_scsi_send_resp()
763 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_scsi_send_resp()
764 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in efct_scsi_send_resp()
765 io->iparam.fcp_tgt.offset = 0; in efct_scsi_send_resp()
766 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in efct_scsi_send_resp()
767 io->iparam.fcp_tgt.timeout = io->timeout; in efct_scsi_send_resp()
770 io->low_latency = (flags & EFCT_SCSI_LOW_LATENCY) != 0; in efct_scsi_send_resp()
771 io->wq_steering = (flags & EFCT_SCSI_WQ_STEERING_MASK) >> in efct_scsi_send_resp()
773 io->wq_class = (flags & EFCT_SCSI_WQ_CLASS_MASK) >> in efct_scsi_send_resp()
777 struct fcp_resp_with_ext *fcprsp = io->rspbuf.virt; in efct_scsi_send_resp()
785 sns_data = (u8 *)io->rspbuf.virt + sizeof(*fcprsp); in efct_scsi_send_resp()
791 io->wire_len += sizeof(*fcprsp); in efct_scsi_send_resp()
822 io->wire_len += sense_data_length; in efct_scsi_send_resp()
825 io->sgl[0].addr = io->rspbuf.phys; in efct_scsi_send_resp()
826 io->sgl[0].dif_addr = 0; in efct_scsi_send_resp()
827 io->sgl[0].len = io->wire_len; in efct_scsi_send_resp()
828 io->sgl_count = 1; in efct_scsi_send_resp()
832 io->iparam.fcp_tgt.flags |= SLI4_IO_AUTO_GOOD_RESPONSE; in efct_scsi_send_resp()
834 return efct_scsi_io_dispatch(io, efct_target_io_cb); in efct_scsi_send_resp()
841 struct efct_io *io = app; in efct_target_bls_resp_cb() local
845 efct = io->efct; in efct_target_bls_resp_cb()
849 io_error_log(io, "s=%#x x=%#x\n", status, ext_status); in efct_target_bls_resp_cb()
855 if (io->bls_cb) { in efct_target_bls_resp_cb()
856 efct_scsi_io_cb_t bls_cb = io->bls_cb; in efct_target_bls_resp_cb()
857 void *bls_cb_arg = io->bls_cb_arg; in efct_target_bls_resp_cb()
859 io->bls_cb = NULL; in efct_target_bls_resp_cb()
860 io->bls_cb_arg = NULL; in efct_target_bls_resp_cb()
863 bls_cb(io, bls_status, 0, bls_cb_arg); in efct_target_bls_resp_cb()
871 efct_target_send_bls_resp(struct efct_io *io, in efct_target_send_bls_resp() argument
874 struct efct_node *node = io->node; in efct_target_send_bls_resp()
875 struct sli_bls_params *bls = &io->iparam.bls; in efct_target_send_bls_resp()
880 /* fill out IO structure with everything needed to send BA_ACC */ in efct_target_send_bls_resp()
881 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_target_send_bls_resp()
882 bls->ox_id = io->init_task_tag; in efct_target_send_bls_resp()
883 bls->rx_id = io->abort_rx_id; in efct_target_send_bls_resp()
884 bls->vpi = io->node->vpi; in efct_target_send_bls_resp()
885 bls->rpi = io->node->rpi; in efct_target_send_bls_resp()
887 bls->d_id = io->node->node_fc_id; in efct_target_send_bls_resp()
895 /* generic io fields have already been populated */ in efct_target_send_bls_resp()
898 io->io_type = EFCT_IO_TYPE_BLS_RESP; in efct_target_send_bls_resp()
899 io->display_name = "bls_rsp"; in efct_target_send_bls_resp()
900 io->hio_type = EFCT_HW_BLS_ACC; in efct_target_send_bls_resp()
901 io->bls_cb = cb; in efct_target_send_bls_resp()
902 io->bls_cb_arg = arg; in efct_target_send_bls_resp()
904 /* dispatch IO */ in efct_target_send_bls_resp()
906 efct_target_bls_resp_cb, io); in efct_target_send_bls_resp()
913 struct efct_io *io = app; in efct_bls_send_rjt_cb() local
915 efct_scsi_io_free(io); in efct_bls_send_rjt_cb()
920 efct_bls_send_rjt(struct efct_io *io, struct fc_frame_header *hdr) in efct_bls_send_rjt() argument
922 struct efct_node *node = io->node; in efct_bls_send_rjt()
923 struct sli_bls_params *bls = &io->iparam.bls; in efct_bls_send_rjt()
929 io->io_type = EFCT_IO_TYPE_BLS_RESP; in efct_bls_send_rjt()
930 io->display_name = "ba_rjt"; in efct_bls_send_rjt()
931 io->hio_type = EFCT_HW_BLS_RJT; in efct_bls_send_rjt()
932 io->init_task_tag = be16_to_cpu(hdr->fh_ox_id); in efct_bls_send_rjt()
935 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_bls_send_rjt()
938 bls->vpi = io->node->vpi; in efct_bls_send_rjt()
939 bls->rpi = io->node->rpi; in efct_bls_send_rjt()
941 bls->d_id = io->node->node_fc_id; in efct_bls_send_rjt()
949 io); in efct_bls_send_rjt()
952 efct_scsi_io_free(io); in efct_bls_send_rjt()
953 io = NULL; in efct_bls_send_rjt()
955 return io; in efct_bls_send_rjt()
959 efct_scsi_send_tmf_resp(struct efct_io *io, in efct_scsi_send_tmf_resp() argument
971 io->wire_len = 0; in efct_scsi_send_tmf_resp()
995 io->hio_type = EFCT_HW_IO_TARGET_RSP; in efct_scsi_send_tmf_resp()
997 io->scsi_tgt_cb = cb; in efct_scsi_send_tmf_resp()
998 io->scsi_tgt_cb_arg = arg; in efct_scsi_send_tmf_resp()
1000 if (io->tmf_cmd == EFCT_SCSI_TMF_ABORT_TASK) { in efct_scsi_send_tmf_resp()
1001 rc = efct_target_send_bls_resp(io, cb, arg); in efct_scsi_send_tmf_resp()
1006 fcprsp = io->rspbuf.virt; in efct_scsi_send_tmf_resp()
1017 io->wire_len = sizeof(*fcprsp); in efct_scsi_send_tmf_resp()
1022 io->sgl[0].addr = io->rspbuf.phys; in efct_scsi_send_tmf_resp()
1023 io->sgl[0].dif_addr = 0; in efct_scsi_send_tmf_resp()
1024 io->sgl[0].len = io->wire_len; in efct_scsi_send_tmf_resp()
1025 io->sgl_count = 1; in efct_scsi_send_tmf_resp()
1027 memset(&io->iparam, 0, sizeof(io->iparam)); in efct_scsi_send_tmf_resp()
1028 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in efct_scsi_send_tmf_resp()
1029 io->iparam.fcp_tgt.offset = 0; in efct_scsi_send_tmf_resp()
1030 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in efct_scsi_send_tmf_resp()
1031 io->iparam.fcp_tgt.timeout = io->timeout; in efct_scsi_send_tmf_resp()
1033 rc = efct_scsi_io_dispatch(io, efct_target_io_cb); in efct_scsi_send_tmf_resp()
1042 struct efct_io *io = app; in efct_target_abort_cb() local
1048 efct = io->efct; in efct_target_abort_cb()
1050 if (!io->abort_cb) in efct_target_abort_cb()
1053 abort_cb = io->abort_cb; in efct_target_abort_cb()
1054 abort_cb_arg = io->abort_cb_arg; in efct_target_abort_cb()
1056 io->abort_cb = NULL; in efct_target_abort_cb()
1057 io->abort_cb_arg = NULL; in efct_target_abort_cb()
1085 abort_cb(io->io_to_abort, scsi_status, 0, abort_cb_arg); in efct_target_abort_cb()
1088 /* done with IO to abort,efct_ref_get(): efct_scsi_tgt_abort_io() */ in efct_target_abort_cb()
1089 kref_put(&io->io_to_abort->ref, io->io_to_abort->release); in efct_target_abort_cb()
1091 efct_io_pool_io_free(efct->xport->io_pool, io); in efct_target_abort_cb()
1098 efct_scsi_tgt_abort_io(struct efct_io *io, efct_scsi_io_cb_t cb, void *arg) in efct_scsi_tgt_abort_io() argument
1105 efct = io->efct; in efct_scsi_tgt_abort_io()
1108 /* take a reference on IO being aborted */ in efct_scsi_tgt_abort_io()
1109 if (kref_get_unless_zero(&io->ref) == 0) { in efct_scsi_tgt_abort_io()
1111 scsi_io_printf(io, "command no longer active\n"); in efct_scsi_tgt_abort_io()
1116 * allocate a new IO to send the abort request. Use efct_io_alloc() in efct_scsi_tgt_abort_io()
1117 * directly, as we need an IO object that will not fail allocation in efct_scsi_tgt_abort_io()
1123 kref_put(&io->ref, io->release); in efct_scsi_tgt_abort_io()
1130 abort_io->node = io->node; in efct_scsi_tgt_abort_io()
1135 abort_io->io_to_abort = io; in efct_scsi_tgt_abort_io()
1140 /* now dispatch IO */ in efct_scsi_tgt_abort_io()
1143 kref_put(&io->ref, io->release); in efct_scsi_tgt_abort_io()
1148 efct_scsi_io_complete(struct efct_io *io) in efct_scsi_io_complete() argument
1150 if (io->io_free) { in efct_scsi_io_complete()
1151 efc_log_debug(io->efct, "completion for non-busy io tag 0x%x\n", in efct_scsi_io_complete()
1152 io->tag); in efct_scsi_io_complete()
1156 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in efct_scsi_io_complete()
1157 kref_put(&io->ref, io->release); in efct_scsi_io_complete()