• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/ocs_fc/

Lines Matching defs:ocs

45 #include "ocs.h"
50 #define SCSI_ITT_SIZE(ocs) ((ocs->ocs_xport == OCS_XPORT_FC) ? 4 : 8)
52 #define SCSI_IOFMT_ARGS(io) io->instance_index, SCSI_ITT_SIZE(io->ocs), io->init_task_tag, SCSI_ITT_SIZE(io->ocs), io->tgt_task_tag, io->hw_tag
54 #define scsi_io_printf(io, fmt, ...) ocs_log_debug(io->ocs, "[%s]" SCSI_IOFMT fmt, \
91 ocs_log_debug(node->ocs, "[%s] initiate ELS abort %s\n", node->display_name, els->display_name);
107 * @param arg pointer to ocs
116 ocs_t *ocs = arg;
139 ocs_log_test(ocs, "unhandled event %#x\n", event);
228 * @param ocs pointer to driver instance context
235 ocs_node_create_pool(ocs_t *ocs, uint32_t node_count)
237 ocs_xport_t *xport = ocs->xport;
247 xport->nodes = ocs_malloc(ocs, node_count * sizeof(ocs_node_t *), OCS_M_ZERO | OCS_M_NOWAIT);
249 ocs_log_err(ocs, "node ptrs allocation failed");
253 if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) &&
254 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) {
266 node = ocs_malloc(ocs, sizeof(ocs_node_t), OCS_M_ZERO | OCS_M_NOWAIT);
268 ocs_log_err(ocs, "node allocation failed");
277 rc = ocs_dma_alloc(ocs, &node->sparm_dma_buf, 256, 16);
279 ocs_free(ocs, node, sizeof(ocs_node_t));
280 ocs_log_err(ocs, "ocs_dma_alloc failed: %d\n", rc);
290 ocs_node_free_pool(ocs);
300 * @param ocs pointer to driver instance context
306 ocs_node_free_pool(ocs_t *ocs)
308 ocs_xport_t *xport = ocs->xport;
315 ocs_device_lock(ocs);
321 ocs_dma_free(ocs, &node->sparm_dma_buf);
322 ocs_free(ocs, node, sizeof(ocs_node_t));
327 ocs_free(ocs, xport->nodes, (xport->nodes_count * sizeof(ocs_node_t *)));
329 ocs_device_unlock(ocs);
338 * @param ocs pointer to driver instance context
345 ocs_node_get_instance(ocs_t *ocs, uint32_t index)
347 ocs_xport_t *xport = ocs->xport;
351 ocs_log_test(ocs, "invalid index: %d\n", index);
377 ocs_t *ocs = sport->ocs;
378 ocs_xport_t *xport = ocs->xport;
384 ocs_log_debug(ocs, "node allocation when shutting down %06x", port_id);
388 ocs_device_lock(ocs);
390 ocs_device_unlock(ocs);
392 ocs_log_err(ocs, "node allocation failed %06x", port_id);
410 node->ocs = ocs;
414 rc = ocs_hw_node_alloc(&ocs->hw, &node->rnode, port_id, sport);
416 ocs_log_err(ocs, "ocs_hw_node_alloc failed: %d\n", rc);
420 ocs_device_lock(ocs);
422 ocs_device_unlock(ocs);
429 ocs_lock_init(ocs, &node->pend_frames_lock, "pend_frames_lock[%d]", node->instance_index);
431 ocs_lock_init(ocs, &node->active_ios_lock, "active_ios[%d]", node->instance_index);
468 ocs_t *ocs;
476 ocs_assert(node->ocs, -1);
479 ocs = node->ocs;
480 ocs_assert(ocs->xport, -1);
481 xport = ocs->xport;
498 if (OCS_HW_RTN_IS_ERROR((rc = ocs_hw_node_free_resources(&ocs->hw, &node->rnode)))) {
499 ocs_log_test(ocs, "ocs_hw_node_free failed: %d\n", rc);
514 ocs_log_test(node->ocs, "assertion failed: sport lookup is NULL\n");
543 ocs_device_lock(ocs);
545 ocs_device_unlock(ocs);
585 ocs_io_free(node->ocs, io);
595 ocs_io_free(node->ocs, els);
605 ocs_io_free(node->ocs, els);
629 ocs_t *ocs = node->ocs;
632 ocs_log_test(ocs, "Warning: ocs_node_attach with unattached domain\n");
640 if (ocs->enable_hlm) {
648 rc = ocs_hw_node_attach(&ocs->hw, &node->rnode, &node->sparm_dma_buf);
650 ocs_log_test(ocs, "ocs_hw_node_attach failed: %d\n", rc);
734 ocs_t *ocs = node->ocs;
738 ocs_log_debug(ocs, "[%s] cleaning up LS_ACC oxid=0x%x\n",
924 ocs_t *ocs;
926 ocs = node->ocs;
940 ocs_io_free(node->ocs, els);
957 ocs_hw_io_free(&ocs->hw, node->ls_acc_io->hio);
1161 ocs_io_free(node->ocs, io);
1195 ocs_log_debug(ocs, "[%s] %-20s\n", node->display_name, ocs_sm_event_name(evt));
1226 ocs_t *ocs = NULL;
1231 ocs_assert(node->ocs, NULL);
1232 ocs = node->ocs;
1281 ocs_log_debug(ocs, "[%s] (%s) ELS x%02x, LS_RJT not supported\n",
1301 ocs_log_debug(ocs, "[%s] (%s) %s sending ELS_RJT\n",
1314 ocs_log_debug(ocs, "[%s] (%s) %s sending CT_REJECT\n",
1322 ocs_log_debug(ocs, "[%s] (%s) %s sending BA_ACC\n",
1331 ocs_log_test(node->ocs, "[%s] %-20s %-20s not handled\n", node->display_name, funcname,
1614 ocs_t *ocs = NULL;
1620 ocs = node->ocs;
1621 ocs_assert(ocs, -1);
1630 ocs_log_debug(node->ocs, "[%s] %-20s expecting ELS cmd=x%x received type=%d\n",
1633 ocs_log_debug(node->ocs, "[%s] %-20s expecting ELS cmd=x%x received cmd=x%x\n",
1664 ocs_t *ocs = NULL;
1670 ocs = node->ocs;
1671 ocs_assert(ocs, -1);
1680 ocs_log_debug(node->ocs, "[%s] %-20s expecting NS cmd=x%x received type=%d\n",
1683 ocs_log_debug(node->ocs, "[%s] %-20s expecting NS cmd=x%x received cmd=x%x\n",
2101 ocs_t *ocs = node->ocs;
2148 ocs_hw_sequence_free(&ocs->hw, seq);
2171 ocs_t *ocs = node->ocs;
2172 ocs_xport_t *xport = ocs->xport;
2185 if (ocs_io_find_tgt_io(ocs, node, ox_id, rx_id) == NULL) {
2188 ocs_log_debug(ocs, "IO not found (ox_id %04x)\n", ox_id);
2191 rc = ocs_hw_get(&ocs->hw, OCS_HW_SEND_FRAME_CAPABLE, &send_frame_capable);
2195 ocs_log_test(ocs, "ocs_bls_acc_send_frame failed\n");
2213 cbdata.io->ocs = ocs;
2225 ocs_hw_sequence_free(&ocs->hw, seq);
2249 ocs_t *ocs = node->ocs;
2303 ocs_hw_sequence_free(&ocs->hw, seq);
2325 ocs_t *ocs = node->ocs;
2331 ocs_hw_sequence_free(&ocs->hw, seq);