Lines Matching refs:xport

66 	ocs_xport_t *xport;  in ocs_xport_alloc()  local
69 xport = ocs_malloc(ocs, sizeof(*xport), OCS_M_ZERO); in ocs_xport_alloc()
70 if (xport != NULL) { in ocs_xport_alloc()
71 xport->ocs = ocs; in ocs_xport_alloc()
73 return xport; in ocs_xport_alloc()
87 ocs_xport_rq_threads_teardown(ocs_xport_t *xport) in ocs_xport_rq_threads_teardown() argument
89 ocs_t *ocs = xport->ocs; in ocs_xport_rq_threads_teardown()
92 if (xport->num_rq_threads == 0 || in ocs_xport_rq_threads_teardown()
93 xport->rq_thread_info == NULL) { in ocs_xport_rq_threads_teardown()
98 for (i = 0; i < xport->num_rq_threads; i++) { in ocs_xport_rq_threads_teardown()
99 if (xport->rq_thread_info[i].thread_started) { in ocs_xport_rq_threads_teardown()
100 ocs_thread_terminate(&xport->rq_thread_info[i].thread); in ocs_xport_rq_threads_teardown()
103 while (xport->rq_thread_info[i].thread_started) { in ocs_xport_rq_threads_teardown()
108 if (xport->rq_thread_info[i].seq_cbuf != NULL) { in ocs_xport_rq_threads_teardown()
109 ocs_cbuf_free(xport->rq_thread_info[i].seq_cbuf); in ocs_xport_rq_threads_teardown()
110 xport->rq_thread_info[i].seq_cbuf = NULL; in ocs_xport_rq_threads_teardown()
128 ocs_xport_rq_threads_create(ocs_xport_t *xport, uint32_t num_rq_threads) in ocs_xport_rq_threads_create() argument
130 ocs_t *ocs = xport->ocs; in ocs_xport_rq_threads_create()
134 xport->num_rq_threads = num_rq_threads; in ocs_xport_rq_threads_create()
141xport->rq_thread_info = ocs_malloc(ocs, sizeof(ocs_xport_rq_thread_info_t) * num_rq_threads, OCS_M… in ocs_xport_rq_threads_create()
142 if (xport->rq_thread_info == NULL) { in ocs_xport_rq_threads_create()
149 xport->rq_thread_info[i].ocs = ocs; in ocs_xport_rq_threads_create()
150 xport->rq_thread_info[i].seq_cbuf = ocs_cbuf_alloc(ocs, OCS_HW_RQ_NUM_HDR); in ocs_xport_rq_threads_create()
151 if (xport->rq_thread_info[i].seq_cbuf == NULL) { in ocs_xport_rq_threads_create()
155 ocs_snprintf(xport->rq_thread_info[i].thread_name, in ocs_xport_rq_threads_create()
156 sizeof(xport->rq_thread_info[i].thread_name), in ocs_xport_rq_threads_create()
158 rc = ocs_thread_create(ocs, &xport->rq_thread_info[i].thread, ocs_unsol_rq_thread, in ocs_xport_rq_threads_create()
159 xport->rq_thread_info[i].thread_name, in ocs_xport_rq_threads_create()
160 &xport->rq_thread_info[i], OCS_THREAD_RUN); in ocs_xport_rq_threads_create()
165 xport->rq_thread_info[i].thread_started = TRUE; in ocs_xport_rq_threads_create()
170 ocs_xport_rq_threads_teardown(xport); in ocs_xport_rq_threads_create()
185 ocs_xport_attach(ocs_xport_t *xport) in ocs_xport_attach() argument
187 ocs_t *ocs = xport->ocs; in ocs_xport_attach()
202 xport->fcfi[i].hold_frames = 1; in ocs_xport_attach()
203 ocs_lock_init(ocs, &xport->fcfi[i].pend_frames_lock, "xport pend_frames[%d]", i); in ocs_xport_attach()
204 ocs_list_init(&xport->fcfi[i].pend_frames, ocs_hw_sequence_t, link); in ocs_xport_attach()
263 xport->io_pool = ocs_io_pool_create(ocs, ocs->num_scsi_ios, in ocs_xport_attach()
265 if (xport->io_pool == NULL) { in ocs_xport_attach()
275 if (ocs_xport_rq_threads_create(xport, ocs->rq_threads) != 0) { in ocs_xport_attach()
284 ocs_io_pool_free(xport->io_pool); in ocs_xport_attach()
303 ocs_xport_initialize_auto_xfer_ready(ocs_xport_t *xport) in ocs_xport_initialize_auto_xfer_ready() argument
305 ocs_t *ocs = xport->ocs; in ocs_xport_initialize_auto_xfer_ready()
411 ocs_xport_initialize(ocs_xport_t *xport) in ocs_xport_initialize() argument
413 ocs_t *ocs = xport->ocs; in ocs_xport_initialize()
463 if (ocs_xport_initialize_auto_xfer_ready(xport)) { in ocs_xport_initialize()
542 ocs_list_init(&xport->vport_list, ocs_vport_spec_t, link); in ocs_xport_initialize()
543 ocs_lock_init(ocs, &xport->io_pending_lock, "io_pending_lock[%d]", ocs->instance_index); in ocs_xport_initialize()
544 ocs_list_init(&xport->io_pending_list, ocs_io_t, io_pending_link); in ocs_xport_initialize()
545 ocs_atomic_init(&xport->io_active_count, 0); in ocs_xport_initialize()
546 ocs_atomic_init(&xport->io_pending_count, 0); in ocs_xport_initialize()
547 ocs_atomic_init(&xport->io_total_free, 0); in ocs_xport_initialize()
548 ocs_atomic_init(&xport->io_total_pending, 0); in ocs_xport_initialize()
549 ocs_atomic_init(&xport->io_alloc_failed_count, 0); in ocs_xport_initialize()
550 ocs_atomic_init(&xport->io_pending_recursing, 0); in ocs_xport_initialize()
631 ocs_xport_detach(ocs_xport_t *xport) in ocs_xport_detach() argument
633 ocs_t *ocs = xport->ocs; in ocs_xport_detach()
643 if (ocs_timer_pending(&ocs->xport->stats_timer)) in ocs_xport_detach()
644 ocs_del_timer(&ocs->xport->stats_timer); in ocs_xport_detach()
718 ocs_xport_force_free(ocs_xport_t *xport) in ocs_xport_force_free() argument
720 ocs_t *ocs = xport->ocs; in ocs_xport_force_free()
751 ocs_xport_control(ocs_xport_t *xport, ocs_xport_ctrl_e cmd, ...) in ocs_xport_control() argument
757 ocs_assert(xport, -1); in ocs_xport_control()
758 ocs_assert(xport->ocs, -1); in ocs_xport_control()
759 ocs = xport->ocs; in ocs_xport_control()
768 xport->configured_link_state = cmd; in ocs_xport_control()
776 xport->configured_link_state = cmd; in ocs_xport_control()
795 ocs_xport_force_free(xport); in ocs_xport_control()
803 ocs_xport_force_free(xport); in ocs_xport_control()
810 ocs_xport_force_free(xport); in ocs_xport_control()
892 xport->req_wwnn = wwnn; in ocs_xport_control()
908 xport->req_wwpn = wwpn; in ocs_xport_control()
945 ocs_xport_status(ocs_xport_t *xport, ocs_xport_status_e cmd, ocs_xport_stats_t *result) in ocs_xport_status() argument
952 ocs_assert(xport, -1); in ocs_xport_status()
953 ocs_assert(xport->ocs, -1); in ocs_xport_status()
955 ocs = xport->ocs; in ocs_xport_status()
960 if (xport->configured_link_state == 0) { in ocs_xport_status()
963 xport->configured_link_state = OCS_XPORT_PORT_OFFLINE; in ocs_xport_status()
965 result->value = xport->configured_link_state; in ocs_xport_status()
1023 ocs_memcpy((void *)result, &ocs->xport->fc_xport_stats, sizeof(ocs_xport_stats_t)); in ocs_xport_status()
1113 ocs_xport_free(ocs_xport_t *xport) in ocs_xport_free() argument
1118 if (xport) { in ocs_xport_free()
1119 ocs = xport->ocs; in ocs_xport_free()
1120 ocs_io_pool_free(xport->io_pool); in ocs_xport_free()
1122 if(mtx_initialized(&xport->io_pending_lock.lock)) in ocs_xport_free()
1123 ocs_lock_free(&xport->io_pending_lock); in ocs_xport_free()
1126 ocs_lock_free(&xport->fcfi[i].pend_frames_lock); in ocs_xport_free()
1129 ocs_xport_rq_threads_teardown(xport); in ocs_xport_free()
1131 ocs_free(ocs, xport, sizeof(*xport)); in ocs_xport_free()