Lines Matching full:io

51 …fine SCSI_IOFMT_ARGS(io) io->instance_index, SCSI_ITT_SIZE(io->ocs), io->init_task_tag, SCSI_ITT_S…  argument
56 #define scsi_io_printf(io, fmt, ...) ocs_log_info(io->ocs, "[%s]" SCSI_IOFMT fmt, \ argument
57 io->node->display_name, SCSI_IOFMT_ARGS(io), ##__VA_ARGS__)
59 #define scsi_io_trace(io, fmt, ...) \ argument
61 if (OCS_LOG_ENABLE_SCSI_TRACE(io->ocs)) \
62 scsi_io_printf(io, fmt, ##__VA_ARGS__); \
71 static int32_t ocs_target_send_bls_resp(ocs_io_t *io, ocs_scsi_io_cb_t cb, void *arg);
75 static void ocs_scsi_io_free_ovfl(ocs_io_t *io);
78 static ocs_scsi_io_status_e ocs_scsi_dif_check_unknown(ocs_io_t *io, uint32_t length, uint32_t chec…
85 static int32_t ocs_scsi_io_dispatch_hw_io(ocs_io_t *io, ocs_hw_io_t *hio);
86 static int32_t ocs_scsi_io_dispatch_no_hw_io(ocs_io_t *io);
106 * @brief Enable IO allocation.
109 * The SCSI and Transport IO allocation functions are enabled. If the allocation functions
128 * @brief Disable IO allocation
131 * The SCSI and Transport IO allocation functions are disabled. If the allocation functions
150 * @brief Allocate a SCSI IO context.
153 * A SCSI IO context is allocated and associated with a @c node. This function
161 * @param role Role for IO (originator/responder).
163 * @return Returns the pointer to the IO context, or NULL.
172 ocs_io_t *io; in ocs_scsi_io_alloc() local
188 io = ocs_io_alloc(ocs); in ocs_scsi_io_alloc()
189 if (io == NULL) { in ocs_scsi_io_alloc()
196 ocs_ref_init(&io->ref, _ocs_scsi_io_free, io); in ocs_scsi_io_alloc()
198 if (io->hio != NULL) { in ocs_scsi_io_alloc()
199 ocs_log_err(node->ocs, "assertion failed: io->hio is not NULL\n"); in ocs_scsi_io_alloc()
200 ocs_io_free(ocs, io); in ocs_scsi_io_alloc()
206 io->ocs = ocs; in ocs_scsi_io_alloc()
207 io->node = node; in ocs_scsi_io_alloc()
210 io->io_type = OCS_IO_TYPE_IO; in ocs_scsi_io_alloc()
211 io->display_name = "scsi_io"; in ocs_scsi_io_alloc()
215 io->cmd_ini = TRUE; in ocs_scsi_io_alloc()
216 io->cmd_tgt = FALSE; in ocs_scsi_io_alloc()
219 io->cmd_ini = FALSE; in ocs_scsi_io_alloc()
220 io->cmd_tgt = TRUE; in ocs_scsi_io_alloc()
225 ocs_list_add_tail(&node->active_ios, io); in ocs_scsi_io_alloc()
229 return io; in ocs_scsi_io_alloc()
234 * @brief Free a SCSI IO context (internal).
237 * The IO context previously allocated using ocs_scsi_io_alloc()
241 * @param arg Pointer to the IO context.
248 ocs_io_t *io = (ocs_io_t *)arg; in _ocs_scsi_io_free() local
249 ocs_t *ocs = io->ocs; in _ocs_scsi_io_free()
250 ocs_node_t *node = io->node; in _ocs_scsi_io_free()
253 ocs_assert(io != NULL); in _ocs_scsi_io_free()
255 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in _ocs_scsi_io_free()
257 ocs_assert(ocs_io_busy(io)); in _ocs_scsi_io_free()
260 ocs_list_remove(&node->active_ios, io); in _ocs_scsi_io_free()
268 io->node = NULL; in _ocs_scsi_io_free()
269 ocs_io_free(ocs, io); in _ocs_scsi_io_free()
275 * @brief Free a SCSI IO context.
278 * The IO context previously allocated using ocs_scsi_io_alloc() is freed.
280 * @param io Pointer to the IO context.
285 ocs_scsi_io_free(ocs_io_t *io) in ocs_scsi_io_free() argument
287 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in ocs_scsi_io_free()
288 ocs_assert(ocs_ref_read_count(&io->ref) > 0); in ocs_scsi_io_free()
289 ocs_ref_put(&io->ref); /* ocs_ref_get(): ocs_scsi_io_alloc() */ in ocs_scsi_io_free()
293 ocs_scsi_send_io(ocs_hw_io_type_e type, ocs_node_t *node, ocs_io_t *io, uint64_t lun,
303 * Function is called upon the completion of a target IO request.
305 * @param hio Pointer to the HW IO structure.
306 * @param rnode Remote node associated with the IO that is completing.
310 * @param app Application-specific data (generally a pointer to the IO context).
319 ocs_io_t *io = app; in ocs_target_io_cb() local
325 ocs_hw_dif_info_t *dif_info = &io->hw_dif; in ocs_target_io_cb()
328 ocs_assert(io); in ocs_target_io_cb()
330 scsi_io_trace(io, "status x%x ext_status x%x\n", status, ext_status); in ocs_target_io_cb()
332 ocs = io->ocs; in ocs_target_io_cb()
335 ocs_scsi_io_free_ovfl(io); in ocs_target_io_cb()
337 io->transferred += length; in ocs_target_io_cb()
340 if (io->scsi_tgt_cb) { in ocs_target_io_cb()
341 ocs_scsi_io_cb_t cb = io->scsi_tgt_cb; in ocs_target_io_cb()
345 io->scsi_tgt_cb = NULL; in ocs_target_io_cb()
350 if ((status == 0) && (io->auto_resp)) in ocs_target_io_cb()
377 scsi_status = ocs_scsi_dif_check_unknown(io, 0, io->wire_len, is_crc); in ocs_target_io_cb()
389 scsi_status = ocs_scsi_dif_check_unknown(io, length, additional_length, is_crc); in ocs_target_io_cb()
417 /* target IO timed out */ in ocs_target_io_cb()
422 /* Target IO cancelled by HW */ in ocs_target_io_cb()
431 cb(io, scsi_status, flags, io->scsi_tgt_cb_arg); in ocs_target_io_cb()
437 * @brief Determine if an IO is using CRC for DIF guard format.
439 * @param direction IO direction: 1 for write, 0 for read.
491 * @param io Pointer to the IO object.
500 ocs_scsi_dif_check_unknown(ocs_io_t *io, uint32_t length, uint32_t check_length, int is_crc) in ocs_scsi_dif_check_unknown() argument
503 ocs_t *ocs = io->ocs; in ocs_scsi_dif_check_unknown()
504 ocs_hw_dif_info_t *dif_info = &io->hw_dif; in ocs_scsi_dif_check_unknown()
513 ocs_scsi_dif_info_t scsi_dif_info = io->scsi_dif_info; in ocs_scsi_dif_check_unknown()
515 blocksize = ocs_hw_dif_mem_blocksize(&io->hw_dif, TRUE); in ocs_scsi_dif_check_unknown()
524 …addrlen_count = ocs_scsi_get_block_vaddr(io, (scsi_dif_info.lba + i), addrlen, ARRAY_SIZE(addrlen)… in ocs_scsi_dif_check_unknown()
901 * @brief This function logs the SGLs for an IO.
903 * @param io Pointer to the IO context.
905 static void ocs_log_sgl(ocs_io_t *io) in ocs_log_sgl() argument
907 ocs_hw_io_t *hio = io->hio; in ocs_log_sgl()
913 scsi_io_trace(io, "def_sgl at 0x%x 0x%08x\n", in ocs_log_sgl()
920 scsi_io_trace(io, "SGL %2d 0x%08x 0x%08x 0x%08x 0x%08x\n", in ocs_log_sgl()
930 scsi_io_trace(io, "Overflow at 0x%x 0x%08x\n", in ocs_log_sgl()
936 scsi_io_trace(io, "SGL %2d 0x%08x 0x%08x 0x%08x 0x%08x\n", in ocs_log_sgl()
950 * Invoke the HW callback function for a given IO. This function is called
963 ocs_io_t *io = arg; in ocs_scsi_check_pending_async_cb() local
965 if (io != NULL) { in ocs_scsi_check_pending_async_cb()
966 if (io->hw_cb != NULL) { in ocs_scsi_check_pending_async_cb()
967 ocs_hw_done_t cb = io->hw_cb; in ocs_scsi_check_pending_async_cb()
969 io->hw_cb = NULL; in ocs_scsi_check_pending_async_cb()
970 cb(io->hio, NULL, 0, SLI4_FC_WCQE_STATUS_DISPATCH_ERROR, 0, io); in ocs_scsi_check_pending_async_cb()
980 * If there are IOs on the pending list, and a HW IO is available, then
992 ocs_io_t *io; in ocs_scsi_check_pending() local
1009 io = ocs_list_remove_head(&xport->io_pending_list); in ocs_scsi_check_pending()
1010 if (io != NULL) { in ocs_scsi_check_pending()
1011 if (io->io_type == OCS_IO_TYPE_ABORT) { in ocs_scsi_check_pending()
1017 * No HW IO available. in ocs_scsi_check_pending()
1018 * Put IO back on the front of pending list in ocs_scsi_check_pending()
1020 ocs_list_add_head(&xport->io_pending_list, io); in ocs_scsi_check_pending()
1021 io = NULL; in ocs_scsi_check_pending()
1023 hio->eq = io->hw_priv; in ocs_scsi_check_pending()
1027 /* Must drop the lock before dispatching the IO */ in ocs_scsi_check_pending()
1030 if (io != NULL) { in ocs_scsi_check_pending()
1034 * We pulled an IO off the pending list, in ocs_scsi_check_pending()
1035 * and either got an HW IO or don't need one in ocs_scsi_check_pending()
1039 status = ocs_scsi_io_dispatch_no_hw_io(io); in ocs_scsi_check_pending()
1041 status = ocs_scsi_io_dispatch_hw_io(io, hio); in ocs_scsi_check_pending()
1049 if (ocs_hw_async_call(&ocs->hw, ocs_scsi_check_pending_async_cb, io)) { in ocs_scsi_check_pending()
1054 } while (io != NULL); in ocs_scsi_check_pending()
1059 * active IO and the abort is on the pending list. in ocs_scsi_check_pending()
1066 ocs_list_foreach(&xport->io_pending_list, io) { in ocs_scsi_check_pending()
1067 if (io->io_type == OCS_IO_TYPE_ABORT) { in ocs_scsi_check_pending()
1068 if (io->io_to_abort->hio != NULL) { in ocs_scsi_check_pending()
1069 /* This IO has a HW IO, so it is active. Dispatch the abort. */ in ocs_scsi_check_pending()
1077 ocs_list_remove(&xport->io_pending_list, io); in ocs_scsi_check_pending()
1085 status = ocs_scsi_io_dispatch_no_hw_io(io); in ocs_scsi_check_pending()
1087 if (ocs_hw_async_call(&ocs->hw, ocs_scsi_check_pending_async_cb, io)) { in ocs_scsi_check_pending()
1099 * @brief Attempt to dispatch a non-abort IO
1102 * An IO is dispatched:
1103 * - if the pending list is not empty, add IO to pending list
1105 * - if pending list is empty, try to allocate a HW IO. If none
1106 * is available, place this IO at the tail of the pending IO
1108 * - if HW IO is available, attach this IO to the HW IO and
1111 * @param io Pointer to IO structure.
1118 ocs_scsi_io_dispatch(ocs_io_t *io, void *cb) in ocs_scsi_io_dispatch() argument
1121 ocs_t *ocs = io->ocs; in ocs_scsi_io_dispatch()
1124 ocs_assert(io->cmd_tgt || io->cmd_ini, -1); in ocs_scsi_io_dispatch()
1125 ocs_assert((io->io_type != OCS_IO_TYPE_ABORT), -1); in ocs_scsi_io_dispatch()
1126 io->hw_cb = cb; in ocs_scsi_io_dispatch()
1129 * if this IO already has a HW IO, then this is either not the first phase of in ocs_scsi_io_dispatch()
1130 * the IO. Send it to the HW. in ocs_scsi_io_dispatch()
1132 if (io->hio != NULL) { in ocs_scsi_io_dispatch()
1133 return ocs_scsi_io_dispatch_hw_io(io, io->hio); in ocs_scsi_io_dispatch()
1137 * We don't already have a HW IO associated with the IO. First check in ocs_scsi_io_dispatch()
1138 * the pending list. If not empty, add IO to the tail and process the in ocs_scsi_io_dispatch()
1144 * If this is a low latency request, the put at the front of the IO pending in ocs_scsi_io_dispatch()
1147 if (io->low_latency) { in ocs_scsi_io_dispatch()
1148 ocs_list_add_head(&xport->io_pending_list, io); in ocs_scsi_io_dispatch()
1150 ocs_list_add_tail(&xport->io_pending_list, io); in ocs_scsi_io_dispatch()
1163 * We don't have a HW IO associated with the IO and there's nothing in ocs_scsi_io_dispatch()
1164 * on the pending list. Attempt to allocate a HW IO and dispatch it. in ocs_scsi_io_dispatch()
1166 hio = ocs_hw_io_alloc(&io->ocs->hw); in ocs_scsi_io_dispatch()
1168 /* Couldn't get a HW IO. Save this IO on the pending list */ in ocs_scsi_io_dispatch()
1170 ocs_list_add_tail(&xport->io_pending_list, io); in ocs_scsi_io_dispatch()
1178 /* We successfully allocated a HW IO; dispatch to HW */ in ocs_scsi_io_dispatch()
1179 return ocs_scsi_io_dispatch_hw_io(io, hio); in ocs_scsi_io_dispatch()
1183 * @brief Attempt to dispatch an Abort IO.
1186 * An Abort IO is dispatched:
1187 * - if the pending list is not empty, add IO to pending list
1191 * @param io Pointer to IO structure.
1198 ocs_scsi_io_dispatch_abort(ocs_io_t *io, void *cb) in ocs_scsi_io_dispatch_abort() argument
1200 ocs_t *ocs = io->ocs; in ocs_scsi_io_dispatch_abort()
1203 ocs_assert((io->io_type == OCS_IO_TYPE_ABORT), -1); in ocs_scsi_io_dispatch_abort()
1204 io->hw_cb = cb; in ocs_scsi_io_dispatch_abort()
1207 * For aborts, we don't need a HW IO, but we still want to pass through in ocs_scsi_io_dispatch_abort()
1213 ocs_list_add_tail(&xport->io_pending_list, io); in ocs_scsi_io_dispatch_abort()
1225 return ocs_scsi_io_dispatch_no_hw_io(io); in ocs_scsi_io_dispatch_abort()
1230 * @brief Dispatch IO
1233 * An IO and its associated HW IO is dispatched to the HW.
1235 * @param io Pointer to IO structure.
1236 * @param hio Pointer to HW IO structure from which IO will be
1243 ocs_scsi_io_dispatch_hw_io(ocs_io_t *io, ocs_hw_io_t *hio) in ocs_scsi_io_dispatch_hw_io() argument
1246 ocs_t *ocs = io->ocs; in ocs_scsi_io_dispatch_hw_io()
1248 /* Got a HW IO; update ini/tgt_task_tag with HW IO info and dispatch */ in ocs_scsi_io_dispatch_hw_io()
1249 io->hio = hio; in ocs_scsi_io_dispatch_hw_io()
1250 if (io->cmd_tgt) { in ocs_scsi_io_dispatch_hw_io()
1251 io->tgt_task_tag = hio->indicator; in ocs_scsi_io_dispatch_hw_io()
1252 } else if (io->cmd_ini) { in ocs_scsi_io_dispatch_hw_io()
1253 io->init_task_tag = hio->indicator; in ocs_scsi_io_dispatch_hw_io()
1255 io->hw_tag = hio->reqtag; in ocs_scsi_io_dispatch_hw_io()
1257 hio->eq = io->hw_priv; in ocs_scsi_io_dispatch_hw_io()
1260 switch(io->wq_steering) { in ocs_scsi_io_dispatch_hw_io()
1272 switch (io->io_type) { in ocs_scsi_io_dispatch_hw_io()
1285 total_count = ocs_scsi_count_sgls(&io->hw_dif, io->sgl, io->sgl_count); in ocs_scsi_io_dispatch_hw_io()
1294 rc = ocs_dma_alloc(ocs, &io->ovfl_sgl, count*sizeof(sli4_sge_t), 64); in ocs_scsi_io_dispatch_hw_io()
1299 rc = ocs_hw_io_register_sgl(&ocs->hw, io->hio, &io->ovfl_sgl, count); in ocs_scsi_io_dispatch_hw_io()
1301 ocs_scsi_io_free_ovfl(io); in ocs_scsi_io_dispatch_hw_io()
1306 io->node->chained_io_count++; in ocs_scsi_io_dispatch_hw_io()
1309 rc = ocs_scsi_build_sgls(&ocs->hw, io->hio, &io->hw_dif, io->sgl, io->sgl_count, io->hio_type); in ocs_scsi_io_dispatch_hw_io()
1311 ocs_scsi_io_free_ovfl(io); in ocs_scsi_io_dispatch_hw_io()
1316 ocs_log_sgl(io); in ocs_scsi_io_dispatch_hw_io()
1319 if (io->app_id) { in ocs_scsi_io_dispatch_hw_io()
1320 io->iparam.fcp_tgt.app_id = io->app_id; in ocs_scsi_io_dispatch_hw_io()
1323 …rc = ocs_hw_io_send(&io->ocs->hw, io->hio_type, io->hio, io->wire_len, &io->iparam, &io->node->rno… in ocs_scsi_io_dispatch_hw_io()
1324 io->hw_cb, io); in ocs_scsi_io_dispatch_hw_io()
1329 rc = ocs_hw_srrs_send(&ocs->hw, io->hio_type, io->hio, in ocs_scsi_io_dispatch_hw_io()
1330 &io->els_req, io->wire_len, in ocs_scsi_io_dispatch_hw_io()
1331 &io->els_rsp, &io->node->rnode, &io->iparam, in ocs_scsi_io_dispatch_hw_io()
1332 io->hw_cb, io); in ocs_scsi_io_dispatch_hw_io()
1336 rc = ocs_hw_srrs_send(&ocs->hw, io->hio_type, io->hio, in ocs_scsi_io_dispatch_hw_io()
1337 &io->els_rsp, io->wire_len, in ocs_scsi_io_dispatch_hw_io()
1338 NULL, &io->node->rnode, &io->iparam, in ocs_scsi_io_dispatch_hw_io()
1339 io->hw_cb, io); in ocs_scsi_io_dispatch_hw_io()
1345 rc = ocs_hw_srrs_send(&ocs->hw, io->hio_type, io->hio, in ocs_scsi_io_dispatch_hw_io()
1346 NULL, 0, NULL, &io->node->rnode, &io->iparam, io->hw_cb, io); in ocs_scsi_io_dispatch_hw_io()
1350 scsi_io_printf(io, "Unknown IO type=%d\n", io->io_type); in ocs_scsi_io_dispatch_hw_io()
1358 * @brief Dispatch IO
1361 * An IO that does require a HW IO is dispatched to the HW.
1363 * @param io Pointer to IO structure.
1369 ocs_scsi_io_dispatch_no_hw_io(ocs_io_t *io) in ocs_scsi_io_dispatch_no_hw_io() argument
1373 switch (io->io_type) { in ocs_scsi_io_dispatch_no_hw_io()
1376 ocs_assert(io->io_to_abort, -1); in ocs_scsi_io_dispatch_no_hw_io()
1377 hio_to_abort = io->io_to_abort->hio; in ocs_scsi_io_dispatch_no_hw_io()
1381 * If "IO to abort" does not have an associated HW IO, immediately in ocs_scsi_io_dispatch_no_hw_io()
1384 * have a HW IO. in ocs_scsi_io_dispatch_no_hw_io()
1390 scsi_io_printf(io, "IO: " SCSI_IOFMT " not active\n", in ocs_scsi_io_dispatch_no_hw_io()
1391 SCSI_IOFMT_ARGS(io->io_to_abort)); in ocs_scsi_io_dispatch_no_hw_io()
1392 ((ocs_hw_done_t)io->hw_cb)(io->hio, NULL, 0, SLI4_FC_WCQE_STATUS_SUCCESS, 0, io); in ocs_scsi_io_dispatch_no_hw_io()
1395 /* HW IO is valid, abort it */ in ocs_scsi_io_dispatch_no_hw_io()
1396 scsi_io_printf(io, "aborting " SCSI_IOFMT "\n", SCSI_IOFMT_ARGS(io->io_to_abort)); in ocs_scsi_io_dispatch_no_hw_io()
1397 rc = ocs_hw_io_abort(&io->ocs->hw, hio_to_abort, io->send_abts, in ocs_scsi_io_dispatch_no_hw_io()
1398 io->hw_cb, io); in ocs_scsi_io_dispatch_no_hw_io()
1404 scsi_io_printf(io, "Failed to abort IO: " SCSI_IOFMT " status=%d\n", in ocs_scsi_io_dispatch_no_hw_io()
1405 SCSI_IOFMT_ARGS(io->io_to_abort), rc); in ocs_scsi_io_dispatch_no_hw_io()
1407 ((ocs_hw_done_t)io->hw_cb)(io->hio, NULL, 0, status, 0, io); in ocs_scsi_io_dispatch_no_hw_io()
1415 scsi_io_printf(io, "Unknown IO type=%d\n", io->io_type); in ocs_scsi_io_dispatch_no_hw_io()
1436 * IO has completed (OCS_SCSI_IO_COMPL) and another data phase or response may be sent;
1437 * that the IO has completed and no response needs to be sent (OCS_SCSI_IO_COMPL_NO_RSP);
1438 * or that the IO was aborted (OCS_SCSI_IO_ABORTED).
1440 * @param io Pointer to the IO context.
1446 * @param type HW IO type.
1455 ocs_scsi_xfer_data(ocs_io_t *io, uint32_t flags, in ocs_scsi_xfer_data() argument
1470 ocs_assert(io, -1); in ocs_scsi_xfer_data()
1473 ocs_hw_get(&io->ocs->hw, OCS_HW_DISABLE_AR_TGT_DIF, &disable_ar_tgt_dif); in ocs_scsi_xfer_data()
1479 io->sgl_count = sgl_count; in ocs_scsi_xfer_data()
1482 if (sgl && (sgl != io->sgl)) { in ocs_scsi_xfer_data()
1483 ocs_assert(sgl_count <= io->sgl_allocated, -1); in ocs_scsi_xfer_data()
1484 ocs_memcpy(io->sgl, sgl, sgl_count*sizeof(*io->sgl)); in ocs_scsi_xfer_data()
1487 ocs = io->ocs; in ocs_scsi_xfer_data()
1489 ocs_assert(io->node, -1); in ocs_scsi_xfer_data()
1491 …scsi_io_trace(io, "%s wire_len %d\n", (type == OCS_HW_IO_TARGET_READ) ? "send" : "recv", xwire_len… in ocs_scsi_xfer_data()
1495 ocs_assert(io->exp_xfer_len > io->transferred, -1); in ocs_scsi_xfer_data()
1497 io->hio_type = type; in ocs_scsi_xfer_data()
1499 io->scsi_tgt_cb = cb; in ocs_scsi_xfer_data()
1500 io->scsi_tgt_cb_arg = arg; in ocs_scsi_xfer_data()
1502 rc = ocs_scsi_convert_dif_info(ocs, dif_info, &io->hw_dif); in ocs_scsi_xfer_data()
1509 io->scsi_dif_info = *dif_info; in ocs_scsi_xfer_data()
1512 io->wire_len = MIN(xwire_len, io->exp_xfer_len - io->transferred); in ocs_scsi_xfer_data()
1513 residual = (xwire_len - io->wire_len); in ocs_scsi_xfer_data()
1515 ocs_memset(&io->iparam, 0, sizeof(io->iparam)); in ocs_scsi_xfer_data()
1516 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in ocs_scsi_xfer_data()
1517 io->iparam.fcp_tgt.offset = io->transferred; in ocs_scsi_xfer_data()
1518 io->iparam.fcp_tgt.dif_oper = io->hw_dif.dif; in ocs_scsi_xfer_data()
1519 io->iparam.fcp_tgt.blk_size = io->hw_dif.blk_size; in ocs_scsi_xfer_data()
1520 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in ocs_scsi_xfer_data()
1521 io->iparam.fcp_tgt.timeout = io->timeout; in ocs_scsi_xfer_data()
1527 …(residual == 0) && ((io->transferred + io->wire_len) == io->exp_xfer_len) && (!(flags & OCS_SCSI_N… in ocs_scsi_xfer_data()
1528 io->iparam.fcp_tgt.flags |= SLI4_IO_AUTO_GOOD_RESPONSE; in ocs_scsi_xfer_data()
1529 io->auto_resp = TRUE; in ocs_scsi_xfer_data()
1531 io->auto_resp = FALSE; in ocs_scsi_xfer_data()
1535 io->xfer_req = io->wire_len; in ocs_scsi_xfer_data()
1540 io->transferred += residual; in ocs_scsi_xfer_data()
1545 ocs_scsi_sgl_t *sgl_ptr = &io->sgl[sgl_count-1]; in ocs_scsi_xfer_data()
1555 io->sgl_count--; in ocs_scsi_xfer_data()
1562 io->low_latency = (flags & OCS_SCSI_LOW_LATENCY) != 0; in ocs_scsi_xfer_data()
1563 io->wq_steering = (flags & OCS_SCSI_WQ_STEERING_MASK) >> OCS_SCSI_WQ_STEERING_SHIFT; in ocs_scsi_xfer_data()
1564 io->wq_class = (flags & OCS_SCSI_WQ_CLASS_MASK) >> OCS_SCSI_WQ_CLASS_SHIFT; in ocs_scsi_xfer_data()
1566 return ocs_scsi_io_dispatch(io, ocs_target_io_cb); in ocs_scsi_xfer_data()
1570 ocs_scsi_send_rd_data(ocs_io_t *io, uint32_t flags, in ocs_scsi_send_rd_data() argument
1575 return ocs_scsi_xfer_data(io, flags, dif_info, sgl, sgl_count, len, OCS_HW_IO_TARGET_READ, in ocs_scsi_send_rd_data()
1576 enable_tsend_auto_resp(io->ocs), cb, arg); in ocs_scsi_send_rd_data()
1580 ocs_scsi_recv_wr_data(ocs_io_t *io, uint32_t flags, in ocs_scsi_recv_wr_data() argument
1585 return ocs_scsi_xfer_data(io, flags, dif_info, sgl, sgl_count, len, OCS_HW_IO_TARGET_WRITE, in ocs_scsi_recv_wr_data()
1586 enable_treceive_auto_resp(io->ocs), cb, arg); in ocs_scsi_recv_wr_data()
1596 * @param io Pointer to IO object.
1601 ocs_scsi_io_free_ovfl(ocs_io_t *io) { in ocs_scsi_io_free_ovfl() argument
1602 if (io->ovfl_sgl.size) { in ocs_scsi_io_free_ovfl()
1603 ocs_dma_free(io->ocs, &io->ovfl_sgl); in ocs_scsi_io_free_ovfl()
1618 * clean up its IO context resources and call ocs_scsi_io_complete().
1620 * @param io Pointer to the IO context.
1629 ocs_scsi_send_resp(ocs_io_t *io, uint32_t flags, ocs_scsi_cmd_resp_t *rsp, ocs_scsi_io_cb_t cb, voi… in ocs_scsi_send_resp() argument
1639 ocs_assert(io, -1); in ocs_scsi_send_resp()
1641 ocs = io->ocs; in ocs_scsi_send_resp()
1644 ocs_assert(io->node, -1); in ocs_scsi_send_resp()
1646 ocs_scsi_convert_dif_info(ocs, NULL, &io->hw_dif); in ocs_scsi_send_resp()
1655 residual = io->exp_xfer_len - io->transferred; in ocs_scsi_send_resp()
1658 io->wire_len = 0; in ocs_scsi_send_resp()
1659 io->hio_type = OCS_HW_IO_TARGET_RSP; in ocs_scsi_send_resp()
1661 io->scsi_tgt_cb = cb; in ocs_scsi_send_resp()
1662 io->scsi_tgt_cb_arg = arg; in ocs_scsi_send_resp()
1664 ocs_memset(&io->iparam, 0, sizeof(io->iparam)); in ocs_scsi_send_resp()
1665 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in ocs_scsi_send_resp()
1666 io->iparam.fcp_tgt.offset = 0; in ocs_scsi_send_resp()
1667 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in ocs_scsi_send_resp()
1668 io->iparam.fcp_tgt.timeout = io->timeout; in ocs_scsi_send_resp()
1671 io->low_latency = (flags & OCS_SCSI_LOW_LATENCY) != 0; in ocs_scsi_send_resp()
1672 io->wq_steering = (flags & OCS_SCSI_WQ_STEERING_MASK) >> OCS_SCSI_WQ_STEERING_SHIFT; in ocs_scsi_send_resp()
1673 io->wq_class = (flags & OCS_SCSI_WQ_CLASS_MASK) >> OCS_SCSI_WQ_CLASS_SHIFT; in ocs_scsi_send_resp()
1676 fcp_rsp_iu_t *fcprsp = io->rspbuf.virt; in ocs_scsi_send_resp()
1687 io->wire_len += (sizeof(*fcprsp) - sizeof(fcprsp->data)); in ocs_scsi_send_resp()
1712 io->wire_len += sense_data_length; in ocs_scsi_send_resp()
1715 io->sgl[0].addr = io->rspbuf.phys; in ocs_scsi_send_resp()
1716 io->sgl[0].dif_addr = 0; in ocs_scsi_send_resp()
1717 io->sgl[0].len = io->wire_len; in ocs_scsi_send_resp()
1718 io->sgl_count = 1; in ocs_scsi_send_resp()
1722 io->iparam.fcp_tgt.flags |= SLI4_IO_AUTO_GOOD_RESPONSE; in ocs_scsi_send_resp()
1725 return ocs_scsi_io_dispatch(io, ocs_target_io_cb); in ocs_scsi_send_resp()
1736 * clean up its IO context resources and call ocs_scsi_io_complete().
1738 * @param io Pointer to the IO context.
1747 ocs_scsi_send_tmf_resp(ocs_io_t *io, ocs_scsi_tmf_resp_e rspcode, uint8_t addl_rsp_info[3], in ocs_scsi_send_tmf_resp() argument
1756 ocs_assert(io, -1); in ocs_scsi_send_tmf_resp()
1757 ocs_assert(io->ocs, -1); in ocs_scsi_send_tmf_resp()
1758 ocs_assert(io->node, -1); in ocs_scsi_send_tmf_resp()
1760 ocs = io->ocs; in ocs_scsi_send_tmf_resp()
1762 io->wire_len = 0; in ocs_scsi_send_tmf_resp()
1763 ocs_scsi_convert_dif_info(ocs, NULL, &io->hw_dif); in ocs_scsi_send_tmf_resp()
1787 io->hio_type = OCS_HW_IO_TARGET_RSP; in ocs_scsi_send_tmf_resp()
1789 io->scsi_tgt_cb = cb; in ocs_scsi_send_tmf_resp()
1790 io->scsi_tgt_cb_arg = arg; in ocs_scsi_send_tmf_resp()
1792 if (io->tmf_cmd == OCS_SCSI_TMF_ABORT_TASK) { in ocs_scsi_send_tmf_resp()
1793 rc = ocs_target_send_bls_resp(io, cb, arg); in ocs_scsi_send_tmf_resp()
1798 fcprsp = io->rspbuf.virt; in ocs_scsi_send_tmf_resp()
1809 io->wire_len = sizeof(*fcprsp) - sizeof(fcprsp->data) + sizeof(*rspinfo); in ocs_scsi_send_tmf_resp()
1813 io->sgl[0].addr = io->rspbuf.phys; in ocs_scsi_send_tmf_resp()
1814 io->sgl[0].dif_addr = 0; in ocs_scsi_send_tmf_resp()
1815 io->sgl[0].len = io->wire_len; in ocs_scsi_send_tmf_resp()
1816 io->sgl_count = 1; in ocs_scsi_send_tmf_resp()
1818 ocs_memset(&io->iparam, 0, sizeof(io->iparam)); in ocs_scsi_send_tmf_resp()
1819 io->iparam.fcp_tgt.ox_id = io->init_task_tag; in ocs_scsi_send_tmf_resp()
1820 io->iparam.fcp_tgt.offset = 0; in ocs_scsi_send_tmf_resp()
1821 io->iparam.fcp_tgt.cs_ctl = io->cs_ctl; in ocs_scsi_send_tmf_resp()
1822 io->iparam.fcp_tgt.timeout = io->timeout; in ocs_scsi_send_tmf_resp()
1824 rc = ocs_scsi_io_dispatch(io, ocs_target_io_cb); in ocs_scsi_send_tmf_resp()
1835 * @param hio HW IO context.
1848 ocs_io_t *io = app; in ocs_target_abort_cb() local
1852 ocs_assert(io, -1); in ocs_target_abort_cb()
1853 ocs_assert(io->ocs, -1); in ocs_target_abort_cb()
1855 ocs = io->ocs; in ocs_target_abort_cb()
1857 if (io->abort_cb) { in ocs_target_abort_cb()
1858 ocs_scsi_io_cb_t abort_cb = io->abort_cb; in ocs_target_abort_cb()
1859 void *abort_cb_arg = io->abort_cb_arg; in ocs_target_abort_cb()
1861 io->abort_cb = NULL; in ocs_target_abort_cb()
1862 io->abort_cb_arg = NULL; in ocs_target_abort_cb()
1890 abort_cb(io->io_to_abort, scsi_status, 0, abort_cb_arg); in ocs_target_abort_cb()
1893 ocs_assert(io != io->io_to_abort, -1); in ocs_target_abort_cb()
1895 /* done with IO to abort */ in ocs_target_abort_cb()
1896 ocs_ref_put(&io->io_to_abort->ref); /* ocs_ref_get(): ocs_scsi_tgt_abort_io() */ in ocs_target_abort_cb()
1898 ocs_io_free(ocs, io); in ocs_target_abort_cb()
1906 * @brief Abort a target IO.
1912 * @param io IO context.
1919 ocs_scsi_tgt_abort_io(ocs_io_t *io, ocs_scsi_io_cb_t cb, void *arg) in ocs_scsi_tgt_abort_io() argument
1926 ocs_assert(io, -1); in ocs_scsi_tgt_abort_io()
1927 ocs_assert(io->node, -1); in ocs_scsi_tgt_abort_io()
1928 ocs_assert(io->ocs, -1); in ocs_scsi_tgt_abort_io()
1930 ocs = io->ocs; in ocs_scsi_tgt_abort_io()
1933 /* take a reference on IO being aborted */ in ocs_scsi_tgt_abort_io()
1934 if ((ocs_ref_get_unless_zero(&io->ref) == 0)) { in ocs_scsi_tgt_abort_io()
1936 scsi_io_printf(io, "command no longer active\n"); in ocs_scsi_tgt_abort_io()
1941 * allocate a new IO to send the abort request. Use ocs_io_alloc() directly, as in ocs_scsi_tgt_abort_io()
1942 * we need an IO object that will not fail allocation due to allocations being in ocs_scsi_tgt_abort_io()
1948 ocs_ref_put(&io->ref); /* ocs_ref_get(): same function */ in ocs_scsi_tgt_abort_io()
1957 abort_io->node = io->node; in ocs_scsi_tgt_abort_io()
1962 abort_io->io_to_abort = io; in ocs_scsi_tgt_abort_io()
1967 /* now dispatch IO */ in ocs_scsi_tgt_abort_io()
1970 ocs_ref_put(&io->ref); /* ocs_ref_get(): same function */ in ocs_scsi_tgt_abort_io()
1981 * @param hio HW IO context.
1994 ocs_io_t *io = app; in ocs_target_bls_resp_cb() local
1998 ocs_assert(io, -1); in ocs_target_bls_resp_cb()
1999 ocs_assert(io->ocs, -1); in ocs_target_bls_resp_cb()
2001 ocs = io->ocs; in ocs_target_bls_resp_cb()
2005 io_error_log(io, "s=%#x x=%#x\n", status, ext_status); in ocs_target_bls_resp_cb()
2011 if (io->bls_cb) { in ocs_target_bls_resp_cb()
2012 ocs_scsi_io_cb_t bls_cb = io->bls_cb; in ocs_target_bls_resp_cb()
2013 void *bls_cb_arg = io->bls_cb_arg; in ocs_target_bls_resp_cb()
2015 io->bls_cb = NULL; in ocs_target_bls_resp_cb()
2016 io->bls_cb_arg = NULL; in ocs_target_bls_resp_cb()
2019 bls_cb(io, bls_status, 0, bls_cb_arg); in ocs_target_bls_resp_cb()
2030 * An abort request is completed by posting a BA_ACC for the IO that requested the abort.
2032 * @param io Pointer to the IO context.
2040 ocs_target_send_bls_resp(ocs_io_t *io, ocs_scsi_io_cb_t cb, void *arg) in ocs_target_send_bls_resp() argument
2045 ocs_assert(io, -1); in ocs_target_send_bls_resp()
2047 /* fill out IO structure with everything needed to send BA_ACC */ in ocs_target_send_bls_resp()
2048 ocs_memset(&io->iparam, 0, sizeof(io->iparam)); in ocs_target_send_bls_resp()
2049 io->iparam.bls.ox_id = io->init_task_tag; in ocs_target_send_bls_resp()
2050 io->iparam.bls.rx_id = io->abort_rx_id; in ocs_target_send_bls_resp()
2052 acc = (void *)io->iparam.bls.payload; in ocs_target_send_bls_resp()
2054 ocs_memset(io->iparam.bls.payload, 0, sizeof(io->iparam.bls.payload)); in ocs_target_send_bls_resp()
2055 acc->ox_id = io->iparam.bls.ox_id; in ocs_target_send_bls_resp()
2056 acc->rx_id = io->iparam.bls.rx_id; in ocs_target_send_bls_resp()
2059 /* generic io fields have already been populated */ in ocs_target_send_bls_resp()
2062 io->io_type = OCS_IO_TYPE_BLS_RESP; in ocs_target_send_bls_resp()
2063 io->display_name = "bls_rsp"; in ocs_target_send_bls_resp()
2064 io->hio_type = OCS_HW_BLS_ACC; in ocs_target_send_bls_resp()
2065 io->bls_cb = cb; in ocs_target_send_bls_resp()
2066 io->bls_cb_arg = arg; in ocs_target_send_bls_resp()
2068 /* dispatch IO */ in ocs_target_send_bls_resp()
2069 rc = ocs_scsi_io_dispatch(io, ocs_target_bls_resp_cb); in ocs_target_send_bls_resp()
2075 * @brief Notify the base driver that the IO is complete.
2078 * This function is called by a target-server to notify the base driver that an IO
2083 * @param io Pointer to IO context.
2088 ocs_scsi_io_complete(ocs_io_t *io) in ocs_scsi_io_complete() argument
2090 ocs_assert(io); in ocs_scsi_io_complete()
2092 if (!ocs_io_busy(io)) { in ocs_scsi_io_complete()
2093 ocs_log_test(io->ocs, "Got completion for non-busy io with tag 0x%x\n", io->tag); in ocs_scsi_io_complete()
2097 scsi_io_trace(io, "freeing io 0x%p %s\n", io, io->display_name); in ocs_scsi_io_complete()
2098 ocs_assert(ocs_ref_read_count(&io->ref) > 0); in ocs_scsi_io_complete()
2099 ocs_ref_put(&io->ref); /* ocs_ref_get(): ocs_scsi_io_alloc() */ in ocs_scsi_io_complete()
2103 * @brief Handle initiator IO completion.
2108 * @param hio HW IO context.
2122 ocs_io_t *io = app; in ocs_initiator_io_cb() local
2126 ocs_assert(io); in ocs_initiator_io_cb()
2127 ocs_assert(io->scsi_ini_cb); in ocs_initiator_io_cb()
2129 scsi_io_trace(io, "status x%x ext_status x%x\n", status, ext_status); in ocs_initiator_io_cb()
2131 ocs = io->ocs; in ocs_initiator_io_cb()
2134 ocs_scsi_io_free_ovfl(io); in ocs_initiator_io_cb()
2137 if (io->scsi_ini_cb) { in ocs_initiator_io_cb()
2138 fcp_rsp_iu_t *fcprsp = io->rspbuf.virt; in ocs_initiator_io_cb()
2140 ocs_scsi_rsp_io_cb_t cb = io->scsi_ini_cb; in ocs_initiator_io_cb()
2145 io->scsi_ini_cb = NULL; in ocs_initiator_io_cb()
2185 if (length != io->wire_len) { in ocs_initiator_io_cb()
2187 uint8_t *rsp_bytes = io->rspbuf.virt; in ocs_initiator_io_cb()
2199 ocs_log_test(io->ocs, "[%s]" SCSI_IOFMT "local reject=0x%02x\n", in ocs_initiator_io_cb()
2200 io->node->display_name, SCSI_IOFMT_ARGS(io), in ocs_initiator_io_cb()
2213 /* IO timed out */ in ocs_initiator_io_cb()
2232 cb(io, scsi_status, &rsp, flags, io->scsi_ini_cb_arg); in ocs_initiator_io_cb()
2239 * @brief Initiate initiator read IO.
2250 * @param io Pointer to the IO context.
2264 ocs_scsi_send_rd_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_len, in ocs_scsi_send_rd_io() argument
2271 …rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_READ, node, io, lun, 0, cdb, cdb_len, dif_info, sgl, sgl… in ocs_scsi_send_rd_io()
2279 * @brief Initiate initiator write IO.
2290 * @param io Pointer to IO context.
2303 int32_t ocs_scsi_send_wr_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t cdb_l… in ocs_scsi_send_wr_io() argument
2310 …rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_WRITE, node, io, lun, 0, cdb, cdb_len, dif_info, sgl, sg… in ocs_scsi_send_wr_io()
2318 * @brief Initiate initiator write IO.
2329 * @param io Pointer to IO context.
2344 ocs_scsi_send_wr_io_first_burst(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t c… in ocs_scsi_send_wr_io_first_burst() argument
2351 …rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_WRITE, node, io, lun, 0, cdb, cdb_len, dif_info, sgl, sg… in ocs_scsi_send_wr_io_first_burst()
2368 * @param io Pointer to the IO context.
2377 int32_t ocs_scsi_send_nodata_io(ocs_node_t *node, ocs_io_t *io, uint64_t lun, void *cdb, uint32_t c… in ocs_scsi_send_nodata_io() argument
2382 …rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_NODATA, node, io, lun, 0, cdb, cdb_len, NULL, NULL, 0, 0… in ocs_scsi_send_nodata_io()
2398 * @param io Pointer to the IO context.
2399 * @param io_to_abort Pointer to the IO context to abort in the
2401 * same the same ocs_io_t as @c io, provided that @c io does not
2414 ocs_scsi_send_tmf(ocs_node_t *node, ocs_io_t *io, ocs_io_t *io_to_abort, uint64_t lun, ocs_scsi_tmf… in ocs_scsi_send_tmf() argument
2418 ocs_assert(io, -1); in ocs_scsi_send_tmf()
2423 /* take a reference on IO being aborted */ in ocs_scsi_send_tmf()
2426 scsi_io_printf(io, "command no longer active\n"); in ocs_scsi_send_tmf()
2429 /* generic io fields have already been populated */ in ocs_scsi_send_tmf()
2432 io->io_type = OCS_IO_TYPE_ABORT; in ocs_scsi_send_tmf()
2433 io->display_name = "abort_task"; in ocs_scsi_send_tmf()
2434 io->io_to_abort = io_to_abort; in ocs_scsi_send_tmf()
2435 io->send_abts = TRUE; in ocs_scsi_send_tmf()
2436 io->scsi_ini_cb = cb; in ocs_scsi_send_tmf()
2437 io->scsi_ini_cb_arg = arg; in ocs_scsi_send_tmf()
2439 /* now dispatch IO */ in ocs_scsi_send_tmf()
2440 rc = ocs_scsi_io_dispatch_abort(io, ocs_scsi_abort_io_cb); in ocs_scsi_send_tmf()
2442 scsi_io_printf(io, "Failed to dispatch abort\n"); in ocs_scsi_send_tmf()
2443 ocs_ref_put(&io->ref); /* ocs_ref_get(): same function */ in ocs_scsi_send_tmf()
2446 io->display_name = "tmf"; in ocs_scsi_send_tmf()
2447 rc = ocs_scsi_send_io(OCS_HW_IO_INITIATOR_READ, node, io, lun, tmf, NULL, 0, NULL, in ocs_scsi_send_tmf()
2456 * @brief Send an FCP IO.
2459 * An FCP read/write IO command, with optional task management flags, is sent to @c node.
2461 * @param type HW IO type to send.
2462 * @param node Pointer to the node destination of the IO.
2463 * @param io Pointer to the IO context.
2479 /* tc: could elminiate LUN, as it's part of the IO structure */
2481 static int32_t ocs_scsi_send_io(ocs_hw_io_type_e type, ocs_node_t *node, ocs_io_t *io, uint64_t lun, in ocs_scsi_send_io() argument
2494 ocs_assert(io->node, -1); in ocs_scsi_send_io()
2495 ocs_assert(io->node == node, -1); in ocs_scsi_send_io()
2496 ocs_assert(io, -1); in ocs_scsi_send_io()
2497 ocs = io->ocs; in ocs_scsi_send_io()
2500 io->sgl_count = sgl_count; in ocs_scsi_send_io()
2503 if (sgl != io->sgl) { in ocs_scsi_send_io()
2504 ocs_assert(sgl_count <= io->sgl_allocated, -1); in ocs_scsi_send_io()
2505 ocs_memcpy(io->sgl, sgl, sizeof(*io->sgl) * sgl_count); in ocs_scsi_send_io()
2509 io->tgt_task_tag = 0xffff; in ocs_scsi_send_io()
2511 io->wire_len = wire_len; in ocs_scsi_send_io()
2512 io->hio_type = type; in ocs_scsi_send_io()
2525 scsi_io_printf(io, "%s len %d, %s\n", (io->hio_type == OCS_HW_IO_INITIATOR_READ) ? "read" : in ocs_scsi_send_io()
2526 (io->hio_type == OCS_HW_IO_INITIATOR_WRITE) ? "write" : "", io->wire_len, in ocs_scsi_send_io()
2530 ocs_assert(io->cmdbuf.virt, -1); in ocs_scsi_send_io()
2532 cmnd = io->cmdbuf.virt; in ocs_scsi_send_io()
2534 ocs_assert(sizeof(*cmnd) <= io->cmdbuf.size, -1); in ocs_scsi_send_io()
2609 *fcp_dl = ocs_htobe32(io->wire_len); in ocs_scsi_send_io()
2611 switch (io->hio_type) { in ocs_scsi_send_io()
2622 ocs_log_test(ocs, "bad IO type %d\n", io->hio_type); in ocs_scsi_send_io()
2626 rc = ocs_scsi_convert_dif_info(ocs, dif_info, &io->hw_dif); in ocs_scsi_send_io()
2631 io->scsi_ini_cb = cb; in ocs_scsi_send_io()
2632 io->scsi_ini_cb_arg = arg; in ocs_scsi_send_io()
2635 io->iparam.fcp_ini.cmnd = &io->cmdbuf; in ocs_scsi_send_io()
2636 io->iparam.fcp_ini.cmnd_size = cmnd_bytes; in ocs_scsi_send_io()
2637 io->iparam.fcp_ini.rsp = &io->rspbuf; in ocs_scsi_send_io()
2638 io->iparam.fcp_ini.flags = 0; in ocs_scsi_send_io()
2639 io->iparam.fcp_ini.dif_oper = io->hw_dif.dif; in ocs_scsi_send_io()
2640 io->iparam.fcp_ini.blk_size = io->hw_dif.blk_size; in ocs_scsi_send_io()
2641 io->iparam.fcp_ini.timeout = io->timeout; in ocs_scsi_send_io()
2642 io->iparam.fcp_ini.first_burst = first_burst; in ocs_scsi_send_io()
2644 return ocs_scsi_io_dispatch(io, ocs_initiator_io_cb); in ocs_scsi_send_io()
2649 * @brief Callback for an aborted IO.
2652 * Callback function invoked upon completion of an IO abort request.
2654 * @param hio HW IO context.
2659 * @param arg Application-specific callback, usually IO context.
2668 ocs_io_t *io = arg; in ocs_scsi_abort_io_cb() local
2672 ocs_assert(io, -1); in ocs_scsi_abort_io_cb()
2673 ocs_assert(ocs_io_busy(io), -1); in ocs_scsi_abort_io_cb()
2674 ocs_assert(io->ocs, -1); in ocs_scsi_abort_io_cb()
2675 ocs_assert(io->io_to_abort, -1); in ocs_scsi_abort_io_cb()
2676 ocs = io->ocs; in ocs_scsi_abort_io_cb()
2680 /* done with IO to abort */ in ocs_scsi_abort_io_cb()
2681 ocs_ref_put(&io->io_to_abort->ref); /* ocs_ref_get(): ocs_scsi_send_tmf() */ in ocs_scsi_abort_io_cb()
2683 ocs_scsi_io_free_ovfl(io); in ocs_scsi_abort_io_cb()
2706 if (io->scsi_ini_cb) { in ocs_scsi_abort_io_cb()
2707 (*io->scsi_ini_cb)(io, scsi_status, NULL, 0, io->scsi_ini_cb_arg); in ocs_scsi_abort_io_cb()
2709 ocs_scsi_io_free(io); in ocs_scsi_abort_io_cb()
2915 * Updates io->transferred, as required when using first burst, when the amount
2919 * @param io Pointer to the io object.
2925 ocs_scsi_update_first_burst_transferred(ocs_io_t *io, uint32_t transferred) in ocs_scsi_update_first_burst_transferred() argument
2927 io->transferred = transferred; in ocs_scsi_update_first_burst_transferred()