Lines Matching full:ocs

34  * OCS driver remote node handler.  This file contains code that is shared
43 #include "ocs.h"
48 #define SCSI_ITT_SIZE(ocs) ((ocs->ocs_xport == OCS_XPORT_FC) ? 4 : 8) argument
50 …IOFMT_ARGS(io) io->instance_index, SCSI_ITT_SIZE(io->ocs), io->init_task_tag, SCSI_ITT_SIZE(io->oc…
52 #define scsi_io_printf(io, fmt, ...) ocs_log_debug(io->ocs, "[%s]" SCSI_IOFMT fmt, \
89 ocs_log_debug(node->ocs, "[%s] initiate ELS abort %s\n", node->display_name, els->display_name); in ocs_node_abort_all_els()
105 * @param arg pointer to ocs
114 ocs_t *ocs = arg; in ocs_remote_node_cb() local
137 ocs_log_test(ocs, "unhandled event %#x\n", event); in ocs_remote_node_cb()
226 * @param ocs pointer to driver instance context
233 ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) in ocs_node_create_pool() argument
235 ocs_xport_t *xport = ocs->xport; in ocs_node_create_pool()
245 xport->nodes = ocs_malloc(ocs, node_count * sizeof(ocs_node_t *), OCS_M_ZERO | OCS_M_NOWAIT); in ocs_node_create_pool()
247 ocs_log_err(ocs, "node ptrs allocation failed"); in ocs_node_create_pool()
251 if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && in ocs_node_create_pool()
252 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { in ocs_node_create_pool()
264 node = ocs_malloc(ocs, sizeof(ocs_node_t), OCS_M_ZERO | OCS_M_NOWAIT); in ocs_node_create_pool()
266 ocs_log_err(ocs, "node allocation failed"); in ocs_node_create_pool()
275 rc = ocs_dma_alloc(ocs, &node->sparm_dma_buf, 256, 16); in ocs_node_create_pool()
277 ocs_free(ocs, node, sizeof(ocs_node_t)); in ocs_node_create_pool()
278 ocs_log_err(ocs, "ocs_dma_alloc failed: %d\n", rc); in ocs_node_create_pool()
288 ocs_node_free_pool(ocs); in ocs_node_create_pool()
298 * @param ocs pointer to driver instance context
304 ocs_node_free_pool(ocs_t *ocs) in ocs_node_free_pool() argument
306 ocs_xport_t *xport = ocs->xport; in ocs_node_free_pool()
313 ocs_device_lock(ocs); in ocs_node_free_pool()
319 ocs_dma_free(ocs, &node->sparm_dma_buf); in ocs_node_free_pool()
320 ocs_free(ocs, node, sizeof(ocs_node_t)); in ocs_node_free_pool()
325 ocs_free(ocs, xport->nodes, (xport->nodes_count * sizeof(ocs_node_t *))); in ocs_node_free_pool()
327 ocs_device_unlock(ocs); in ocs_node_free_pool()
336 * @param ocs pointer to driver instance context
343 ocs_node_get_instance(ocs_t *ocs, uint32_t index) in ocs_node_get_instance() argument
345 ocs_xport_t *xport = ocs->xport; in ocs_node_get_instance()
349 ocs_log_test(ocs, "invalid index: %d\n", index); in ocs_node_get_instance()
375 ocs_t *ocs = sport->ocs; in ocs_node_alloc() local
376 ocs_xport_t *xport = ocs->xport; in ocs_node_alloc()
382 ocs_log_debug(ocs, "node allocation when shutting down %06x", port_id); in ocs_node_alloc()
386 ocs_device_lock(ocs); in ocs_node_alloc()
388 ocs_device_unlock(ocs); in ocs_node_alloc()
390 ocs_log_err(ocs, "node allocation failed %06x", port_id); in ocs_node_alloc()
408 node->ocs = ocs; in ocs_node_alloc()
412 rc = ocs_hw_node_alloc(&ocs->hw, &node->rnode, port_id, sport); in ocs_node_alloc()
414 ocs_log_err(ocs, "ocs_hw_node_alloc failed: %d\n", rc); in ocs_node_alloc()
418 ocs_device_lock(ocs); in ocs_node_alloc()
420 ocs_device_unlock(ocs); in ocs_node_alloc()
427 ocs_lock_init(ocs, &node->pend_frames_lock, "pend_frames_lock[%d]", node->instance_index); in ocs_node_alloc()
429 ocs_lock_init(ocs, &node->active_ios_lock, "active_ios[%d]", node->instance_index); in ocs_node_alloc()
466 ocs_t *ocs; in ocs_node_free() local
474 ocs_assert(node->ocs, -1); in ocs_node_free()
477 ocs = node->ocs; in ocs_node_free()
478 ocs_assert(ocs->xport, -1); in ocs_node_free()
479 xport = ocs->xport; in ocs_node_free()
496 if (OCS_HW_RTN_IS_ERROR((rc = ocs_hw_node_free_resources(&ocs->hw, &node->rnode)))) { in ocs_node_free()
497 ocs_log_test(ocs, "ocs_hw_node_free failed: %d\n", rc); in ocs_node_free()
512 ocs_log_test(node->ocs, "assertion failed: sport lookup is NULL\n"); in ocs_node_free()
541 ocs_device_lock(ocs); in ocs_node_free()
543 ocs_device_unlock(ocs); in ocs_node_free()
583 ocs_io_free(node->ocs, io); in ocs_node_force_free()
593 ocs_io_free(node->ocs, els); in ocs_node_force_free()
603 ocs_io_free(node->ocs, els); in ocs_node_force_free()
627 ocs_t *ocs = node->ocs; in ocs_node_attach() local
630 ocs_log_test(ocs, "Warning: ocs_node_attach with unattached domain\n"); in ocs_node_attach()
638 if (ocs->enable_hlm) { in ocs_node_attach()
646 rc = ocs_hw_node_attach(&ocs->hw, &node->rnode, &node->sparm_dma_buf); in ocs_node_attach()
648 ocs_log_test(ocs, "ocs_hw_node_attach failed: %d\n", rc); in ocs_node_attach()
732 ocs_t *ocs = node->ocs; in ocs_node_send_ls_io_cleanup() local
736 ocs_log_debug(ocs, "[%s] cleaning up LS_ACC oxid=0x%x\n", in ocs_node_send_ls_io_cleanup()
922 ocs_t *ocs; in ocs_node_initiate_cleanup() local
924 ocs = node->ocs; in ocs_node_initiate_cleanup()
938 ocs_io_free(node->ocs, els); in ocs_node_initiate_cleanup()
955 ocs_hw_io_free(&ocs->hw, node->ls_acc_io->hio); in ocs_node_initiate_cleanup()
1159 ocs_io_free(node->ocs, io); in __ocs_node_wait_ios_shutdown()
1193 ocs_log_debug(ocs, "[%s] %-20s\n", node->display_name, ocs_sm_event_name(evt)); in __ocs_node_wait_ios_shutdown()
1224 ocs_t *ocs = NULL; in __ocs_node_common() local
1229 ocs_assert(node->ocs, NULL); in __ocs_node_common()
1230 ocs = node->ocs; in __ocs_node_common()
1279 ocs_log_debug(ocs, "[%s] (%s) ELS x%02x, LS_RJT not supported\n", in __ocs_node_common()
1299 ocs_log_debug(ocs, "[%s] (%s) %s sending ELS_RJT\n", in __ocs_node_common()
1312 ocs_log_debug(ocs, "[%s] (%s) %s sending CT_REJECT\n", in __ocs_node_common()
1320 ocs_log_debug(ocs, "[%s] (%s) %s sending BA_ACC\n", in __ocs_node_common()
1329 ocs_log_test(node->ocs, "[%s] %-20s %-20s not handled\n", node->display_name, funcname, in __ocs_node_common()
1612 ocs_t *ocs = NULL; in node_check_els_req() local
1618 ocs = node->ocs; in node_check_els_req()
1619 ocs_assert(ocs, -1); in node_check_els_req()
1628 ocs_log_debug(node->ocs, "[%s] %-20s expecting ELS cmd=x%x received type=%d\n", in node_check_els_req()
1631 ocs_log_debug(node->ocs, "[%s] %-20s expecting ELS cmd=x%x received cmd=x%x\n", in node_check_els_req()
1662 ocs_t *ocs = NULL; in node_check_ns_req() local
1668 ocs = node->ocs; in node_check_ns_req()
1669 ocs_assert(ocs, -1); in node_check_ns_req()
1678 ocs_log_debug(node->ocs, "[%s] %-20s expecting NS cmd=x%x received type=%d\n", in node_check_ns_req()
1681 ocs_log_debug(node->ocs, "[%s] %-20s expecting NS cmd=x%x received cmd=x%x\n", in node_check_ns_req()
2099 ocs_t *ocs = node->ocs; in ocs_node_recv_els_frame() local
2146 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_node_recv_els_frame()
2169 ocs_t *ocs = node->ocs; in ocs_node_recv_abts_frame() local
2170 ocs_xport_t *xport = ocs->xport; in ocs_node_recv_abts_frame()
2183 if (ocs_io_find_tgt_io(ocs, node, ox_id, rx_id) == NULL) { in ocs_node_recv_abts_frame()
2186 ocs_log_debug(ocs, "IO not found (ox_id %04x)\n", ox_id); in ocs_node_recv_abts_frame()
2189 rc = ocs_hw_get(&ocs->hw, OCS_HW_SEND_FRAME_CAPABLE, &send_frame_capable); in ocs_node_recv_abts_frame()
2193 ocs_log_test(ocs, "ocs_bls_acc_send_frame failed\n"); in ocs_node_recv_abts_frame()
2211 cbdata.io->ocs = ocs; in ocs_node_recv_abts_frame()
2223 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_node_recv_abts_frame()
2247 ocs_t *ocs = node->ocs; in ocs_node_recv_ct_frame() local
2301 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_node_recv_ct_frame()
2323 ocs_t *ocs = node->ocs; in ocs_node_recv_fcp_cmd() local
2329 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_node_recv_fcp_cmd()