Lines Matching refs:io

48 void ocs_mgmt_io_list(ocs_textbuf_t *textbuf, void *io);
49 void ocs_mgmt_io_get_all(ocs_textbuf_t *textbuf, void *io);
50 int ocs_mgmt_io_get(ocs_textbuf_t *textbuf, char *parent, char *name, void *io);
125 ocs_io_t *io = ocs_pool_get_instance(io_pool->pool, i);
127 io->tag = i;
128 io->instance_index = i;
129 io->ocs = ocs;
133 rc = ocs_dma_alloc(ocs, &io->cmdbuf, SCSI_CMD_BUF_LENGTH, OCS_MIN_DMA_ALIGNMENT);
142 rc = ocs_dma_alloc(ocs, &io->rspbuf, SCSI_RSP_BUF_LENGTH, OCS_MIN_DMA_ALIGNMENT);
150 io->sgl = ocs_malloc(ocs, sizeof(*io->sgl) * num_sgl, OCS_M_NOWAIT | OCS_M_ZERO);
151 if (io->sgl == NULL) {
156 io->sgl_allocated = num_sgl;
157 io->sgl_count = 0;
160 ocs_scsi_tgt_io_init(io);
161 ocs_scsi_ini_io_init(io);
163 rc = ocs_dma_alloc(ocs, &io->els_req, OCS_ELS_REQ_LEN, OCS_MIN_DMA_ALIGNMENT);
170 rc = ocs_dma_alloc(ocs, &io->els_rsp, OCS_ELS_GID_PT_RSP_LEN, OCS_MIN_DMA_ALIGNMENT);
196 ocs_io_t *io;
201 io = ocs_pool_get_instance(io_pool->pool, i);
202 if (!io)
204 ocs_scsi_tgt_io_exit(io);
205 ocs_scsi_ini_io_exit(io);
206 if (io->sgl) {
207 ocs_free(ocs, io->sgl, sizeof(*io->sgl) * io->sgl_allocated);
209 ocs_dma_free(ocs, &io->cmdbuf);
210 ocs_dma_free(ocs, &io->rspbuf);
211 ocs_dma_free(ocs, &io->els_req);
212 ocs_dma_free(ocs, &io->els_rsp);
242 ocs_io_t *io = NULL;
250 if ((io = ocs_pool_get(io_pool->pool)) != NULL) {
253 io->io_type = OCS_IO_TYPE_MAX;
254 io->hio_type = OCS_HW_IO_MAX;
255 io->hio = NULL;
256 io->transferred = 0;
257 io->ocs = ocs;
258 io->timeout = 0;
259 io->sgl_count = 0;
260 io->tgt_task_tag = 0;
261 io->init_task_tag = 0;
262 io->hw_tag = 0;
263 io->display_name = "pending";
264 io->seq_init = 0;
265 io->els_req_free = 0;
266 io->mgmt_functions = &io_mgmt_functions;
267 io->io_free = 0;
273 return io;
281 * @param io Pointer to the IO object.
284 ocs_io_pool_io_free(ocs_io_pool_t *io_pool, ocs_io_t *io)
294 hio = io->hio;
295 io->hio = NULL;
296 ocs_pool_put(io_pool->pool, io);
302 io->io_free = 1;
319 ocs_io_t *io = NULL;
322 ocs_list_foreach(&node->active_ios, io)
323 if ((io->cmd_tgt && (io->init_task_tag == ox_id)) &&
324 ((rx_id == 0xffff) || (io->tgt_task_tag == rx_id))) {
328 return io;
357 * @param io Pointer to IO context.
363 ocs_ddump_io(ocs_textbuf_t *textbuf, ocs_io_t *io)
365 ocs_ddump_section(textbuf, "io", io->instance_index);
366 ocs_ddump_value(textbuf, "display_name", "%s", io->display_name);
367 ocs_ddump_value(textbuf, "node_name", "%s", io->node->display_name);
369 ocs_ddump_value(textbuf, "ref_count", "%d", ocs_ref_read_count(&io->ref));
370 ocs_ddump_value(textbuf, "io_type", "%d", io->io_type);
371 ocs_ddump_value(textbuf, "hio_type", "%d", io->hio_type);
372 ocs_ddump_value(textbuf, "cmd_tgt", "%d", io->cmd_tgt);
373 ocs_ddump_value(textbuf, "cmd_ini", "%d", io->cmd_ini);
374 ocs_ddump_value(textbuf, "send_abts", "%d", io->send_abts);
375 ocs_ddump_value(textbuf, "init_task_tag", "0x%x", io->init_task_tag);
376 ocs_ddump_value(textbuf, "tgt_task_tag", "0x%x", io->tgt_task_tag);
377 ocs_ddump_value(textbuf, "hw_tag", "0x%x", io->hw_tag);
378 ocs_ddump_value(textbuf, "tag", "0x%x", io->tag);
379 ocs_ddump_value(textbuf, "timeout", "%d", io->timeout);
380 ocs_ddump_value(textbuf, "tmf_cmd", "%d", io->tmf_cmd);
381 ocs_ddump_value(textbuf, "abort_rx_id", "0x%x", io->abort_rx_id);
383 ocs_ddump_value(textbuf, "busy", "%d", ocs_io_busy(io));
384 ocs_ddump_value(textbuf, "transferred", "%zu", io->transferred);
385 ocs_ddump_value(textbuf, "auto_resp", "%d", io->auto_resp);
386 ocs_ddump_value(textbuf, "exp_xfer_len", "%d", io->exp_xfer_len);
387 ocs_ddump_value(textbuf, "xfer_req", "%d", io->xfer_req);
388 ocs_ddump_value(textbuf, "seq_init", "%d", io->seq_init);
390 ocs_ddump_value(textbuf, "alloc_link", "%d", ocs_list_on_list(&io->io_alloc_link));
391 ocs_ddump_value(textbuf, "pending_link", "%d", ocs_list_on_list(&io->io_pending_link));
392 ocs_ddump_value(textbuf, "backend_link", "%d", ocs_list_on_list(&io->link));
394 if (io->hio) {
395 ocs_ddump_value(textbuf, "hw_tag", "%#x", io->hio->reqtag);
396 ocs_ddump_value(textbuf, "hw_xri", "%#x", io->hio->indicator);
397 ocs_ddump_value(textbuf, "hw_type", "%#x", io->hio->type);
404 ocs_scsi_ini_ddump(textbuf, OCS_SCSI_DDUMP_IO, io);
405 ocs_scsi_tgt_ddump(textbuf, OCS_SCSI_DDUMP_IO, io);
407 ocs_ddump_endsection(textbuf, "io", io->instance_index);
430 ocs_io_t *io = (ocs_io_t *) object;
432 snprintf(qualifier, sizeof(qualifier), "%s/io[%d]", parent, io->instance_index);
440 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "display_name", io->display_name);
443 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "init_task_tag", "0x%x", io->init_task_tag);
446 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "tgt_task_tag", "0x%x", io->tgt_task_tag);
449 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "hw_tag", "0x%x", io->hw_tag);
452 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "tag", "0x%x", io->tag);
455 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "transferred", "%zu", io->transferred);
458 ocs_mgmt_emit_boolean(textbuf, MGMT_MODE_RD, "auto_resp", io->auto_resp);
461 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "exp_xfer_len", "%d", io->exp_xfer_len);
464 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "xfer_req", "%d", io->xfer_req);
475 ocs_io_t *io = (ocs_io_t *) object;
477 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "display_name", io->display_name);
478 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "init_task_tag", "0x%x", io->init_task_tag);
479 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "tgt_task_tag", "0x%x", io->tgt_task_tag);
480 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "hw_tag", "0x%x", io->hw_tag);
481 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "tag", "0x%x", io->tag);
482 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "transferred", "%zu", io->transferred);
483 ocs_mgmt_emit_boolean(textbuf, MGMT_MODE_RD, "auto_resp", io->auto_resp);
484 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "exp_xfer_len", "%d", io->exp_xfer_len);
485 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "xfer_req", "%d", io->xfer_req);