58 #define OCS_XPORT_STATS_TIMER_MS 3 * 1000
76 xport = ocs_malloc(ocs,
sizeof(*xport), OCS_M_ZERO);
96 ocs_t *ocs = xport->ocs;
99 if (xport->num_rq_threads == 0 ||
100 xport->rq_thread_info == NULL) {
105 for (i = 0; i < xport->num_rq_threads; i++) {
106 if (xport->rq_thread_info[i].thread_started) {
107 ocs_thread_terminate(&xport->rq_thread_info[i].thread);
109 ocs_log_debug(ocs,
"wait for thread %d to exit\n", i);
110 while (xport->rq_thread_info[i].thread_started) {
111 ocs_delay_usec(10000);
113 ocs_log_debug(ocs,
"thread %d to exited\n", i);
115 if (xport->rq_thread_info[i].seq_cbuf != NULL) {
117 xport->rq_thread_info[i].seq_cbuf = NULL;
137 ocs_t *ocs = xport->ocs;
141 xport->num_rq_threads = num_rq_threads;
142 ocs_log_debug(ocs,
"number of RQ threads %d\n", num_rq_threads);
143 if (num_rq_threads == 0) {
149 if (xport->rq_thread_info == NULL) {
150 ocs_log_err(ocs,
"memory allocation failure\n");
155 for (i = 0; i < num_rq_threads; i++) {
156 xport->rq_thread_info[i].ocs = ocs;
157 xport->rq_thread_info[i].seq_cbuf =
159 if (xport->rq_thread_info[i].seq_cbuf == NULL) {
160 goto ocs_xport_rq_threads_create_error;
163 ocs_snprintf(xport->rq_thread_info[i].thread_name,
164 sizeof(xport->rq_thread_info[i].thread_name),
165 "ocs_unsol_rq:%d:%d", ocs->instance_index, i);
167 xport->rq_thread_info[i].thread_name,
168 &xport->rq_thread_info[i], OCS_THREAD_RUN);
170 ocs_log_err(ocs,
"ocs_thread_create failed: %d\n", rc);
171 goto ocs_xport_rq_threads_create_error;
173 xport->rq_thread_info[i].thread_started = TRUE;
177 ocs_xport_rq_threads_create_error:
195 ocs_t *ocs = xport->ocs;
203 uint8_t io_pool_created = FALSE;
204 uint8_t node_pool_created = FALSE;
209 xport->fcfi[i].hold_frames = 1;
210 ocs_lock_init(ocs, &xport->fcfi[i].pend_frames_lock,
"xport pend_frames[%d]", i);
216 ocs_log_test(ocs,
"can't set OCS_HAL_WAR_VERSION\n");
222 ocs_log_err(ocs,
"%s: Can't setup hardware\n", ocs->desc);
225 ocs_log_debug(ocs,
"stopping after ocs_hal_setup\n");
229 ocs->hal.watchdog_timeout = ocs->watchdog_timeout;
230 ocs->hal.sliport_healthcheck = ocs->sliport_healthcheck;
231 ocs->hal.disable_fec = ocs->disable_fec;
232 ocs->hal.enable_fw_ag_rsp = ocs->enable_fw_ag_rsp;
233 ocs->hal.sliport_pause_errors = ocs->sliport_pause_errors;
236 ocs_log_debug(ocs,
"HAL bounce: %d\n", ocs->hal_bounce);
242 ocs_log_debug(ocs,
"RQ Selection Policy: %d\n", value);
257 ocs_log_err(ocs,
"%s: Can't set number of SGLs\n", ocs->desc);
260 ocs_log_debug(ocs,
"%s: Configured for %d SGLs\n", ocs->desc, n_sgl);
279 ocs->max_remote_nodes : OCS_MAX_REMOTE_NODES);
281 ocs_log_err(ocs,
"Can't allocate node pool\n");
282 goto ocs_xport_attach_cleanup;
284 node_pool_created = TRUE;
290 if (xport->io_pool == NULL) {
291 ocs_log_err(ocs,
"Can't allocate IO pool\n");
292 goto ocs_xport_attach_cleanup;
294 io_pool_created = TRUE;
301 ocs_log_err(ocs,
"failure creating RQ threads\n");
302 goto ocs_xport_attach_cleanup;
307 ocs_xport_attach_cleanup:
308 if (io_pool_created) {
312 if (node_pool_created) {
331 if (tow_io_size % 512 ||
347 #if !defined(OCS_ENABLE_FIRST_BURST)
352 #if defined(OCS_INCLUDE_SCST)
353 if (tow_feature & OCS_TOW_FEATURE_TFB)
357 tow_feature & OCS_TOW_FEATURE_TFB)
377 uint32_t ramdisc_blocksize = 512;
379 int32_t tow_feature = 0;
380 uint32_t tow_xri_cnt = 0;
381 int32_t tow_io_size = 0;
382 uint32_t tow_xris_max = 0;
385 tow_feature = ocs_strtoul(prop_buf, 0, 0);
389 tow_io_size = ocs_strtoul(prop_buf, 0, 0);
393 tow_xri_cnt = ocs_strtoul(prop_buf, 0, 0);
398 ocs_log_err(ocs,
"Invalid target optimized write feature\n");
403 ocs_log_err(ocs,
"Invalid target optimized write io size\n");
410 ocs_log_err(ocs,
"Auto Xfer Rdy feature is unsupported\n");
415 ocs_log_err(ocs,
"First burst feature is unsupported\n");
420 ocs_log_err(ocs,
"HAL set tow feature failed\n");
425 ocs_log_err(ocs,
"HAL set tow io size failed\n");
431 if (tow_xri_cnt > tow_xris_max) {
432 ocs_log_err(ocs,
"Invalid TOW xri count! Max. supported %d\n", tow_xris_max);
438 ocs_log_err(ocs,
"HAL set tow xri cnt failed\n");
449 p_type = ocs_strtoul(prop_buf, 0, 0);
452 if (
ocs_get_property(
"ramdisc_blocksize", prop_buf,
sizeof(prop_buf)) == 0) {
453 ramdisc_blocksize = ocs_strtoul(prop_buf, 0, 0);
457 if(ocs_strlen(prop_buf)) {
466 ocs_log_err(ocs,
"HAL set tow t10 failed\n");
471 ocs_log_err(ocs,
"HAL set tow block size failed\n");
476 ocs_log_err(ocs,
"HAL set tow p_type failed\n");
481 ocs_log_err(ocs,
"HAL set tow tag lba failed\n");
486 ocs_log_err(ocs,
"HAL set tow app tag valid\n");
491 if (tow_feature && ocs->esoc) {
511 ocs_t *ocs = xport->ocs;
519 uint32_t dif_capable;
520 uint8_t dif_separate = 0;
524 uint8_t ini_device_set = FALSE;
525 uint8_t tgt_device_set = FALSE;
526 uint8_t hal_initialized = FALSE;
530 ocs_log_err(ocs,
"%s: Can't set number of IOs\n", ocs->desc);
537 if (ocs->enable_hlm) {
540 ocs->enable_hlm = FALSE;
541 ocs_log_err(ocs,
"Cannot enable high login mode for this port\n");
543 ocs_log_debug(ocs,
"High login mode is enabled\n");
545 ocs_log_err(ocs,
"%s: Can't set high login mode\n", ocs->desc);
551 if (ocs->enable_dpp) {
554 ocs->enable_dpp = FALSE;
555 ocs_log_err(ocs,
"Disabling DPP mode for this port\n");
558 ocs_log_err(ocs,
"%s: enable DPP mode failed\n", ocs->desc);
561 ocs_log_debug(ocs,
"DPP mode is enabled\n");
569 ocs_log_err(ocs,
"Target optimized write setup failed\n");
573 if (ocs->explicit_buffer_list) {
577 ocs_log_err(ocs,
"Explicit Buffer List not supported on this device, not enabled\n");
584 ocs_log_err(ocs,
"%s: Can't set the toplogy\n", ocs->desc);
590 ocs_log_err(ocs,
"%s: Can't set the link speed\n", ocs->desc);
595 ocs_log_err(ocs,
"%s: Can't set the ethernet license\n", ocs->desc);
602 ocs_log_err(ocs,
"%s: Can't set the DIF seed\n", ocs->desc);
611 dif_separate = ocs_strtoul(prop_buf, 0, 0);
616 ocs_log_err(ocs,
"Requested DIF MODE not supported\n");
621 if (ocs->target_io_timer_sec) {
622 ocs_log_debug(ocs,
"setting target io timer=%d\n", ocs->target_io_timer_sec);
636 ocs_lock_init(ocs, &xport->io_pending_lock,
"io_pending_lock[%d]", ocs->instance_index);
637 ocs_list_init(&xport->io_pending_list, ocs_io_t, io_pending_link);
638 ocs_atomic_init(&xport->io_active_count, 0);
639 ocs_atomic_init(&xport->io_pending_count, 0);
640 ocs_atomic_init(&xport->io_total_free, 0);
641 ocs_atomic_init(&xport->io_total_pending, 0);
642 ocs_atomic_init(&xport->io_alloc_failed_count, 0);
643 ocs_atomic_init(&xport->io_pending_recursing, 0);
646 ocs_memset(&xport->fc_stats.stats.fcp_stats, 0,
sizeof(xport->fc_stats.stats.fcp_stats));
648 ocs_lock_init(ocs, &xport->fc_stats_lock,
"fc_stats_lock[%d]", ocs->instance_index);
649 ocs_lock_init(ocs, &ocs->hal.watchdog_lock,
" Watchdog Lock[%d]",
ocs_instance(ocs));
653 ocs_log_err(ocs,
"ocs_hal_init failure\n");
654 goto ocs_xport_init_cleanup;
656 hal_initialized = TRUE;
659 rq_limit = max_hal_io/2;
661 ocs_log_err(ocs,
"%s: Can't set the RQ process limit\n", ocs->desc);
664 if (ocs->enable_tgt) {
667 ocs_log_err(ocs,
"failed to initialize target\n");
668 goto ocs_xport_init_cleanup;
670 tgt_device_set = TRUE;
678 if (ocs->enable_ini || ocs->enable_tgt) {
681 ocs_log_err(ocs,
"failed to initialize initiator\n");
682 goto ocs_xport_init_cleanup;
684 ini_device_set = TRUE;
689 if (ocs->num_vports != 0) {
694 if (ocs->num_vports < max_vports) {
695 ocs_log_debug(ocs,
"Provisioning %d vports\n", ocs->num_vports);
696 for (i = 0; i < ocs->num_vports; i++) {
700 ocs_log_err(ocs,
"failed to create vports. num_vports range should be (1-%d) \n", max_vports-1);
701 goto ocs_xport_init_cleanup;
707 ocs_xport_init_cleanup:
708 if (ini_device_set) {
712 if (tgt_device_set) {
716 if (hal_initialized) {
737 ocs_t *ocs = xport->ocs;
743 if (ocs->enable_ini || ocs->enable_tgt) {
747 ocs_lock(&xport->fc_stats_lock);
748 xport->fc_stats_timer_shutdown =
true;
749 ocs_unlock(&xport->fc_stats_lock);
750 if (ocs_timer_pending(&xport->fc_stats_timer))
751 ocs_del_timer(&xport->fc_stats_timer);
773 ocs_sem_t *sem = arg;
803 if (payload != NULL) {
805 ocs_sem_v(&payload->
sem);
806 if (ocs_atomic_sub_and_test(&payload->
refcnt, 1))
807 ocs_free(hal->os, payload,
sizeof(*payload));
827 ocs_t *ocs = xport->ocs;
828 ocs_domain_t *domain;
830 #if !defined(OCSU_FC_RAMD) && !defined(OCSU_FC_WORKLOAD) && !defined(OCS_USPACE_SPDK)
831 ocs_os_t *ocs_os = (ocs_os_t *)ocs;
839 ocs_log_info(ocs,
"Force shutdown\n");
881 ocs_log_err(ocs,
"%s: Can't init port\n", ocs->desc);
883 xport->configured_link_state = cmd;
889 ocs_log_err(ocs,
"port shutdown failed\n");
891 xport->configured_link_state = cmd;
897 uint32_t reset_required;
907 if (reset_required) {
908 ocs_log_info(ocs,
"Reset required, do force shutdown\n");
914 ocs_log_warn(ocs,
"Port shutdown failed, do force shutdown\n");
918 ocs_log_info(ocs,
"Domain list is empty\n");
921 rc = ocs_drain_shutdown_events(ocs, &ocs->domain_list_empty_cb_sem);
923 ocs_log_warn(ocs,
"Domain shutdown timed out of %d sec; " \
924 "do force shutdown\n",
926 ocs_log_info(ocs,
"Print driver dump\n");
960 node = va_arg(argp, ocs_node_t*);
962 context = va_arg(argp,
void *);
972 if (!node->sm.current_state) {
973 ocs_log_test(ocs,
"node %p state machine disabled\n", node);
977 payload = ocs_malloc(ocs,
sizeof(*payload), OCS_M_ZERO);
978 if (payload == NULL) {
979 ocs_log_err(ocs,
"%s: failed to allocate memory\n", __func__);
984 ocs_sem_init(&payload->
sem, 0,
"xport_post_node_Event");
985 ocs_atomic_init(&payload->
refcnt, 2);
986 payload->
node = node;
991 ocs_log_test(ocs,
"ocs_hal_async_call failed\n");
992 ocs_free(ocs, payload,
sizeof(*payload));
998 if (ocs_sem_p(&payload->
sem, OCS_SEM_FOREVER)) {
999 ocs_log_test(ocs,
"POST_NODE_EVENT: sem wait failed\n");
1003 if (ocs_atomic_sub_and_test(&payload->
refcnt, 1))
1004 ocs_free(ocs, payload,
sizeof(*payload));
1014 va_start(argp, cmd);
1015 wwnn = va_arg(argp, uint64_t);
1018 ocs_log_debug(ocs,
" WWNN %016" PRIx64
"\n", wwnn);
1019 xport->req_wwnn = wwnn;
1030 va_start(argp, cmd);
1031 wwpn = va_arg(argp, uint64_t);
1034 ocs_log_debug(ocs,
" WWPN %016" PRIx64
"\n", wwpn);
1035 xport->req_wwpn = wwpn;
1088 if (xport->configured_link_state == 0) {
1093 result->
value = xport->configured_link_state;
1101 if (value.
value == 0) {
1120 result->
value = speed;
1133 result->
value = speed;
1140 uint32_t link_module_type;
1141 uint32_t aggregate_link_speed;
1144 speed = result->
value;
1149 if (aggregate_link_speed) {
1150 rc = (speed == aggregate_link_speed) ?
true :
false;
1165 default: rc = 0;
break;
1173 ocs_lock(&ocs->xport->fc_stats_lock);
1174 ocs_memcpy((
void *)result, &ocs->xport->fc_stats_sysfs,
1176 ocs_unlock(&ocs->xport->fc_stats_lock);
1184 ocs_log_err(ocs,
"%s: Failed to reset link statistics\n", __func__);
1190 if (ocs_sem_p(&(result->
stats.
semaphore), OCS_SEM_FOREVER) != 0) {
1192 ocs_log_test(ocs,
"ocs_sem_p failed\n");
1199 ocs_log_err(ocs,
"%s: Failed to reset host statistics\n", __func__);
1205 if (ocs_sem_p(&(result->
stats.
semaphore), OCS_SEM_FOREVER) != 0) {
1207 ocs_log_test(ocs,
"ocs_sem_p failed\n");
1258 ocs_xport_t *xport = (ocs_xport_t *)arg;
1264 result = &xport->fc_stats;
1275 ocs_log_warn(ocs,
"Received LRR local counter modified on Port: %d (prev value: 0x%x current value: 0x%x)\n",
1276 ocs->hal.sli.physical_port,
1282 ocs_log_warn(ocs,
"Received LR remote counter modified on Port: %d (prev value: 0x%x current value: 0x%x)\n",
1283 ocs->hal.sli.physical_port,
1305 ocs_t *ocs = (ocs_t *)hal->os;
1307 ocs_lock(&ocs->xport->fc_stats_lock);
1308 if (!ocs->xport->fc_stats_timer_shutdown &&
1309 !ocs_timer_pending(&ocs->xport->fc_stats_timer)) {
1310 ocs_setup_timer(ocs->hal.os, &ocs->xport->fc_stats_timer,
1313 ocs_unlock(&ocs->xport->fc_stats_lock);
1322 uint8_t bus, dev, func;
1331 uint8_t other_bus, other_dev, other_func;
1334 if ((bus == other_bus) && (dev == other_dev)) {
1335 ocs_log_debug(other_ocs,
"Removing link stats timer\n");
1336 ocs_lock(&other_ocs->xport->fc_stats_lock);
1337 other_ocs->xport->fc_stats_timer_shutdown =
true;
1338 ocs_unlock(&other_ocs->xport->fc_stats_lock);
1339 if (ocs_timer_pending(&other_ocs->xport->fc_stats_timer)) {
1340 ocs_del_timer(&other_ocs->xport->fc_stats_timer);
1356 ocs_t *ocs = (ocs_t *)arg;
1359 ocs_log_err(ocs,
"failed to locate OCS device \n");
1363 if (ocs->xport == NULL) {
1364 ocs_log_err(ocs,
"xport object is missing, "
1365 "fc stats timer is not started\n");
1370 ocs_lock(&ocs->xport->fc_stats_lock);
1371 ocs_memcpy(&ocs->xport->fc_stats_sysfs, &ocs->xport->fc_stats,
sizeof(
ocs_xport_stats_t));
1372 ocs_unlock(&ocs->xport->fc_stats_lock);
1379 ocs_log_err(ocs,
"ocs_hal_async_call failed\n");
1404 ocs_lock_free(&xport->io_pending_lock);
1407 ocs_lock_free(&xport->fcfi[i].pend_frames_lock);
1412 ocs_lock_free(&xport->fc_stats_lock);
1413 ocs_free(ocs, xport,
sizeof(*xport));
1433 ocs_log_err(ocs,
"Invalid argument\n");
1443 ocs_log_err(ocs,
"Unsupported XPORT event type\n");
int32_t ocs_scsi_host_update_supported_speed(ocs_t *ocs)
uint32_t ocs_instance(void *os)
Return instance index of an opaque ocs structure.
int ocs_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries)
Initiate ddump.
static int32_t ocs_xport_post_node_event_cb(ocs_hal_t *hal, int32_t status, uint8_t *mqe, void *arg)
post node event callback
#define OCS_TOW_FEATURE_TFB
uint32_t receive_kbyte_count
uint32_t invalid_transmission_word_error_count
static void ocs_xport_async_link_stats_cb(int32_t status, uint32_t num_counters, ocs_hal_link_stat_counts_t *counters, void *arg)
int32_t ocs_scsi_tgt_del_device(ocs_t *ocs)
Tears down the target members of the ocs structure.
int32_t ocs_scsi_tgt_new_device(ocs_t *ocs)
Initializes any target fields on the ocs structure.
HAL object describing fc host stats.
ocs_io_pool_t * ocs_io_pool_create(ocs_t *ocs, uint32_t num_io, uint32_t num_sgl)
Create a pool of IO objects.
void ocs_domain_force_free(ocs_domain_t *domain)
Free memory resources of a domain object.
static int32_t ocs_tow_feature_valid(int32_t tow_feature)
ocs_hal_rtn_e ocs_hal_init(ocs_hal_t *hal)
Allocate memory structures to prepare for the device operation.
static void ocs_xport_force_free(ocs_xport_t *xport)
Initiate force free.
void ocs_device_stop_stats_timers(ocs_t *ocs)
static int32_t ocs_list_empty(ocs_list_t *list)
Test if a list is empty.
uint32_t primitive_sequence_error_count
ocs_hal_rtn_e ocs_hal_teardown(ocs_hal_t *hal)
Tear down the Hardware Abstraction Layer module.
ocs_xport_link_stats_t link_stats
void ocs_cbuf_free(ocs_cbuf_t *cbuf)
Free a circular buffer.
static void ocs_xport_rq_threads_teardown(ocs_xport_t *xport)
Create the RQ threads and the circular buffers used to pass sequences.
Node group rpi reference.
void ocs_xport_config_stats_timer(void *arg)
Get FC link and host Statistics periodically.
int32_t ocs_scsi_ini_new_device(ocs_t *ocs)
Initializes any initiator fields on the ocs structure.
void ocs_node_post_event(ocs_node_t *node, ocs_sm_event_t evt, void *arg)
Post event to node state machine context.
#define OCS_FC_DIF_SEED
Defines the DIF seed value used for the CRC calculation.
#define OCS_FC_MAX_SGL
Defines the number of SGLs allocated on each IO object.
uint32_t uint32_t transmit_kbyte_count
int32_t ocs_port_cb(void *arg, ocs_hal_port_event_e event, void *data)
SLI port HAL callback.
int32_t ocs_xport_detach(ocs_xport_t *xport)
Detaches the transport from the device.
ocs_hal_rtn_e ocs_hal_get_host_stats(ocs_hal_t *hal, uint8_t cc, ocs_hal_host_stat_cb_t cb, void *arg)
Function to retrieve the link and host statistics.
static void ocs_device_lock(ocs_t *ocs)
static void ocs_xport_async_host_stats_cb(int32_t status, uint32_t num_counters, ocs_hal_host_stat_counts_t *counters, void *arg)
void ocs_vport_del_all(ocs_t *ocs)
Force free all saved vports.
ocs_hal_rtn_e ocs_hal_callback(ocs_hal_t *hal, ocs_hal_callback_e which, void *func, void *arg)
Register a callback for the given event.
int32_t ocs_xport_attach(ocs_xport_t *xport)
Do as much allocation as possible, but do not initialization the device.
#define OCS_DDUMP_FLAGS_DEFAULT
#define OCS_XPORT_STATS_TIMER_MS
static uint32_t sli_get_suppress_rsp_not_supported(sli4_t *sli4)
#define OCS_TOW_IO_SIZE_MAX
int32_t ocs_xport_control(ocs_xport_t *xport, ocs_xport_ctrl_e cmd,...)
Perform transport attach function.
#define OCS_FC_RQ_SIZE_DEFAULT
#define ocs_list_init(head, type, link)
int32_t ocs_unsolicited_cb(void *arg, ocs_hal_sequence_t *seq)
Handle unsolicited FC frames.
uint32_t link_failure_error_count
#define ocs_list_foreach_safe(list, item, nxt)
Iterate a linked list safely.
int32_t ocs_node_create_pool(ocs_t *ocs, uint32_t node_count)
allocate node object pool
static void ocs_device_unlock(ocs_t *ocs)
int32_t ocs_remote_node_cb(void *arg, ocs_hal_remote_node_event_e event, void *data)
Handle remote node events from HAL.
static int32_t ocs_tow_setup(ocs_t *ocs)
Setup AXR/FB optimized write parameters. Must be called after sli_setup.
ocs_hal_rtn_e ocs_hal_get(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t *value)
static int32_t ocs_tow_io_size_valid(int32_t tow_feature, int32_t tow_io_size)
ocs_hal_rtn_e ocs_hal_set_ptr(ocs_hal_t *hal, ocs_hal_property_e prop, void *value)
static int32_t ocs_xport_stats_timer_cb(ocs_hal_t *hal, int32_t status, uint8_t *mqe, void *arg)
ocs_hal_rtn_e ocs_hal_port_control(ocs_hal_t *hal, ocs_hal_port_e ctrl, uintptr_t value, ocs_hal_port_control_cb_t cb, void *arg)
Control a port (initialize, shutdown, or set link configuration).
int32_t ocs_xport_initialize(ocs_xport_t *xport)
Initializes the device.
ocs_t * ocs_get_instance(uint32_t index)
return pointer to ocs structure given instance index
#define OCS_TOW_AXR_IO_SIZE_MIN
int8_t ocs_vport_create_spec(ocs_t *ocs, uint64_t wwnn, uint64_t wwpn, uint32_t fc_id, uint32_t enable_ini, uint32_t enable_tgt, void *tgt_data, void *ini_data)
Create a saved vport entry.
void ocs_scsi_tgt_cancel_io(ocs_t *ocs)
ocs_hal_rtn_e ocs_hal_set(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t value)
void ocs_xport_domain_list_empty_cb(ocs_t *ocs, void *arg)
domain list empty callback
int32_t ocs_domain_cb(void *arg, ocs_hal_domain_event_e event, void *data)
Accept domain callback events from the HAL.
static int32_t ocs_xport_rq_threads_create(ocs_xport_t *xport, uint32_t num_rq_threads)
Create the RQ threads and the circular buffers used to pass sequences.
Post node event callback argument.
static void ocs_xport_host_stats_cb(int32_t status, uint32_t num_counters, ocs_hal_host_stat_counts_t *counters, void *arg)
ocs_cbuf_t * ocs_cbuf_alloc(ocs_os_handle_t os, uint32_t entry_count)
Initialize a circular buffer queue.
uint32_t loss_of_sync_error_count
void ocs_unregister_domain_list_empty_cb(ocs_t *ocs)
Unregister a callback for the domain_list empty cb.
#define OCS_CTRLMASK_CRASH_RESET
#define SLI4_SGE_MAX_RESERVED
Defines a general FC sequence object, consisting of a header, payload buffers and a HAL IO in the cas...
int32_t ocs_xport_cb(void *arg, ocs_hal_xport_event_e event)
callback function for xport from HAL.
void ocs_stop_event_processing(ocs_os_t *ocs_os)
ocs_xport_t * ocs_xport_alloc(ocs_t *ocs)
Allocate a transport object.
int32_t ocs_io_pool_free(ocs_io_pool_t *io_pool)
Free IO objects pool.
int32_t ocs_scsi_ini_del_device(ocs_t *ocs)
Tears down target members of ocs structure.
int32_t ocs_get_bus_dev_func(ocs_t *ocs, uint8_t *bus, uint8_t *dev, uint8_t *func)
void ocs_xport_free(ocs_xport_t *xport)
Free a transport object.
ocs_xport_host_statistics_t stats
void ocs_node_free_pool(ocs_t *ocs)
free node object pool
int32_t ocs_hal_async_call(ocs_hal_t *hal, ocs_hal_async_cb_t callback, void *arg)
Make an async callback using NOP mailbox command.
#define SLI4_MAX_FCFI
Maximum value for a FCFI.
int32_t ocs_get_property(const char *prop_name, char *buffer, uint32_t buffer_len)
get driver wide property value
ocs_hal_rtn_e ocs_hal_setup(ocs_hal_t *hal, ocs_os_handle_t os, sli4_port_type_e port_type)
Set up the Hardware Abstraction Layer module.
#define ocs_assert(cond,...)
#define OCS_TOW_FEATURE_AXR
static void ocs_xport_link_stats_cb(int32_t status, uint32_t num_counters, ocs_hal_link_stat_counts_t *counters, void *arg)
void ocs_register_domain_list_empty_cb(ocs_t *ocs)
Register a callback when the domain_list goes empty.
#define OCS_FC_DOMAIN_SHUTDOWN_TIMEOUT_USEC
void * ocs_hal_get_ptr(ocs_hal_t *hal, ocs_hal_property_e prop)
int32_t ocs_xport_status(ocs_xport_t *xport, ocs_xport_status_e cmd, ocs_xport_stats_t *result)
Return status on a link.
int32_t ocs_unsol_rq_thread(ocs_thread_t *mythread)
Process the RQ circular buffer and process the incoming frames.
static uint32_t sli_get_xib_capable(sli4_t *sli4)
ocs_xport_host_stats_t host_stats
#define OCS_RQTHREADS_MAX_SEQ_CBUF
Define rq_threads seq cbuf size to be 4K (equal to SLI RQ max length)
uint32_t transmit_frame_count
#define OCS_CTRLMASK_TEST_CHAINED_SGLS
ocs_hal_rtn_e ocs_hal_get_link_stats(ocs_hal_t *hal, uint8_t req_ext_counters, uint8_t clear_overflow_flags, uint8_t clear_all_counters, ocs_hal_link_stat_cb_t cb, void *arg)
Function to retrieve the link statistics.
Structure to hold the information related to an RQ processing thread used to increase 40G performance...
uint32_t receive_frame_count