Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_hal.h File Reference
#include "sli4.h"
#include "sli4_fc.h"
#include "ocs_hal_config.h"
#include "ocs_stats.h"
#include "ocs_array.h"
#include "ocs_ioctl.h"
#include "ocs_hal_workaround.h"
#include "ocs_hal_queues.h"

Go to the source code of this file.

Detailed Description

Defines the Hardware Abstraction Layer (HAL) interface functions.

Definition in file ocs_hal.h.

Data Structures

struct  ocs_hal_profile_descriptor_t
 A Profile Descriptor. More...
 
struct  ocs_hal_profile_list_t
 A Profile List. More...
 
struct  ocs_hal_rq_buffer_t
 Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue. More...
 
struct  ocs_hal_dif_info_t
 T10 DIF information passed to the transport. More...
 
struct  ocs_command_ctx_t
 HAL command context. More...
 
struct  ocs_hal_sgl_t
 
union  ocs_hal_io_param_t
 
struct  ocs_hal_wqe_t
 HAL wqe object. More...
 
struct  ocs_hal_io_t
 HAL IO object. More...
 
struct  ocs_hal_rpi_ref_t
 Node group rpi reference. More...
 
struct  ocs_hal_sequence_t
 Defines a general FC sequence object, consisting of a header, payload buffers and a HAL IO in the case of port owned XRI. More...
 
struct  ocs_hal_tow_buffer_t
 
struct  ocs_hal_link_stat_counts_t
 Node group rpi reference. More...
 
struct  ocs_hal_host_stat_counts_t
 HAL object describing fc host stats. More...
 
struct  ocs_hal_iopt_t
 
struct  ocs_queue_hash_t
 Stucture used for the hash lookup of queue IDs. More...
 
struct  ocs_quarantine_info_t
 
struct  hal_wq_callback_t
 Define the WQ callback object. More...
 
struct  ocs_app_watchdog_thread_t
 
struct  ocs_hal_t
 HAL object. More...
 
struct  hal_eq_t
 HAL queue forward declarations. More...
 
struct  hal_cq_t
 
struct  hal_q_t
 
struct  hal_mq_t
 
struct  hal_wq_t
 
struct  hal_rq_t
 
struct  ocs_hal_global_t
 
struct  ocs_mq_mbx_results_t
 
struct  ocs_hal_send_frame_context_t
 
struct  ocs_hal_grp_hdr
 

Macros

#define ocs_queue_history_wq(...)
 
#define ocs_queue_history_cqe(...)
 
#define ocs_queue_history_init(...)
 
#define ocs_queue_history_free(...)
 
#define ocs_hal_assert(cond)
 
#define ocs_hal_verify(cond,...)
 
#define ocs_hal_verify_arg(cond)   ocs_hal_verify(cond, OCS_HAL_RTN_INVALID_ARG)
 
#define OCS_HAL_TIMECHECK_ITERATIONS   100
 
#define OCS_HAL_MAX_NUM_MQ   1
 
#define OCS_HAL_MAX_MRQ_SETS   2
 
#define OCE_HAL_MAX_NUM_MRQ_PAIRS   16
 
#define OCS_HAL_MAX_RQ_PAIRS   38
 
#define OCS_HAL_MAX_NUM_RQ   (OCS_HAL_MAX_RQ_PAIRS * 2)
 
#define OCS_HAL_MAX_NUM_EQ   128
 
#define OCS_HAL_MAX_NUM_WQ   128
 
#define OCE_HAL_MAX_NUM_MRQ_PAIRS   16
 
#define OCS_HAL_MAX_WQ_CLASS   4
 
#define OCS_HAL_MAX_WQ_CPU   128
 
#define OCS_HAL_MAX_NUM_CQ   ((OCS_HAL_MAX_NUM_WQ*2) + 1 + (OCS_HAL_MAX_RQ_PAIRS))
 
#define OCS_HAL_Q_HASH_SIZE
 
#define OCS_HAL_RQ_HEADER_SIZE   128
 
#define OCS_HAL_RQ_HEADER_INDEX   0
 
#define OCS_TOW_IO_SIZE_MAX   65536
 
#define OCS_TOW_AXR_IO_SIZE_MIN   2048
 
#define OCS_TOW_FEATURE_AXR   0x01
 
#define OCS_TOW_FEATURE_TFB   0x02
 
#define OCS_HAL_RTN_IS_ERROR(e)   ((e) < 0)
 
#define OCS_HAL_MAX_PROFILES   40
 
#define OCS_HAL_DIF_OPER_PASS_THRU   OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_CRC
 
#define OCS_HAL_DIF_OPER_STRIP   OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_NODIF
 
#define OCS_HAL_DIF_OPER_INSERT   OCS_HAL_SGE_DIF_OP_IN_NODIF_OUT_CRC
 
#define OCS_HAL_IO_TYPE_STRINGS
 
#define OCS_HAL_RQ_INDEX_DUMMY_HDR   0xFF00
 Structure to track optimized write buffers posted to chip owned XRIs. More...
 
#define OCS_HAL_RQ_INDEX_DUMMY_DATA   0xFF01
 
#define TID_HASH_BITS   8
 
#define TID_HASH_LEN   (1U << TID_HASH_BITS)
 
#define OCS_HAL_QUARANTINE_QUEUE_DEPTH   4
 Define the fields required to implement the skyhawk DIF quarantine. More...
 
#define HAL_MAX_TCMD_THREADS   16
 
#define OCS_HAL_OBJECT_G5   0xfeaa0001
 
#define OCS_HAL_OBJECT_G6   0xfeaa0003
 
#define OCS_FILE_TYPE_GROUP   0xf7
 
#define OCS_FILE_ID_GROUP   0xa2
 
#define CPUTRACE(...)
 

Typedefs

typedef struct hal_rq_grp_s hal_rq_grp_t
 
typedef int32_t(* ocs_hal_done_t )(struct ocs_hal_io_s *, ocs_remote_node_t *, uint32_t len, int32_t status, uint32_t ext, void *ul_arg)
 HAL callback type. More...
 
typedef void(* tcmd_cq_handler )(ocs_hal_t *hal, uint32_t cq_idx, void *cq_handler_arg)
 
typedef void(* ocs_hal_port_control_cb_t )(int32_t status, uintptr_t value, void *arg)
 
typedef int32_t(* ocs_hal_srrs_cb_t )(ocs_hal_io_t *io, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *arg)
 
typedef void(* ocs_hal_fw_cb_t )(int32_t status, int32_t ext_status, uint32_t bytes_written, uint32_t change_status, void *arg)
 
typedef void(* ocs_hal_sfp_cb_t )(void *, int32_t, uint32_t, uint32_t *, void *)
 
typedef void(* ocs_hal_temp_cb_t )(int32_t status, uint32_t curr_temp, uint32_t crit_temp_thrshld, uint32_t warn_temp_thrshld, uint32_t norm_temp_thrshld, uint32_t fan_off_thrshld, uint32_t fan_on_thrshld, void *arg)
 
typedef void(* ocs_hal_link_stat_cb_t )(int32_t status, uint32_t num_counters, ocs_hal_link_stat_counts_t *counters, void *arg)
 
typedef void(* ocs_hal_host_stat_cb_t )(int32_t status, uint32_t num_counters, ocs_hal_host_stat_counts_t *counters, void *arg)
 
typedef void(* ocs_hal_dump_get_cb_t )(int32_t status, uint32_t bytes_read, uint8_t eof, void *arg)
 
typedef void(* ocs_get_port_protocol_cb_t )(int32_t status, ocs_hal_port_protocol_e port_protocol, void *arg)
 
typedef void(* ocs_set_port_protocol_cb_t )(int32_t status, void *arg)
 
typedef void(* ocs_get_profile_list_cb_t )(int32_t status, ocs_hal_profile_list_t *, void *arg)
 
typedef void(* ocs_get_active_profile_cb_t )(int32_t status, uint32_t active_profile, void *arg)
 
typedef void(* ocs_set_active_profile_cb_t )(int32_t status, void *arg)
 
typedef void(* ocs_get_nvparms_cb_t )(int32_t status, uint8_t *wwpn, uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id, void *arg)
 
typedef void(* ocs_set_nvparms_cb_t )(int32_t status, void *arg)
 
typedef void(* ocs_hal_dump_clear_cb_t )(int32_t status, void *arg)
 
typedef void(* ocs_hal_parity_stat_cb_t )(int32_t status, uint8_t num_ulp, ocs_parity_err_count_t *counter, void *arg)
 
typedef int32_t(* ocs_hal_async_cb_t )(ocs_hal_t *hal, int32_t status, uint8_t *mqe, void *arg)
 

Enumerations

enum  { OCS_CMD_POLL, OCS_CMD_NOWAIT }
 Options for ocs_hal_command(). More...
 
enum  ocs_hal_rtn_e {
  OCS_HAL_RTN_SUCCESS = 0, OCS_HAL_RTN_SUCCESS_SYNC = 1, OCS_HAL_RTN_ERROR = -1, OCS_HAL_RTN_NO_RESOURCES = -2,
  OCS_HAL_RTN_NO_MEMORY = -3, OCS_HAL_RTN_IO_NOT_ACTIVE = -4, OCS_HAL_RTN_IO_ABORT_IN_PROGRESS = -5, OCS_HAL_RTN_IO_PORT_OWNED_ALREADY_ABORTED = -6,
  OCS_HAL_RTN_INVALID_ARG = -7, OCS_HAL_RTN_NOT_SUPPORTED = -20
}
 
enum  ocs_hal_reset_e { OCS_HAL_RESET_FUNCTION, OCS_HAL_RESET_FIRMWARE, OCS_HAL_RESET_MAX }
 
enum  ocs_hal_property_e {
  OCS_HAL_N_IO, OCS_HAL_N_SGL, OCS_HAL_MAX_IO, OCS_HAL_MAX_SGE,
  OCS_HAL_MAX_SGL, OCS_HAL_MAX_NODES, OCS_HAL_MAX_RQ_ENTRIES, OCS_HAL_TOPOLOGY,
  OCS_HAL_WWN_NODE, OCS_HAL_WWN_PORT, OCS_HAL_FW_REV, OCS_HAL_FW_REV2,
  OCS_HAL_IPL, OCS_HAL_VPD, OCS_HAL_VPD_LEN, OCS_HAL_MODE,
  OCS_HAL_LINK_SPEED, OCS_HAL_LOGICAL_LINK_SPEED, OCS_HAL_AGGREGATE_LINK_SPEED, OCS_HAL_IF_TYPE,
  OCS_HAL_SLI_REV, OCS_HAL_SLI_FAMILY, OCS_HAL_RQ_PROCESS_LIMIT, OCS_HAL_RQ_DEFAULT_BUFFER_SIZE,
  OCS_HAL_AUTO_XFER_RDY_CAPABLE, OCS_HAL_TOW_CAPABLE, OCS_HAL_TOW_FEATURE, OCS_HAL_TOW_XRIS_MAX,
  OCS_HAL_TOW_IO_SIZE, OCS_HAL_TOW_XRI_CNT, OCS_HAL_TOW_BLK_SIZE, OCS_HAL_TOW_T10_ENABLE,
  OCS_HAL_TOW_P_TYPE, OCS_HAL_TOW_REF_TAG_LBA, OCS_HAL_TOW_APP_TAG_VALID, OCS_HAL_TOW_APP_TAG_VALUE,
  OCS_HAL_DIF_CAPABLE, OCS_HAL_DIF_SEED, OCS_HAL_DIF_MODE, OCS_HAL_DIF_MULTI_SEPARATE,
  OCS_HAL_DUMP_MAX_SIZE, OCS_HAL_DUMP_READY, OCS_HAL_DUMP_PRESENT, OCS_HAL_RESET_REQUIRED,
  OCS_HAL_FW_ERROR, OCS_HAL_FW_READY, OCS_HAL_HIGH_LOGIN_MODE, OCS_HAL_DPP_MODE,
  OCS_HAL_PREREGISTER_SGL, OCS_HAL_HW_REV1, OCS_HAL_HW_REV2, OCS_HAL_HW_REV3,
  OCS_HAL_LINKCFG, OCS_HAL_ETH_LICENSE, OCS_HAL_LINK_MODULE_TYPE, OCS_HAL_NUM_CHUTES,
  OCS_HAL_WAR_VERSION, OCS_HAL_DISABLE_AR_TGT_DIF, OCS_HAL_EMULATE_I_ONLY_AAB, OCS_HAL_EMULATE_TARGET_WQE_TIMEOUT,
  OCS_HAL_LINK_CONFIG_SPEED, OCS_HAL_CONFIG_TOPOLOGY, OCS_HAL_BOUNCE, OCS_HAL_PORTNUM,
  OCS_HAL_BIOS_VERSION_STRING, OCS_HAL_RQ_SELECT_POLICY, OCS_HAL_SGL_CHAINING_CAPABLE, OCS_HAL_SGL_CHAINING_ALLOWED,
  OCS_HAL_SGL_CHAINING_HOST_ALLOCATED, OCS_HAL_SEND_FRAME_CAPABLE, OCS_HAL_RQ_SELECTION_POLICY, OCS_HAL_RR_QUANTA,
  OCS_HAL_FILTER_DEF, OCS_HAL_MAX_VPORTS, OCS_HAL_ESOC, OCS_HAL_FW_TIMED_OUT,
  OCS_HAL_CQ_PROCESS_LIMIT, OCS_HAL_SUPPRESS_RSP_CAPABLE
}
 
enum  {
  OCS_HAL_TOPOLOGY_AUTO, OCS_HAL_TOPOLOGY_NPORT, OCS_HAL_TOPOLOGY_LOOP, OCS_HAL_TOPOLOGY_NONE,
  OCS_HAL_TOPOLOGY_MAX
}
 
enum  { OCS_HAL_MODE_INITIATOR, OCS_HAL_MODE_TARGET, OCS_HAL_MODE_BOTH, OCS_HAL_MODE_MAX }
 
enum  ocs_hal_port_protocol_e { OCS_HAL_PORT_PROTOCOL_ISCSI, OCS_HAL_PORT_PROTOCOL_FCOE, OCS_HAL_PORT_PROTOCOL_FC, OCS_HAL_PORT_PROTOCOL_OTHER }
 Port protocols. More...
 
enum  { OCS_HAL_DIF_MODE_INLINE, OCS_HAL_DIF_MODE_SEPARATE }
 Defines DIF operation modes. More...
 
enum  ocs_hal_rq_buffer_type_e { OCS_HAL_RQ_BUFFER_TYPE_HDR, OCS_HAL_RQ_BUFFER_TYPE_PAYLOAD, OCS_HAL_RQ_BUFFER_TYPE_MAX }
 Defines the type of RQ buffer. More...
 
enum  ocs_hal_dif_oper_e {
  OCS_HAL_DIF_OPER_DISABLED, OCS_HAL_SGE_DIF_OP_IN_NODIF_OUT_CRC, OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_NODIF, OCS_HAL_SGE_DIF_OP_IN_NODIF_OUT_CHKSUM,
  OCS_HAL_SGE_DIF_OP_IN_CHKSUM_OUT_NODIF, OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_CRC, OCS_HAL_SGE_DIF_OP_IN_CHKSUM_OUT_CHKSUM, OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_CHKSUM,
  OCS_HAL_SGE_DIF_OP_IN_CHKSUM_OUT_CRC, OCS_HAL_SGE_DIF_OP_IN_RAW_OUT_RAW
}
 T10 DIF operations. More...
 
enum  ocs_hal_dif_blk_size_e {
  OCS_HAL_DIF_BK_SIZE_512, OCS_HAL_DIF_BK_SIZE_1024, OCS_HAL_DIF_BK_SIZE_2048, OCS_HAL_DIF_BK_SIZE_4096,
  OCS_HAL_DIF_BK_SIZE_520, OCS_HAL_DIF_BK_SIZE_4104, OCS_HAL_DIF_BK_SIZE_NA = 0
}
 T10 DIF block sizes. More...
 
enum  ocs_hal_linkcfg_e {
  OCS_HAL_LINKCFG_4X10G = 0, OCS_HAL_LINKCFG_1X40G, OCS_HAL_LINKCFG_2X16G, OCS_HAL_LINKCFG_4X8G,
  OCS_HAL_LINKCFG_4X1G, OCS_HAL_LINKCFG_2X10G, OCS_HAL_LINKCFG_2X10G_2X8G, OCS_HAL_LINKCFG_NA
}
 Link configurations. More...
 
enum  {
  OCS_HAL_LINK_MODULE_TYPE_1GB = 0x0004, OCS_HAL_LINK_MODULE_TYPE_2GB = 0x0008, OCS_HAL_LINK_MODULE_TYPE_4GB = 0x0040, OCS_HAL_LINK_MODULE_TYPE_8GB = 0x0080,
  OCS_HAL_LINK_MODULE_TYPE_10GB = 0x0100, OCS_HAL_LINK_MODULE_TYPE_16GB = 0x0200, OCS_HAL_LINK_MODULE_TYPE_32GB = 0x0400
}
 link module types More...
 
enum  ocs_hal_io_type_e {
  OCS_HAL_ELS_REQ, OCS_HAL_ELS_RSP, OCS_HAL_ELS_RSP_SID, OCS_HAL_FC_CT,
  OCS_HAL_FC_CT_RSP, OCS_HAL_BLS_ACC, OCS_HAL_BLS_ACC_SID, OCS_HAL_BLS_RJT,
  OCS_HAL_BCAST, OCS_HAL_IO_TARGET_READ, OCS_HAL_IO_TARGET_WRITE, OCS_HAL_IO_TARGET_RSP,
  OCS_HAL_IO_INITIATOR_READ, OCS_HAL_IO_INITIATOR_WRITE, OCS_HAL_IO_INITIATOR_NODATA, OCS_HAL_IO_DNRX_REQUEUE,
  OCS_HAL_IO_MAX
}
 
enum  ocs_hal_io_state_e { OCS_HAL_IO_STATE_FREE, OCS_HAL_IO_STATE_INUSE, OCS_HAL_IO_STATE_WAIT_FREE, OCS_HAL_IO_STATE_WAIT_SEC_HIO }
 
enum  ocs_hal_wq_steering_e { OCS_HAL_WQ_STEERING_CLASS, OCS_HAL_WQ_STEERING_REQUEST, OCS_HAL_WQ_STEERING_CPU }
 WQ steering mode. More...
 
enum  ocs_hal_port_e { OCS_HAL_PORT_INIT, OCS_HAL_PORT_SHUTDOWN, OCS_HAL_PORT_SET_LINK_CONFIG }
 
enum  ocs_hal_domain_event_e {
  OCS_HAL_DOMAIN_ALLOC_OK, OCS_HAL_DOMAIN_ALLOC_FAIL, OCS_HAL_DOMAIN_ATTACH_OK, OCS_HAL_DOMAIN_ATTACH_FAIL,
  OCS_HAL_DOMAIN_FREE_OK, OCS_HAL_DOMAIN_FREE_FAIL, OCS_HAL_DOMAIN_LOST, OCS_HAL_DOMAIN_FOUND,
  OCS_HAL_DOMAIN_CHANGED
}
 Fabric/Domain events. More...
 
enum  ocs_hal_port_event_e {
  OCS_HAL_PORT_ALLOC_OK, OCS_HAL_PORT_ALLOC_FAIL, OCS_HAL_PORT_ATTACH_OK, OCS_HAL_PORT_ATTACH_FAIL,
  OCS_HAL_PORT_FREE_OK, OCS_HAL_PORT_FREE_FAIL
}
 
enum  ocs_hal_remote_node_event_e {
  OCS_HAL_NODE_ATTACH_OK, OCS_HAL_NODE_ATTACH_FAIL, OCS_HAL_NODE_FREE_OK, OCS_HAL_NODE_FREE_FAIL,
  OCS_HAL_NODE_FREE_ALL_OK, OCS_HAL_NODE_FREE_ALL_FAIL
}
 
enum  ocs_hal_callback_e {
  OCS_HAL_CB_DOMAIN, OCS_HAL_CB_PORT, OCS_HAL_CB_REMOTE_NODE, OCS_HAL_CB_UNSOLICITED,
  OCS_HAL_CB_BOUNCE, OCS_HAL_CB_XPORT, OCS_HAL_CB_MAX
}
 
enum  ocs_hal_xport_event_e { OCS_HAL_XPORT_FC_SPEED_UPDATE }
 
enum  ocs_hal_unsol_status_e { OCS_HAL_UNSOL_SUCCESS, OCS_HAL_UNSOL_ERROR, OCS_HAL_UNSOL_ABTS_RCVD, OCS_HAL_UNSOL_MAX }
 HAL unsolicited callback status. More...
 
enum  ocs_hal_link_stat_e {
  OCS_HAL_LINK_STAT_LINK_FAILURE_COUNT, OCS_HAL_LINK_STAT_LOSS_OF_SYNC_COUNT, OCS_HAL_LINK_STAT_LOSS_OF_SIGNAL_COUNT, OCS_HAL_LINK_STAT_PRIMITIVE_SEQ_COUNT,
  OCS_HAL_LINK_STAT_INVALID_XMIT_WORD_COUNT, OCS_HAL_LINK_STAT_CRC_COUNT, OCS_HAL_LINK_STAT_PRIMITIVE_SEQ_TIMEOUT_COUNT, OCS_HAL_LINK_STAT_ELASTIC_BUFFER_OVERRUN_COUNT,
  OCS_HAL_LINK_STAT_ARB_TIMEOUT_COUNT, OCS_HAL_LINK_STAT_ADVERTISED_RCV_B2B_CREDIT, OCS_HAL_LINK_STAT_CURR_RCV_B2B_CREDIT, OCS_HAL_LINK_STAT_ADVERTISED_XMIT_B2B_CREDIT,
  OCS_HAL_LINK_STAT_CURR_XMIT_B2B_CREDIT, OCS_HAL_LINK_STAT_RCV_EOFA_COUNT, OCS_HAL_LINK_STAT_RCV_EOFDTI_COUNT, OCS_HAL_LINK_STAT_RCV_EOFNI_COUNT,
  OCS_HAL_LINK_STAT_RCV_SOFF_COUNT, OCS_HAL_LINK_STAT_RCV_DROPPED_NO_AER_COUNT, OCS_HAL_LINK_STAT_RCV_DROPPED_NO_RPI_COUNT, OCS_HAL_LINK_STAT_RCV_DROPPED_NO_XRI_COUNT,
  OCS_HAL_LINK_STAT_LRR_COUNT_LOCAL, OCS_HAL_LINK_STAT_LR_COUNT_REMOTE, OCS_HAL_LINK_STAT_MAX
}
 HAL link stat types. More...
 
enum  ocs_hal_host_stat_e {
  OCS_HAL_HOST_STAT_TX_KBYTE_COUNT, OCS_HAL_HOST_STAT_RX_KBYTE_COUNT, OCS_HAL_HOST_STAT_TX_FRAME_COUNT, OCS_HAL_HOST_STAT_RX_FRAME_COUNT,
  OCS_HAL_HOST_STAT_TX_SEQ_COUNT, OCS_HAL_HOST_STAT_RX_SEQ_COUNT, OCS_HAL_HOST_STAT_TOTAL_EXCH_ORIG, OCS_HAL_HOST_STAT_TOTAL_EXCH_RESP,
  OCS_HAL_HOSY_STAT_RX_P_BSY_COUNT, OCS_HAL_HOST_STAT_RX_F_BSY_COUNT, OCS_HAL_HOST_STAT_DROP_FRM_DUE_TO_NO_RQ_BUF_COUNT, OCS_HAL_HOST_STAT_EMPTY_RQ_TIMEOUT_COUNT,
  OCS_HAL_HOST_STAT_DROP_FRM_DUE_TO_NO_XRI_COUNT, OCS_HAL_HOST_STAT_EMPTY_XRI_POOL_COUNT, OCS_HAL_HOST_STAT_MAX
}
 
enum  ocs_hal_state_e {
  OCS_HAL_STATE_UNINITIALIZED, OCS_HAL_STATE_QUEUES_ALLOCATED, OCS_HAL_STATE_ACTIVE, OCS_HAL_STATE_RESET_IN_PROGRESS,
  OCS_HAL_STATE_TEARDOWN_IN_PROGRESS
}
 
enum  hal_cq_handler_e { HAL_CQ_HANDLER_LOCAL, HAL_CQ_HANDLER_THREAD }
 
enum  ocs_hal_io_count_type_e {
  OCS_HAL_IO_INUSE_COUNT, OCS_HAL_IO_FREE_COUNT, OCS_HAL_IO_WAIT_FREE_COUNT, OCS_HAL_IO_PORT_OWNED_COUNT,
  OCS_HAL_IO_N_TOTAL_IO_COUNT
}
 

Functions

void _ocs_hal_assert (const char *cond, const char *filename, int linenum)
 Handle HAL assertion. More...
 
void _ocs_hal_verify (const char *cond, const char *filename, int linenum)
 Handle HAL verify. More...
 
hal_eq_t * hal_new_eq (ocs_hal_t *hal, uint32_t entry_count)
 Allocate a new EQ object. More...
 
hal_cq_t * hal_new_cq (hal_eq_t *eq, uint32_t entry_count)
 Allocate a new CQ object. More...
 
uint32_t hal_new_cq_set (hal_eq_t *eqs[], hal_cq_t *cqs[], uint32_t num_cqs, uint32_t entry_count)
 Allocate a new CQ Set of objects. More...
 
hal_mq_t * hal_new_mq (hal_cq_t *cq, uint32_t entry_count)
 Allocate a new MQ object. More...
 
hal_wq_t * hal_new_wq (hal_cq_t *cq, uint32_t entry_count, uint32_t class, uint32_t ulp)
 Allocate a new WQ object. More...
 
hal_rq_t * hal_new_rq (hal_cq_t *cq, uint32_t entry_count, uint32_t ulp)
 Allocate a hal_rq_t object. More...
 
uint32_t hal_new_rq_set (hal_cq_t *cqs[], hal_rq_t *rqs[], uint32_t num_rq_pairs, uint32_t entry_count, uint32_t ulp)
 Allocate a hal_rq_t object SET. More...
 
void hal_del_eq (hal_eq_t *eq)
 Free an EQ object. More...
 
void hal_del_cq (hal_cq_t *cq)
 Free a CQ object. More...
 
void hal_del_mq (hal_mq_t *mq)
 Free a MQ object. More...
 
void hal_del_wq (hal_wq_t *wq)
 Free a WQ object. More...
 
void hal_del_rq (hal_rq_t *rq)
 Free an RQ object. More...
 
void hal_queue_dump (ocs_hal_t *hal)
 Display HAL queue objects. More...
 
void hal_queue_teardown (ocs_hal_t *hal)
 Teardown HAL queue objects. More...
 
int32_t hal_route_rqe (ocs_hal_t *hal, ocs_hal_sequence_t *seq)
 
int32_t ocs_hal_queue_hash_find (ocs_queue_hash_t *, uint16_t)
 Find index given queue ID. More...
 
ocs_hal_rtn_e ocs_hal_setup (ocs_hal_t *, ocs_os_handle_t, sli4_port_type_e)
 Set up the Hardware Abstraction Layer module. More...
 
ocs_hal_rtn_e ocs_hal_init (ocs_hal_t *)
 Allocate memory structures to prepare for the device operation. More...
 
ocs_hal_rtn_e ocs_hal_teardown (ocs_hal_t *)
 Tear down the Hardware Abstraction Layer module. More...
 
ocs_hal_rtn_e ocs_hal_reset (ocs_hal_t *, ocs_hal_reset_e)
 
ocs_hal_rtn_e ocs_hal_port_migration (ocs_hal_t *)
 
int32_t ocs_hal_get_num_eq (ocs_hal_t *)
 
ocs_hal_rtn_e ocs_hal_get (ocs_hal_t *, ocs_hal_property_e, uint32_t *)
 
void * ocs_hal_get_ptr (ocs_hal_t *, ocs_hal_property_e)
 
ocs_hal_rtn_e ocs_hal_set (ocs_hal_t *, ocs_hal_property_e, uint32_t)
 
ocs_hal_rtn_e ocs_hal_set_ptr (ocs_hal_t *, ocs_hal_property_e, void *)
 
int32_t ocs_hal_event_check (ocs_hal_t *, uint32_t)
 Check for the events associated with the interrupt vector. More...
 
int32_t ocs_hal_process (ocs_hal_t *, uint32_t, uint32_t)
 
ocs_hal_rtn_e ocs_hal_command (ocs_hal_t *, uint8_t *, uint32_t, void *, void *)
 Issue a SLI command. More...
 
ocs_hal_rtn_e ocs_hal_callback (ocs_hal_t *, ocs_hal_callback_e, void *, void *)
 Register a callback for the given event. More...
 
ocs_hal_rtn_e ocs_hal_port_alloc (ocs_hal_t *, ocs_sli_port_t *, ocs_domain_t *, uint8_t *)
 Allocate a port object. More...
 
ocs_hal_rtn_e ocs_hal_port_attach (ocs_hal_t *, ocs_sli_port_t *, uint32_t)
 Attach a physical/virtual SLI port to a domain. More...
 
ocs_hal_rtn_e ocs_hal_port_control (ocs_hal_t *, ocs_hal_port_e, uintptr_t, ocs_hal_port_control_cb_t, void *)
 Control a port (initialize, shutdown, or set link configuration). More...
 
ocs_hal_rtn_e ocs_hal_port_free (ocs_hal_t *, ocs_sli_port_t *)
 Free port resources. More...
 
ocs_hal_rtn_e ocs_hal_domain_alloc (ocs_hal_t *, ocs_domain_t *, uint32_t, uint32_t)
 Allocate a fabric domain object. More...
 
ocs_hal_rtn_e ocs_hal_domain_attach (ocs_hal_t *, ocs_domain_t *, uint32_t)
 Attach a SLI port to a domain. More...
 
ocs_hal_rtn_e ocs_hal_domain_free (ocs_hal_t *, ocs_domain_t *)
 Free a fabric domain object. More...
 
ocs_hal_rtn_e ocs_hal_domain_force_free (ocs_hal_t *, ocs_domain_t *)
 Free a fabric domain object. More...
 
ocs_domain_t * ocs_hal_domain_get (ocs_hal_t *, uint16_t)
 
ocs_hal_rtn_e ocs_hal_node_alloc (ocs_hal_t *, ocs_remote_node_t *, uint32_t, ocs_sli_port_t *)
 Allocate a remote node object. More...
 
ocs_hal_rtn_e ocs_hal_unreg_rpi_all (ocs_hal_t *, ocs_sport_t *)
 Free all remote node objects. More...
 
ocs_hal_rtn_e ocs_hal_node_attach (ocs_hal_t *, ocs_remote_node_t *, ocs_dma_t *)
 Update a remote node object with the remote port's service parameters. More...
 
ocs_hal_rtn_e ocs_hal_node_detach (ocs_hal_t *, ocs_remote_node_t *)
 Free a remote node object. More...
 
ocs_hal_rtn_e ocs_hal_node_free_resources (ocs_hal_t *, ocs_remote_node_t *)
 Free a remote node resource. More...
 
ocs_hal_rtn_e ocs_hal_node_group_alloc (ocs_hal_t *, ocs_remote_node_group_t *)
 
ocs_hal_rtn_e ocs_hal_node_group_attach (ocs_hal_t *, ocs_remote_node_group_t *, ocs_remote_node_t *)
 
ocs_hal_rtn_e ocs_hal_node_group_free (ocs_hal_t *, ocs_remote_node_group_t *)
 
ocs_hal_io_t * ocs_hal_io_alloc (ocs_hal_t *)
 Allocate a HAL IO object. More...
 
ocs_hal_io_t * ocs_hal_io_activate_port_owned (ocs_hal_t *, ocs_hal_io_t *)
 Allocate/Activate a port owned HAL IO object. More...
 
int32_t ocs_hal_io_free (ocs_hal_t *, ocs_hal_io_t *)
 Free a previously-allocated HAL IO object. More...
 
uint8_t ocs_hal_io_inuse (ocs_hal_t *hal, ocs_hal_io_t *io)
 Check if given HAL IO is in-use. More...
 
ocs_hal_rtn_e ocs_hal_srrs_send (ocs_hal_t *, ocs_hal_io_type_e, ocs_hal_io_t *, ocs_dma_t *, uint32_t, ocs_dma_t *, ocs_remote_node_t *, ocs_hal_io_param_t *, ocs_hal_srrs_cb_t, void *)
 Send a Single Request/Response Sequence (SRRS). More...
 
ocs_hal_rtn_e ocs_hal_io_send (ocs_hal_t *, ocs_hal_io_type_e, ocs_hal_io_t *, uint32_t, ocs_hal_io_param_t *, ocs_remote_node_t *, void *, void *)
 Send a read, write, or response IO. More...
 
ocs_hal_rtn_e _ocs_hal_io_send (ocs_hal_t *hal, ocs_hal_io_type_e type, ocs_hal_io_t *io, uint32_t len, ocs_hal_io_param_t *iparam, ocs_remote_node_t *rnode, void *cb, void *arg)
 
ocs_hal_rtn_e ocs_hal_io_register_sgl (ocs_hal_t *, ocs_hal_io_t *, ocs_dma_t *, uint32_t)
 
ocs_hal_rtn_e ocs_hal_io_init_sges (ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_io_type_e type)
 Initialize the scatter gather list entries of an IO. More...
 
ocs_hal_rtn_e ocs_hal_io_add_seed_sge (ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_dif_info_t *dif_info)
 Add a T10 PI seed scatter gather list entry. More...
 
ocs_hal_rtn_e ocs_hal_io_add_sge (ocs_hal_t *, ocs_hal_io_t *, uintptr_t, uint32_t)
 Add a scatter gather list entry to an IO. More...
 
ocs_hal_rtn_e ocs_hal_io_add_dif_sge (ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr)
 Add a T10 DIF scatter gather list entry to an IO. More...
 
ocs_hal_rtn_e ocs_hal_io_abort (ocs_hal_t *, ocs_hal_io_t *, uint32_t, void *, void *)
 Abort a previously-started IO. More...
 
int32_t ocs_hal_io_get_xid (ocs_hal_t *, ocs_hal_io_t *)
 Return the OX_ID/RX_ID of the IO. More...
 
uint32_t ocs_hal_io_get_count (ocs_hal_t *, ocs_hal_io_count_type_e)
 Called to obtain the count for the specified type. More...
 
uint32_t ocs_hal_rpi_active_count (ocs_hal_t *)
 Called to obtain active RPI count. More...
 
uint32_t ocs_hal_get_rqes_produced_count (ocs_hal_t *hal)
 Called to obtain the count of produced RQs. More...
 
ocs_hal_rtn_e ocs_hal_firmware_write (ocs_hal_t *, ocs_dma_t *, uint32_t, uint32_t, int, ocs_hal_fw_cb_t, void *)
 Write a portion of a firmware image to the device. More...
 
ocs_hal_rtn_e ocs_hal_get_sfp (ocs_hal_t *, uint16_t, ocs_hal_sfp_cb_t, void *)
 Function to retrieve the SFP information. More...
 
ocs_hal_rtn_e ocs_hal_get_temperature (ocs_hal_t *, ocs_hal_temp_cb_t, void *)
 Function to retrieve the temperature information. More...
 
void ocs_read_temperature_lancer_cb (int32_t status, uint32_t curr_temp, uint32_t crit_temp_thr, uint32_t warn_temp_thr, uint32_t norm_temp_thr, uint32_t fan_off_thr, uint32_t fan_on_thr, void *arg)
 
ocs_hal_rtn_e ocs_hal_get_link_stats (ocs_hal_t *, uint8_t req_ext_counters, uint8_t clear_overflow_flags, uint8_t clear_all_counters, ocs_hal_link_stat_cb_t, void *)
 Function to retrieve the link statistics. More...
 
ocs_hal_rtn_e ocs_hal_get_host_stats (ocs_hal_t *hal, uint8_t cc, ocs_hal_host_stat_cb_t, void *arg)
 Function to retrieve the link and host statistics. More...
 
ocs_hal_rtn_e ocs_hal_raise_ue (ocs_hal_t *, uint8_t)
 Cause chip to enter an unrecoverable error state. More...
 
ocs_hal_rtn_e ocs_hal_dump_get (ocs_hal_t *, ocs_dma_t *, uint32_t, uint32_t, ocs_hal_dump_get_cb_t, void *)
 Read a dump image to the host. More...
 
ocs_hal_rtn_e ocs_hal_set_dump_to_host_buffers (ocs_hal_t *hal)
 Allocates dump dma buffers, if not already allocated. Set the Lancer dump location. More...
 
ocs_hal_rtn_e ocs_hal_run_biu_diag (ocs_hal_t *hal, void *tx_buff, size_t tx_buff_len, void *rx_buff, size_t rx_buff_len)
 Run Diagnostic PCI Loopback test. More...
 
void ocs_hal_free_dump_to_host_buffers (ocs_hal_t *hal)
 
ocs_hal_rtn_e ocs_hal_clear_dump_location (ocs_hal_t *hal)
 Clear the Lancer dump location. More...
 
ocs_hal_rtn_e ocs_hal_set_loopback_mode (ocs_hal_t *hal, uint32_t type)
 Set the Lancer dump location. More...
 
ocs_hal_rtn_e ocs_hal_set_trunk_mode (ocs_hal_t *hal, uint32_t trunk_mode)
 Set trunking mode. More...
 
ocs_hal_rtn_e ocs_hal_get_trunk_info (ocs_hal_t *hal, uint32_t *trunk_config)
 Get trunking mode information. More...
 
ocs_hal_rtn_e ocs_hal_get_port_protocol (ocs_hal_t *hal, uint32_t pci_func, ocs_get_port_protocol_cb_t mgmt_cb, void *ul_arg)
 Get the current port protocol. More...
 
ocs_hal_rtn_e ocs_hal_set_port_protocol (ocs_hal_t *hal, ocs_hal_port_protocol_e profile, uint32_t pci_func, ocs_set_port_protocol_cb_t mgmt_cb, void *ul_arg)
 Set the port protocol. More...
 
ocs_hal_rtn_e ocs_hal_get_profile_list (ocs_hal_t *hal, ocs_get_profile_list_cb_t mgmt_cb, void *arg)
 Get a list of available profiles. More...
 
ocs_hal_rtn_e ocs_hal_get_active_profile (ocs_hal_t *hal, ocs_get_active_profile_cb_t mgmt_cb, void *arg)
 Get the currently active profile. More...
 
ocs_hal_rtn_e ocs_hal_set_active_profile (ocs_hal_t *hal, ocs_set_active_profile_cb_t mgmt_cb, uint32_t profile_id, void *arg)
 Set the currently active profile. More...
 
ocs_hal_rtn_e ocs_hal_get_nvparms (ocs_hal_t *hal, ocs_get_nvparms_cb_t mgmt_cb, void *arg)
 Read non-volatile parms. More...
 
ocs_hal_rtn_e ocs_hal_set_nvparms (ocs_hal_t *hal, ocs_set_nvparms_cb_t mgmt_cb, uint8_t *wwpn, uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id, void *arg)
 Write non-volatile parms. More...
 
int32_t ocs_hal_eq_process (ocs_hal_t *hal, hal_eq_t *eq, uint32_t max_isr_time_msec)
 Process events associated with an EQ. More...
 
void ocs_hal_cq_process (ocs_hal_t *hal, hal_cq_t *cq, uint32_t cq_process_limit)
 Process entries on the given completion queue. More...
 
void ocs_hal_wq_process (ocs_hal_t *hal, hal_cq_t *cq, uint8_t *cqe, int32_t status, uint16_t rid)
 Process WQ completion queue entries. More...
 
void ocs_hal_xabt_process (ocs_hal_t *hal, hal_cq_t *cq, uint8_t *cqe, uint16_t rid)
 Process XABT completions. More...
 
int32_t hal_wq_write (hal_wq_t *wq, ocs_hal_wqe_t *wqe)
 Write a HAL IO to a work queue. More...
 
ocs_hal_rtn_e ocs_hal_dump_clear (ocs_hal_t *, ocs_hal_dump_clear_cb_t, void *)
 Clear a dump image from the device. More...
 
ocs_hal_rtn_e ocs_hal_get_itcm_parity_stats (ocs_hal_t *hal, bool clear_stats, ocs_hal_parity_stat_cb_t cb, void *arg)
 
uint8_t ocs_hal_is_io_port_owned (ocs_hal_t *hal, ocs_hal_io_t *io)
 Determine if HAL IO is owned by the port. More...
 
uint8_t ocs_hal_is_xri_port_owned (ocs_hal_t *hal, uint32_t xri)
 Return TRUE if exchange is port-owned. More...
 
ocs_hal_io_t * ocs_hal_io_lookup (ocs_hal_t *hal, uint32_t indicator)
 Find IO given indicator (xri). More...
 
uint32_t ocs_hal_xri_move_to_port_owned (ocs_hal_t *hal, uint32_t num_xri)
 Move XRIs from the host-controlled pool to the port. More...
 
ocs_hal_rtn_e ocs_hal_xri_move_to_host_owned (ocs_hal_t *hal, uint8_t num_xri)
 Move XRIs from the port-controlled pool to the host. More...
 
int32_t ocs_hal_reque_xri (ocs_hal_t *hal, ocs_hal_io_t *io)
 Reque XRI. More...
 
int32_t ocs_hal_flush (ocs_hal_t *hal)
 
int32_t ocs_hal_io_cancel (ocs_hal_t *hal)
 
ocs_hal_rtn_e ocs_hal_send_frame (ocs_hal_t *hal, fc_header_le_t *hdr, uint8_t sof, uint8_t eof, ocs_dma_t *payload, ocs_hal_send_frame_context_t *ctx, void(*callback)(void *arg, uint8_t *cqe, int32_t status), void *arg)
 Send a raw frame. More...
 
int32_t ocs_hal_rqpair_process_rq (ocs_hal_t *hal, hal_cq_t *cq, uint8_t *cqe)
 Process receive queue completions for RQ Pair mode. More...
 
ocs_hal_rtn_e ocs_hal_rqpair_sequence_free (ocs_hal_t *hal, ocs_hal_sequence_t *seq)
 Return RQ buffers (while in RQ pair mode). More...
 
int32_t ocs_hal_rqpair_tow_cmd_process (ocs_hal_t *hal, hal_cq_t *cq, uint8_t *cqe)
 Process receive queue completions for RQ Pair mode - Auto xfer rdy. More...
 
int32_t ocs_hal_rqpair_tow_data_process (ocs_hal_t *hal, hal_cq_t *cq, uint8_t *cqe)
 Process CQ completions for Auto xfer rdy data phases. More...
 
ocs_hal_rtn_e ocs_hal_rqpair_tow_buffer_alloc (ocs_hal_t *hal, uint32_t num_buffers)
 Allocate tow buffers. More...
 
ocs_hal_rtn_e ocs_hal_rqpair_init (ocs_hal_t *hal)
 Configure the rq_pair function from ocs_hal_init(). Must be after the IOs are setup and the state is active. More...
 
ocs_hal_rtn_e ocs_hal_rqpair_auto_xfer_rdy_buffer_alloc (ocs_hal_t *hal, uint32_t num_buffers)
 
uint8_t ocs_hal_rqpair_tow_xri_buffer_attach (ocs_hal_t *hal, ocs_hal_io_t *io, int reuse_buf)
 
ocs_hal_rtn_e ocs_hal_rqpair_tow_move_to_port (ocs_hal_t *hal, ocs_hal_io_t *io)
 Prepares an XRI to move to the chip. More...
 
void ocs_hal_rqpair_tow_move_to_host (ocs_hal_t *hal, ocs_hal_io_t *io)
 Prepares an XRI to move back to the host. More...
 
void ocs_hal_rqpair_teardown (ocs_hal_t *hal)
 Tear down the rq_pair function from ocs_hal_teardown(). More...
 
int ocs_hal_stop_fw_diagnostic_logging (ocs_hal_t *hal)
 Stop firmware diagnostic logging (RAS). More...
 
ocs_hal_rtn_e ocs_hal_rx_allocate (ocs_hal_t *hal)
 Allocate the RQ data buffers. More...
 
ocs_hal_rtn_e ocs_hal_rx_post (ocs_hal_t *hal)
 Post the RQ data buffers to the chip. More...
 
void ocs_hal_rx_free (ocs_hal_t *hal)
 Free the RQ data buffers. More...
 
void ocs_hal_unsol_process_bounce (void *arg)
 
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. More...
 
static void ocs_hal_sequence_copy (ocs_hal_sequence_t *dst, ocs_hal_sequence_t *src)
 
static ocs_hal_rtn_e ocs_hal_sequence_free (ocs_hal_t *hal, ocs_hal_sequence_t *seq)
 
ocs_hal_rtn_e ocs_hal_reqtag_init (ocs_hal_t *hal)
 Initialize the reqtag pool. More...
 
hal_wq_callback_t * ocs_hal_reqtag_alloc (ocs_hal_t *hal, void(*callback)(void *arg, uint8_t *cqe, int32_t status), void *arg)
 Allocate a WQ request tag. More...
 
void ocs_hal_reqtag_free (ocs_hal_t *hal, hal_wq_callback_t *wqcb)
 Free a WQ request tag. More...
 
hal_wq_callback_t * ocs_hal_reqtag_get_instance (ocs_hal_t *hal, uint32_t instance_index)
 Return WQ request tag by index. More...
 
void ocs_hal_reqtag_reset (ocs_hal_t *hal)
 Reset the WQ request tag pool. More...
 
int ocs_hal_can_accept_wqes (ocs_hal_io_t *hio)
 

Variables

ocs_hal_global_t hal_global
 

Macro Details

#define CPUTRACE (   ...)

Definition at line 1537 of file ocs_hal.h.

#define HAL_MAX_TCMD_THREADS   16

Definition at line 1090 of file ocs_hal.h.

#define OCE_HAL_MAX_NUM_MRQ_PAIRS   16

Definition at line 123 of file ocs_hal.h.

#define OCE_HAL_MAX_NUM_MRQ_PAIRS   16

Definition at line 123 of file ocs_hal.h.

#define OCS_FILE_ID_GROUP   0xa2

Definition at line 1464 of file ocs_hal.h.

#define OCS_FILE_TYPE_GROUP   0xf7

Definition at line 1463 of file ocs_hal.h.

#define ocs_hal_assert (   cond)
Value:
do { \
if ((!(cond))) { \
_ocs_hal_assert(#cond, __FILE__, __LINE__); \
} \
} while (0)
void _ocs_hal_assert(const char *cond, const char *filename, int linenum)
Handle HAL assertion.
Definition: ocs_hal.c:13483

Definition at line 82 of file ocs_hal.h.

#define OCS_HAL_DIF_OPER_INSERT   OCS_HAL_SGE_DIF_OP_IN_NODIF_OUT_CRC

Definition at line 349 of file ocs_hal.h.

#define OCS_HAL_DIF_OPER_PASS_THRU   OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_CRC

Definition at line 347 of file ocs_hal.h.

#define OCS_HAL_DIF_OPER_STRIP   OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_NODIF

Definition at line 348 of file ocs_hal.h.

#define OCS_HAL_IO_TYPE_STRINGS
Value:
"ELS request", \
"ELS response", \
"ELS response(set SID)", \
"FC CT request", \
"BLS accept", \
"BLS accept(set SID)", \
"BLS reject", \
"target read", \
"target write", \
"target response", \
"initiator read", \
"initiator write", \
"initiator nodata",

Definition at line 455 of file ocs_hal.h.

#define OCS_HAL_MAX_MRQ_SETS   2

Definition at line 114 of file ocs_hal.h.

#define OCS_HAL_MAX_NUM_CQ   ((OCS_HAL_MAX_NUM_WQ*2) + 1 + (OCS_HAL_MAX_RQ_PAIRS))

Definition at line 132 of file ocs_hal.h.

#define OCS_HAL_MAX_NUM_EQ   128

Definition at line 121 of file ocs_hal.h.

#define OCS_HAL_MAX_NUM_MQ   1

Definition at line 112 of file ocs_hal.h.

#define OCS_HAL_MAX_NUM_RQ   (OCS_HAL_MAX_RQ_PAIRS * 2)

Definition at line 120 of file ocs_hal.h.

#define OCS_HAL_MAX_NUM_WQ   128

Definition at line 122 of file ocs_hal.h.

#define OCS_HAL_MAX_PROFILES   40

Definition at line 286 of file ocs_hal.h.

#define OCS_HAL_MAX_RQ_PAIRS   38

Definition at line 119 of file ocs_hal.h.

#define OCS_HAL_MAX_WQ_CLASS   4

Definition at line 125 of file ocs_hal.h.

#define OCS_HAL_MAX_WQ_CPU   128

Definition at line 126 of file ocs_hal.h.

#define OCS_HAL_OBJECT_G5   0xfeaa0001

Definition at line 1461 of file ocs_hal.h.

#define OCS_HAL_OBJECT_G6   0xfeaa0003

Definition at line 1462 of file ocs_hal.h.

#define OCS_HAL_Q_HASH_SIZE
Value:
B32_NEXT_POWER_OF_2(OCS_MAX(OCS_HAL_MAX_NUM_MQ, OCS_MAX(OCS_HAL_MAX_NUM_RQ, \
#define OCS_HAL_MAX_NUM_RQ
Definition: ocs_hal.h:120
#define OCS_HAL_MAX_NUM_EQ
Definition: ocs_hal.h:121
#define OCS_HAL_MAX_NUM_WQ
Definition: ocs_hal.h:122
#define OCS_HAL_MAX_NUM_MQ
Definition: ocs_hal.h:112
#define OCS_HAL_MAX_NUM_CQ
Definition: ocs_hal.h:132

Definition at line 138 of file ocs_hal.h.

#define OCS_HAL_QUARANTINE_QUEUE_DEPTH   4

Define the fields required to implement the skyhawk DIF quarantine.

Definition at line 878 of file ocs_hal.h.

#define OCS_HAL_RQ_HEADER_INDEX   0

Definition at line 143 of file ocs_hal.h.

#define OCS_HAL_RQ_HEADER_SIZE   128

Definition at line 142 of file ocs_hal.h.

#define OCS_HAL_RQ_INDEX_DUMMY_DATA   0xFF01

Definition at line 814 of file ocs_hal.h.

#define OCS_HAL_RQ_INDEX_DUMMY_HDR   0xFF00

Structure to track optimized write buffers posted to chip owned XRIs.

Note: The rqindex will be set the following "fake" indexes. This will be used when the buffer is returned via ocs_seq_free() to make the buffer available for re-use on another XRI.

The dma->alloc pointer on the dummy header will be used to get back to this structure when the buffer is freed.

More of these object may be allocated on the fly if more XRIs are pushed to the chip.

Definition at line 813 of file ocs_hal.h.

#define OCS_HAL_RTN_IS_ERROR (   e)    ((e) < 0)

Definition at line 171 of file ocs_hal.h.

#define OCS_HAL_TIMECHECK_ITERATIONS   100

Definition at line 111 of file ocs_hal.h.

#define ocs_hal_verify (   cond,
  ... 
)
Value:
do { \
if ((!(cond))) { \
_ocs_hal_verify(#cond, __FILE__, __LINE__); \
return __VA_ARGS__; \
} \
} while (0)
void _ocs_hal_verify(const char *cond, const char *filename, int linenum)
Handle HAL verify.
Definition: ocs_hal.c:13502

Definition at line 89 of file ocs_hal.h.

#define ocs_hal_verify_arg (   cond)    ocs_hal_verify(cond, OCS_HAL_RTN_INVALID_ARG)

Definition at line 97 of file ocs_hal.h.

#define ocs_queue_history_cqe (   ...)

Definition at line 56 of file ocs_hal.h.

#define ocs_queue_history_free (   ...)

Definition at line 58 of file ocs_hal.h.

#define ocs_queue_history_init (   ...)

Definition at line 57 of file ocs_hal.h.

#define ocs_queue_history_wq (   ...)

Definition at line 55 of file ocs_hal.h.

#define OCS_TOW_AXR_IO_SIZE_MIN   2048

Definition at line 146 of file ocs_hal.h.

#define OCS_TOW_FEATURE_AXR   0x01

Definition at line 148 of file ocs_hal.h.

#define OCS_TOW_FEATURE_TFB   0x02

Definition at line 149 of file ocs_hal.h.

#define OCS_TOW_IO_SIZE_MAX   65536

Definition at line 145 of file ocs_hal.h.

#define TID_HASH_BITS   8

Definition at line 847 of file ocs_hal.h.

#define TID_HASH_LEN   (1U << TID_HASH_BITS)

Definition at line 848 of file ocs_hal.h.

Type Details

typedef struct hal_rq_grp_s hal_rq_grp_t

Definition at line 69 of file ocs_hal.h.

typedef void(* ocs_get_active_profile_cb_t)(int32_t status, uint32_t active_profile, void *arg)

Definition at line 1413 of file ocs_hal.h.

typedef void(* ocs_get_nvparms_cb_t)(int32_t status, uint8_t *wwpn, uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id, void *arg)

Definition at line 1418 of file ocs_hal.h.

typedef void(* ocs_get_port_protocol_cb_t)(int32_t status, ocs_hal_port_protocol_e port_protocol, void *arg)

Definition at line 1404 of file ocs_hal.h.

typedef void(* ocs_get_profile_list_cb_t)(int32_t status, ocs_hal_profile_list_t *, void *arg)

Definition at line 1411 of file ocs_hal.h.

typedef int32_t(* ocs_hal_async_cb_t)(ocs_hal_t *hal, int32_t status, uint8_t *mqe, void *arg)

Definition at line 1500 of file ocs_hal.h.

typedef int32_t(* ocs_hal_done_t)(struct ocs_hal_io_s *, ocs_remote_node_t *, uint32_t len, int32_t status, uint32_t ext, void *ul_arg)

HAL callback type.

Typedef for HAL "done" callback.

Definition at line 494 of file ocs_hal.h.

typedef void(* ocs_hal_dump_clear_cb_t)(int32_t status, void *arg)

Definition at line 1430 of file ocs_hal.h.

typedef void(* ocs_hal_dump_get_cb_t)(int32_t status, uint32_t bytes_read, uint8_t eof, void *arg)

Definition at line 1392 of file ocs_hal.h.

typedef void(* ocs_hal_fw_cb_t)(int32_t status, int32_t ext_status, uint32_t bytes_written, uint32_t change_status, void *arg)

Definition at line 1351 of file ocs_hal.h.

typedef void(* ocs_hal_host_stat_cb_t)(int32_t status, uint32_t num_counters, ocs_hal_host_stat_counts_t *counters, void *arg)

Definition at line 1385 of file ocs_hal.h.

typedef void(* ocs_hal_link_stat_cb_t)(int32_t status, uint32_t num_counters, ocs_hal_link_stat_counts_t *counters, void *arg)

Definition at line 1375 of file ocs_hal.h.

typedef void(* ocs_hal_parity_stat_cb_t)(int32_t status, uint8_t num_ulp, ocs_parity_err_count_t *counter, void *arg)

Definition at line 1433 of file ocs_hal.h.

typedef void(* ocs_hal_port_control_cb_t)(int32_t status, uintptr_t value, void *arg)

Definition at line 1314 of file ocs_hal.h.

typedef void(* ocs_hal_sfp_cb_t)(void *, int32_t, uint32_t, uint32_t *, void *)

Definition at line 1356 of file ocs_hal.h.

typedef int32_t(* ocs_hal_srrs_cb_t)(ocs_hal_io_t *io, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *arg)

Definition at line 1334 of file ocs_hal.h.

typedef void(* ocs_hal_temp_cb_t)(int32_t status, uint32_t curr_temp, uint32_t crit_temp_thrshld, uint32_t warn_temp_thrshld, uint32_t norm_temp_thrshld, uint32_t fan_off_thrshld, uint32_t fan_on_thrshld, void *arg)

Definition at line 1360 of file ocs_hal.h.

typedef void(* ocs_set_active_profile_cb_t)(int32_t status, void *arg)

Definition at line 1415 of file ocs_hal.h.

typedef void(* ocs_set_nvparms_cb_t)(int32_t status, void *arg)

Definition at line 1421 of file ocs_hal.h.

typedef void(* ocs_set_port_protocol_cb_t)(int32_t status, void *arg)

Definition at line 1406 of file ocs_hal.h.

typedef void(* tcmd_cq_handler)(ocs_hal_t *hal, uint32_t cq_idx, void *cq_handler_arg)

Definition at line 1120 of file ocs_hal.h.

Enumeration Details

anonymous enum
Enumerator
OCS_HAL_MODE_INITIATOR 
OCS_HAL_MODE_TARGET 
OCS_HAL_MODE_BOTH 
OCS_HAL_MODE_MAX 

Definition at line 268 of file ocs_hal.h.

anonymous enum

Defines DIF operation modes.

Enumerator
OCS_HAL_DIF_MODE_INLINE 
OCS_HAL_DIF_MODE_SEPARATE 

Definition at line 308 of file ocs_hal.h.

anonymous enum

link module types

(note: these just happen to match SLI4 values)

Enumerator
OCS_HAL_LINK_MODULE_TYPE_1GB 
OCS_HAL_LINK_MODULE_TYPE_2GB 
OCS_HAL_LINK_MODULE_TYPE_4GB 
OCS_HAL_LINK_MODULE_TYPE_8GB 
OCS_HAL_LINK_MODULE_TYPE_10GB 
OCS_HAL_LINK_MODULE_TYPE_16GB 
OCS_HAL_LINK_MODULE_TYPE_32GB 

Definition at line 386 of file ocs_hal.h.

anonymous enum

Options for ocs_hal_command().

Enumerator
OCS_CMD_POLL 

command executes synchronously and busy-waits for completion

OCS_CMD_NOWAIT 

command executes asynchronously. Uses callback

Definition at line 154 of file ocs_hal.h.

anonymous enum
Enumerator
OCS_HAL_TOPOLOGY_AUTO 
OCS_HAL_TOPOLOGY_NPORT 
OCS_HAL_TOPOLOGY_LOOP 
OCS_HAL_TOPOLOGY_NONE 
OCS_HAL_TOPOLOGY_MAX 

Definition at line 260 of file ocs_hal.h.

Enumerator
HAL_CQ_HANDLER_LOCAL 
HAL_CQ_HANDLER_THREAD 

Definition at line 859 of file ocs_hal.h.

Enumerator
OCS_HAL_CB_DOMAIN 
OCS_HAL_CB_PORT 
OCS_HAL_CB_REMOTE_NODE 
OCS_HAL_CB_UNSOLICITED 
OCS_HAL_CB_BOUNCE 
OCS_HAL_CB_XPORT 
OCS_HAL_CB_MAX 

must be last

Definition at line 694 of file ocs_hal.h.

T10 DIF block sizes.

Enumerator
OCS_HAL_DIF_BK_SIZE_512 
OCS_HAL_DIF_BK_SIZE_1024 
OCS_HAL_DIF_BK_SIZE_2048 
OCS_HAL_DIF_BK_SIZE_4096 
OCS_HAL_DIF_BK_SIZE_520 
OCS_HAL_DIF_BK_SIZE_4104 
OCS_HAL_DIF_BK_SIZE_NA 

Definition at line 354 of file ocs_hal.h.

T10 DIF operations.

Enumerator
OCS_HAL_DIF_OPER_DISABLED 
OCS_HAL_SGE_DIF_OP_IN_NODIF_OUT_CRC 
OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_NODIF 
OCS_HAL_SGE_DIF_OP_IN_NODIF_OUT_CHKSUM 
OCS_HAL_SGE_DIF_OP_IN_CHKSUM_OUT_NODIF 
OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_CRC 
OCS_HAL_SGE_DIF_OP_IN_CHKSUM_OUT_CHKSUM 
OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_CHKSUM 
OCS_HAL_SGE_DIF_OP_IN_CHKSUM_OUT_CRC 
OCS_HAL_SGE_DIF_OP_IN_RAW_OUT_RAW 

Definition at line 334 of file ocs_hal.h.

Fabric/Domain events.

Enumerator
OCS_HAL_DOMAIN_ALLOC_OK 

domain successfully allocated

OCS_HAL_DOMAIN_ALLOC_FAIL 

domain allocation failed

OCS_HAL_DOMAIN_ATTACH_OK 

successfully attached to domain

OCS_HAL_DOMAIN_ATTACH_FAIL 

domain attach failed

OCS_HAL_DOMAIN_FREE_OK 

successfully freed domain

OCS_HAL_DOMAIN_FREE_FAIL 

domain free failed

OCS_HAL_DOMAIN_LOST 

previously discovered domain no longer available

OCS_HAL_DOMAIN_FOUND 

new domain discovered

OCS_HAL_DOMAIN_CHANGED 

previously discovered domain properties have changed

Definition at line 664 of file ocs_hal.h.

Enumerator
OCS_HAL_HOST_STAT_TX_KBYTE_COUNT 
OCS_HAL_HOST_STAT_RX_KBYTE_COUNT 
OCS_HAL_HOST_STAT_TX_FRAME_COUNT 
OCS_HAL_HOST_STAT_RX_FRAME_COUNT 
OCS_HAL_HOST_STAT_TX_SEQ_COUNT 
OCS_HAL_HOST_STAT_RX_SEQ_COUNT 
OCS_HAL_HOST_STAT_TOTAL_EXCH_ORIG 
OCS_HAL_HOST_STAT_TOTAL_EXCH_RESP 
OCS_HAL_HOSY_STAT_RX_P_BSY_COUNT 
OCS_HAL_HOST_STAT_RX_F_BSY_COUNT 
OCS_HAL_HOST_STAT_DROP_FRM_DUE_TO_NO_RQ_BUF_COUNT 
OCS_HAL_HOST_STAT_EMPTY_RQ_TIMEOUT_COUNT 
OCS_HAL_HOST_STAT_DROP_FRM_DUE_TO_NO_XRI_COUNT 
OCS_HAL_HOST_STAT_EMPTY_XRI_POOL_COUNT 
OCS_HAL_HOST_STAT_MAX 

Definition at line 754 of file ocs_hal.h.

Enumerator
OCS_HAL_IO_INUSE_COUNT 
OCS_HAL_IO_FREE_COUNT 
OCS_HAL_IO_WAIT_FREE_COUNT 
OCS_HAL_IO_PORT_OWNED_COUNT 
OCS_HAL_IO_N_TOTAL_IO_COUNT 

Definition at line 1112 of file ocs_hal.h.

Enumerator
OCS_HAL_IO_STATE_FREE 
OCS_HAL_IO_STATE_INUSE 
OCS_HAL_IO_STATE_WAIT_FREE 
OCS_HAL_IO_STATE_WAIT_SEC_HIO 

Definition at line 446 of file ocs_hal.h.

Enumerator
OCS_HAL_ELS_REQ 

ELS request

OCS_HAL_ELS_RSP 

ELS response

OCS_HAL_ELS_RSP_SID 

ELS response, override the S_ID

OCS_HAL_FC_CT 

FC Common Transport

OCS_HAL_FC_CT_RSP 

FC Common Transport Response

OCS_HAL_BLS_ACC 

BLS accept (BA_ACC)

OCS_HAL_BLS_ACC_SID 

BLS accept (BA_ACC), override the S_ID

OCS_HAL_BLS_RJT 

BLS reject (BA_RJT)

OCS_HAL_BCAST 

Class 3 broadcast sequence

OCS_HAL_IO_TARGET_READ 
OCS_HAL_IO_TARGET_WRITE 
OCS_HAL_IO_TARGET_RSP 
OCS_HAL_IO_INITIATOR_READ 
OCS_HAL_IO_INITIATOR_WRITE 
OCS_HAL_IO_INITIATOR_NODATA 
OCS_HAL_IO_DNRX_REQUEUE 
OCS_HAL_IO_MAX 

Definition at line 426 of file ocs_hal.h.

HAL link stat types.

Enumerator
OCS_HAL_LINK_STAT_LINK_FAILURE_COUNT 
OCS_HAL_LINK_STAT_LOSS_OF_SYNC_COUNT 
OCS_HAL_LINK_STAT_LOSS_OF_SIGNAL_COUNT 
OCS_HAL_LINK_STAT_PRIMITIVE_SEQ_COUNT 
OCS_HAL_LINK_STAT_INVALID_XMIT_WORD_COUNT 
OCS_HAL_LINK_STAT_CRC_COUNT 
OCS_HAL_LINK_STAT_PRIMITIVE_SEQ_TIMEOUT_COUNT 
OCS_HAL_LINK_STAT_ELASTIC_BUFFER_OVERRUN_COUNT 
OCS_HAL_LINK_STAT_ARB_TIMEOUT_COUNT 
OCS_HAL_LINK_STAT_ADVERTISED_RCV_B2B_CREDIT 
OCS_HAL_LINK_STAT_CURR_RCV_B2B_CREDIT 
OCS_HAL_LINK_STAT_ADVERTISED_XMIT_B2B_CREDIT 
OCS_HAL_LINK_STAT_CURR_XMIT_B2B_CREDIT 
OCS_HAL_LINK_STAT_RCV_EOFA_COUNT 
OCS_HAL_LINK_STAT_RCV_EOFDTI_COUNT 
OCS_HAL_LINK_STAT_RCV_EOFNI_COUNT 
OCS_HAL_LINK_STAT_RCV_SOFF_COUNT 
OCS_HAL_LINK_STAT_RCV_DROPPED_NO_AER_COUNT 
OCS_HAL_LINK_STAT_RCV_DROPPED_NO_RPI_COUNT 
OCS_HAL_LINK_STAT_RCV_DROPPED_NO_XRI_COUNT 
OCS_HAL_LINK_STAT_LRR_COUNT_LOCAL 
OCS_HAL_LINK_STAT_LR_COUNT_REMOTE 
OCS_HAL_LINK_STAT_MAX 

must be last

Definition at line 728 of file ocs_hal.h.

Link configurations.

Enumerator
OCS_HAL_LINKCFG_4X10G 
OCS_HAL_LINKCFG_1X40G 
OCS_HAL_LINKCFG_2X16G 
OCS_HAL_LINKCFG_4X8G 
OCS_HAL_LINKCFG_4X1G 
OCS_HAL_LINKCFG_2X10G 
OCS_HAL_LINKCFG_2X10G_2X8G 
OCS_HAL_LINKCFG_NA 

Definition at line 367 of file ocs_hal.h.

Enumerator
OCS_HAL_PORT_INIT 
OCS_HAL_PORT_SHUTDOWN 
OCS_HAL_PORT_SET_LINK_CONFIG 

Definition at line 655 of file ocs_hal.h.

Enumerator
OCS_HAL_PORT_ALLOC_OK 

port successfully allocated

OCS_HAL_PORT_ALLOC_FAIL 

port allocation failed

OCS_HAL_PORT_ATTACH_OK 

successfully attached to port

OCS_HAL_PORT_ATTACH_FAIL 

port attach failed

OCS_HAL_PORT_FREE_OK 

successfully freed port

OCS_HAL_PORT_FREE_FAIL 

port free failed

Definition at line 676 of file ocs_hal.h.

Port protocols.

Enumerator
OCS_HAL_PORT_PROTOCOL_ISCSI 
OCS_HAL_PORT_PROTOCOL_FCOE 
OCS_HAL_PORT_PROTOCOL_FC 
OCS_HAL_PORT_PROTOCOL_OTHER 

Definition at line 279 of file ocs_hal.h.

Enumerator
OCS_HAL_N_IO 
OCS_HAL_N_SGL 
OCS_HAL_MAX_IO 
OCS_HAL_MAX_SGE 
OCS_HAL_MAX_SGL 
OCS_HAL_MAX_NODES 
OCS_HAL_MAX_RQ_ENTRIES 
OCS_HAL_TOPOLOGY 

auto, nport, loop

OCS_HAL_WWN_NODE 
OCS_HAL_WWN_PORT 
OCS_HAL_FW_REV 
OCS_HAL_FW_REV2 
OCS_HAL_IPL 
OCS_HAL_VPD 
OCS_HAL_VPD_LEN 
OCS_HAL_MODE 

initiator, target, both

OCS_HAL_LINK_SPEED 
OCS_HAL_LOGICAL_LINK_SPEED 
OCS_HAL_AGGREGATE_LINK_SPEED 
OCS_HAL_IF_TYPE 
OCS_HAL_SLI_REV 
OCS_HAL_SLI_FAMILY 
OCS_HAL_RQ_PROCESS_LIMIT 
OCS_HAL_RQ_DEFAULT_BUFFER_SIZE 
OCS_HAL_AUTO_XFER_RDY_CAPABLE 
OCS_HAL_TOW_CAPABLE 
OCS_HAL_TOW_FEATURE 
OCS_HAL_TOW_XRIS_MAX 
OCS_HAL_TOW_IO_SIZE 
OCS_HAL_TOW_XRI_CNT 
OCS_HAL_TOW_BLK_SIZE 
OCS_HAL_TOW_T10_ENABLE 
OCS_HAL_TOW_P_TYPE 
OCS_HAL_TOW_REF_TAG_LBA 
OCS_HAL_TOW_APP_TAG_VALID 
OCS_HAL_TOW_APP_TAG_VALUE 
OCS_HAL_DIF_CAPABLE 
OCS_HAL_DIF_SEED 
OCS_HAL_DIF_MODE 
OCS_HAL_DIF_MULTI_SEPARATE 
OCS_HAL_DUMP_MAX_SIZE 
OCS_HAL_DUMP_READY 
OCS_HAL_DUMP_PRESENT 
OCS_HAL_RESET_REQUIRED 
OCS_HAL_FW_ERROR 
OCS_HAL_FW_READY 
OCS_HAL_HIGH_LOGIN_MODE 
OCS_HAL_DPP_MODE 
OCS_HAL_PREREGISTER_SGL 
OCS_HAL_HW_REV1 
OCS_HAL_HW_REV2 
OCS_HAL_HW_REV3 
OCS_HAL_LINKCFG 
OCS_HAL_ETH_LICENSE 
OCS_HAL_LINK_MODULE_TYPE 
OCS_HAL_NUM_CHUTES 
OCS_HAL_WAR_VERSION 
OCS_HAL_DISABLE_AR_TGT_DIF 
OCS_HAL_EMULATE_I_ONLY_AAB 

emulate IAAB=0 for initiator-commands only

OCS_HAL_EMULATE_TARGET_WQE_TIMEOUT 

enable driver timeouts for target WQEs

OCS_HAL_LINK_CONFIG_SPEED 
OCS_HAL_CONFIG_TOPOLOGY 
OCS_HAL_BOUNCE 
OCS_HAL_PORTNUM 
OCS_HAL_BIOS_VERSION_STRING 
OCS_HAL_RQ_SELECT_POLICY 
OCS_HAL_SGL_CHAINING_CAPABLE 
OCS_HAL_SGL_CHAINING_ALLOWED 
OCS_HAL_SGL_CHAINING_HOST_ALLOCATED 
OCS_HAL_SEND_FRAME_CAPABLE 
OCS_HAL_RQ_SELECTION_POLICY 
OCS_HAL_RR_QUANTA 
OCS_HAL_FILTER_DEF 
OCS_HAL_MAX_VPORTS 
OCS_HAL_ESOC 
OCS_HAL_FW_TIMED_OUT 
OCS_HAL_CQ_PROCESS_LIMIT 
OCS_HAL_SUPPRESS_RSP_CAPABLE 

Definition at line 179 of file ocs_hal.h.

Enumerator
OCS_HAL_NODE_ATTACH_OK 
OCS_HAL_NODE_ATTACH_FAIL 
OCS_HAL_NODE_FREE_OK 
OCS_HAL_NODE_FREE_FAIL 
OCS_HAL_NODE_FREE_ALL_OK 
OCS_HAL_NODE_FREE_ALL_FAIL 

Definition at line 685 of file ocs_hal.h.

Enumerator
OCS_HAL_RESET_FUNCTION 
OCS_HAL_RESET_FIRMWARE 
OCS_HAL_RESET_MAX 

Definition at line 173 of file ocs_hal.h.

Defines the type of RQ buffer.

Enumerator
OCS_HAL_RQ_BUFFER_TYPE_HDR 
OCS_HAL_RQ_BUFFER_TYPE_PAYLOAD 
OCS_HAL_RQ_BUFFER_TYPE_MAX 

Definition at line 316 of file ocs_hal.h.

Enumerator
OCS_HAL_RTN_SUCCESS 
OCS_HAL_RTN_SUCCESS_SYNC 
OCS_HAL_RTN_ERROR 
OCS_HAL_RTN_NO_RESOURCES 
OCS_HAL_RTN_NO_MEMORY 
OCS_HAL_RTN_IO_NOT_ACTIVE 
OCS_HAL_RTN_IO_ABORT_IN_PROGRESS 
OCS_HAL_RTN_IO_PORT_OWNED_ALREADY_ABORTED 
OCS_HAL_RTN_INVALID_ARG 
OCS_HAL_RTN_NOT_SUPPORTED 

Definition at line 159 of file ocs_hal.h.

Enumerator
OCS_HAL_STATE_UNINITIALIZED 
OCS_HAL_STATE_QUEUES_ALLOCATED 
OCS_HAL_STATE_ACTIVE 
OCS_HAL_STATE_RESET_IN_PROGRESS 
OCS_HAL_STATE_TEARDOWN_IN_PROGRESS 

Definition at line 772 of file ocs_hal.h.

HAL unsolicited callback status.

Enumerator
OCS_HAL_UNSOL_SUCCESS 
OCS_HAL_UNSOL_ERROR 
OCS_HAL_UNSOL_ABTS_RCVD 
OCS_HAL_UNSOL_MAX 

must be last

Definition at line 710 of file ocs_hal.h.

WQ steering mode.

Enumerator
OCS_HAL_WQ_STEERING_CLASS 
OCS_HAL_WQ_STEERING_REQUEST 
OCS_HAL_WQ_STEERING_CPU 

Definition at line 563 of file ocs_hal.h.

Enumerator
OCS_HAL_XPORT_FC_SPEED_UPDATE 

Definition at line 704 of file ocs_hal.h.

Function Details

void _ocs_hal_assert ( const char *  cond,
const char *  filename,
int  linenum 
)

Handle HAL assertion.

HAL assert, display diagnostic message, and abort.

Parameters
condstring describing failing assertion condition
filenamefile name
linenumline number
Returns
none

Definition at line 13483 of file ocs_hal.c.

ocs_hal_rtn_e _ocs_hal_io_send ( ocs_hal_t *  hal,
ocs_hal_io_type_e  type,
ocs_hal_io_t *  io,
uint32_t  len,
ocs_hal_io_param_t *  iparam,
ocs_remote_node_t *  rnode,
void *  cb,
void *  arg 
)
void _ocs_hal_verify ( const char *  cond,
const char *  filename,
int  linenum 
)

Handle HAL verify.

HAL verify, display diagnostic message, dump stack and return.

Parameters
condstring describing failing verify condition
filenamefile name
linenumline number
Returns
none

Definition at line 13502 of file ocs_hal.c.

void hal_del_cq ( hal_cq_t *  cq)

Free a CQ object.

The CQ object and any child queue objects are freed

Parameters
cqpointer to CQ object
Returns
none

Definition at line 863 of file ocs_hal_queues.c.

void hal_del_eq ( hal_eq_t *  eq)

Free an EQ object.

The EQ object and any child queue objects are freed

Parameters
eqpointer to EQ object
Returns
none

Definition at line 837 of file ocs_hal_queues.c.

void hal_del_mq ( hal_mq_t *  mq)

Free a MQ object.

The MQ object is freed

Parameters
mqpointer to MQ object
Returns
none

Definition at line 900 of file ocs_hal_queues.c.

void hal_del_rq ( hal_rq_t *  rq)

Free an RQ object.

The RQ object is freed

Parameters
rqpointer to RQ object
Returns
none

Definition at line 938 of file ocs_hal_queues.c.

void hal_del_wq ( hal_wq_t *  wq)

Free a WQ object.

The WQ object is freed

Parameters
wqpointer to WQ object
Returns
none

Definition at line 919 of file ocs_hal_queues.c.

hal_cq_t* hal_new_cq ( hal_eq_t *  eq,
uint32_t  entry_count 
)

Allocate a new CQ object.

A new CQ object is instantiated

Parameters
eqpointer to parent EQ object
entry_countnumber of entries in the CQ
Returns
pointer to allocated CQ object

Definition at line 477 of file ocs_hal_queues.c.

uint32_t hal_new_cq_set ( hal_eq_t *  eqs[],
hal_cq_t *  cqs[],
uint32_t  num_cqs,
uint32_t  entry_count 
)

Allocate a new CQ Set of objects.

Parameters
eqspointer to a set of EQ objects.
cqspointer to a set of CQ objects to be returned.
num_cqsnumber of CQ queues in the set.
entry_countnumber of entries in the CQ.
Returns
0 on success and -1 on failure.

Definition at line 518 of file ocs_hal_queues.c.

hal_eq_t* hal_new_eq ( ocs_hal_t *  hal,
uint32_t  entry_count 
)

Allocate a new EQ object.

A new EQ object is instantiated

Parameters
halpointer to HAL object
entry_countnumber of entries in the EQ
Returns
pointer to allocated EQ object

Definition at line 433 of file ocs_hal_queues.c.

hal_mq_t* hal_new_mq ( hal_cq_t *  cq,
uint32_t  entry_count 
)

Allocate a new MQ object.

A new MQ object is instantiated

Parameters
cqpointer to parent CQ object
entry_countnumber of entries in the MQ
Returns
pointer to allocated MQ object

Definition at line 581 of file ocs_hal_queues.c.

hal_rq_t* hal_new_rq ( hal_cq_t *  cq,
uint32_t  entry_count,
uint32_t  ulp 
)

Allocate a hal_rq_t object.

Allocate an RQ object, which encapsulates 2 SLI queues (for rq pair)

Parameters
cqpointer to parent CQ object
entry_countnumber of entries in the RQs
ulpULP index for this RQ
Returns
pointer to newly allocated hal_rq_t

Definition at line 668 of file ocs_hal_queues.c.

uint32_t hal_new_rq_set ( hal_cq_t *  cqs[],
hal_rq_t *  rqs[],
uint32_t  num_rq_pairs,
uint32_t  entry_count,
uint32_t  ulp 
)

Allocate a hal_rq_t object SET.

Allocate an RQ object SET, where each element in set encapsulates 2 SLI queues (for rq pair)

Parameters
cqspointers to be associated with RQs.
rqsRQ pointers to be returned on success.
num_rq_pairsnumber of rq pairs in the Set.
entry_countnumber of entries in the RQs
ulpULP index for this RQ
Returns
0 in success and -1 on failure.

Definition at line 747 of file ocs_hal_queues.c.

hal_wq_t* hal_new_wq ( hal_cq_t *  cq,
uint32_t  entry_count,
uint32_t  class,
uint32_t  ulp 
)

Allocate a new WQ object.

A new WQ object is instantiated

Parameters
cqpointer to parent CQ object
entry_countnumber of entries in the WQ
classWQ class
ulpindex of chute
Returns
pointer to allocated WQ object

Definition at line 623 of file ocs_hal_queues.c.

void hal_queue_dump ( ocs_hal_t *  hal)

Display HAL queue objects.

The HAL queue objects are displayed using ocs_log

Parameters
halpointer to HAL object
Returns
none

Definition at line 967 of file ocs_hal_queues.c.

void hal_queue_teardown ( ocs_hal_t *  hal)

Teardown HAL queue objects.

The HAL queue objects are freed

Parameters
halpointer to HAL object
Returns
none

Definition at line 1012 of file ocs_hal_queues.c.

int32_t hal_route_rqe ( ocs_hal_t *  hal,
ocs_hal_sequence_t *  seq 
)
int32_t hal_wq_write ( hal_wq_t *  wq,
ocs_hal_wqe_t *  wqe 
)

Write a HAL IO to a work queue.

Description
A HAL IO is written to a work queue.
Parameters
wqPointer to work queue.
wqePointer to WQE entry.


Note: Takes the SLI-4 queue lock.

Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 4092 of file ocs_hal.c.

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.

Description
Post a NOP mailbox command; the callback with argument is invoked upon completion while in the event processing context.
Parameters
halPointer to HAL object.
callbackPointer to callback function.
argCaller-provided callback.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 13316 of file ocs_hal.c.

int ocs_hal_can_accept_wqes ( ocs_hal_io_t *  hio)
ocs_hal_rtn_e ocs_hal_clear_dump_location ( ocs_hal_t *  hal)

Clear the Lancer dump location.

Description
This function clears existsing DMA buffer set previously while setting dump location
Parameters
halHardware context.
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Definition at line 7980 of file ocs_hal.c.

void ocs_hal_cq_process ( ocs_hal_t *  hal,
hal_cq_t *  cq,
uint32_t  cq_process_limit 
)

Process entries on the given completion queue.

Parameters
halHardware context.
cqPointer to the HAL completion queue object.
Returns
None.

Definition at line 9783 of file ocs_hal.c.

ocs_domain_t* ocs_hal_domain_get ( ocs_hal_t *  ,
uint16_t   
)

Definition at line 9692 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_dump_clear ( ocs_hal_t *  hal,
ocs_hal_dump_clear_cb_t  cb,
void *  arg 
)

Clear a dump image from the device.

Description
Creates a SLI_CONFIG mailbox command, fills it with the correct values to clear the dump, then sends the command with ocs_hal_command(). On completion, the callback function ocs_hal_cb_dump_clear() gets called to free the mailbox and to signal the caller that the write has completed.
Parameters
halHardware context.
cbPointer to a callback function that is called when the command completes. The callback function prototype is void cb(int32_t status, uint32_t bytes_written, void *arg).
argPointer to be passed to the callback function.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 8354 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_dump_get ( ocs_hal_t *  hal,
ocs_dma_t *  dma,
uint32_t  size,
uint32_t  offset,
ocs_hal_dump_get_cb_t  cb,
void *  arg 
)

Read a dump image to the host.

Description
Creates a SLI_CONFIG mailbox command, fills in the correct values to read a dump image chunk, then sends the command with the ocs_hal_command(). On completion, the callback function ocs_hal_cb_dump_get() gets called to free the mailbox and signal the caller that the read has completed.
Parameters
halHardware context.
dmaDMA structure to transfer the dump chunk into.
sizeSize of the dump chunk.
offsetOffset, in bytes, from the beginning of the dump.
cbPointer to a callback function that is called when the command completes. The callback function prototype is void cb(int32_t status, uint32_t bytes_read, uint8_t eof, void *arg).
argPointer to be passed to the callback function.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 8246 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_firmware_write ( ocs_hal_t *  hal,
ocs_dma_t *  dma,
uint32_t  size,
uint32_t  offset,
int  last,
ocs_hal_fw_cb_t  cb,
void *  arg 
)

Write a portion of a firmware image to the device.

Description
Calls the correct firmware write function based on the device type.
Parameters
halHardware context.
dmaDMA structure containing the firmware image chunk.
sizeSize of the firmware image chunk.
offsetOffset, in bytes, from the beginning of the firmware image.
lastTrue if this is the last chunk of the image. Causes the image to be committed to flash.
cbPointer to a callback function that is called when the command completes. The callback function prototype is void cb(int32_t status, uint32_t bytes_written, void *arg).
argPointer to be passed to the callback function.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 5569 of file ocs_hal.c.

int32_t ocs_hal_flush ( ocs_hal_t *  hal)

Definition at line 11164 of file ocs_hal.c.

void ocs_hal_free_dump_to_host_buffers ( ocs_hal_t *  hal)

Definition at line 7561 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_get ( ocs_hal_t *  ,
ocs_hal_property_e  ,
uint32_t *   
)

If auto recovery is enabled, SLIPort flag will be cleared by the set_dump_location mbox cmd in the hal reset path. So, we have to rely on OCS dump_state flag to validate the presence of FW dumps.

Check only for FDD, and return if a dump exists on this PCI func. This can even return the presence of CLD on PCI func 0 since we really don't care about the type of dump that exists in OCS buffers.

Definition at line 1840 of file ocs_hal.c.

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.

Parameters
halHardware context.
ccclear counters, if TRUE all counters will be cleared.
cbFunction call upon completion of receiving the data.
argArgument to pass to pointer fc hosts statistics structure.
Returns
Returns OCS_HAL_RTN_SUCCESS, OCS_HAL_RTN_ERROR, or OCS_HAL_RTN_NO_MEMORY.

Definition at line 6044 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_get_itcm_parity_stats ( ocs_hal_t *  hal,
bool  clear_stats,
ocs_hal_parity_stat_cb_t  cb,
void *  arg 
)

Definition at line 6823 of file ocs_hal.c.

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.

Parameters
halHardware context.
req_ext_countersIf TRUE, then the extended counters will be requested.
clear_overflow_flagsIf TRUE, then overflow flags will be cleared.
clear_all_countersIf TRUE, the counters will be cleared.
cbFunction call upon completion of sending the data (may be NULL).
argArgument to pass to IO completion function.
Returns
Returns OCS_HAL_RTN_SUCCESS, OCS_HAL_RTN_ERROR, or OCS_HAL_RTN_NO_MEMORY.

Definition at line 5909 of file ocs_hal.c.

int32_t ocs_hal_get_num_eq ( ocs_hal_t *  )

Definition at line 1823 of file ocs_hal.c.

void* ocs_hal_get_ptr ( ocs_hal_t *  ,
ocs_hal_property_e   
)

Definition at line 2175 of file ocs_hal.c.

uint32_t ocs_hal_get_rqes_produced_count ( ocs_hal_t *  hal)

Called to obtain the count of produced RQs.

Parameters
halHardware context.
Returns
Returns the number of RQs produced.

Definition at line 9396 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_get_temperature ( ocs_hal_t *  hal,
ocs_hal_temp_cb_t  cb,
void *  arg 
)

Function to retrieve the temperature information.

Parameters
halHardware context.
cbFunction call upon completion of sending the data (may be NULL).
argArgument to pass to IO completion function.
Returns
Returns OCS_HAL_RTN_SUCCESS, OCS_HAL_RTN_ERROR, or OCS_HAL_RTN_NO_MEMORY.

Definition at line 5814 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_get_trunk_info ( ocs_hal_t *  hal,
uint32_t *  trunk_info 
)

Get trunking mode information.

Parameters
halHardware context.
trunk_infoPlaceholder to return trunk config info
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Definition at line 6987 of file ocs_hal.c.

int32_t ocs_hal_io_cancel ( ocs_hal_t *  hal)

Definition at line 11262 of file ocs_hal.c.

uint32_t ocs_hal_io_get_count ( ocs_hal_t *  hal,
ocs_hal_io_count_type_e  io_count_type 
)

Called to obtain the count for the specified type.

Parameters
halHardware context.
io_count_typeIO count type (inuse, free, wait_free).
Returns
Returns the number of IOs on the specified list type.

Definition at line 9325 of file ocs_hal.c.

ocs_hal_io_t* ocs_hal_io_lookup ( ocs_hal_t *  hal,
uint32_t  xri 
)

Find IO given indicator (xri).

Parameters
halHal context.
indicatorIndicator (xri) to look for.
Returns
Returns io if found, NULL otherwise.

Definition at line 11213 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_io_register_sgl ( ocs_hal_t *  ,
ocs_hal_io_t *  ,
ocs_dma_t *  ,
uint32_t   
)

Definition at line 4867 of file ocs_hal.c.

uint8_t ocs_hal_is_io_port_owned ( ocs_hal_t *  hal,
ocs_hal_io_t *  io 
)

Determine if HAL IO is owned by the port.

Description
Determines if the given HAL IO has been posted to the chip.
Parameters
halHardware context allocated by the caller.
ioHAL IO.
Returns
Returns TRUE if given HAL IO is port-owned.

Definition at line 12789 of file ocs_hal.c.

uint8_t ocs_hal_is_xri_port_owned ( ocs_hal_t *  hal,
uint32_t  xri 
)

Return TRUE if exchange is port-owned.

Description
Test to see if the xri is a port-owned xri.
Parameters
halHardware context.
xriExchange indicator.
Returns
Returns TRUE if XRI is a port owned XRI.

Definition at line 12808 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_node_group_alloc ( ocs_hal_t *  ,
ocs_remote_node_group_t *   
)

Definition at line 3694 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_node_group_attach ( ocs_hal_t *  ,
ocs_remote_node_group_t *  ,
ocs_remote_node_t *   
)

Definition at line 3714 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_node_group_free ( ocs_hal_t *  ,
ocs_remote_node_group_t *   
)

Definition at line 3743 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_port_migration ( ocs_hal_t *  )

Definition at line 1657 of file ocs_hal.c.

int32_t ocs_hal_process ( ocs_hal_t *  ,
uint32_t  ,
uint32_t   
)

Definition at line 2530 of file ocs_hal.c.

int32_t ocs_hal_queue_hash_find ( ocs_queue_hash_t *  hash,
uint16_t  id 
)

Find index given queue ID.

Parameters
hashPointer to hash table.
idID to find.
Returns
Returns the index into the HAL cq array or -1 if not found.

Definition at line 9564 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_raise_ue ( ocs_hal_t *  hal,
uint8_t  dump 
)

Cause chip to enter an unrecoverable error state.

Description
Cause chip to enter an unrecoverable error state. This is used when detecting unexpected FW behavior so that the FW can be halted from the driver as soon as the error is detected.
Parameters
halHardware context.
dumpGenerate dump as part of reset.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 8161 of file ocs_hal.c.

hal_wq_callback_t* ocs_hal_reqtag_alloc ( ocs_hal_t *  hal,
void(*)(void *arg, uint8_t *cqe, int32_t status)  callback,
void *  arg 
)

Allocate a WQ request tag.

Allocate and populate a WQ request tag from the WQ request tag pool.

Parameters
halPointer to HAL object.
callbackCallback function.
argPointer to callback argument.
Returns
Returns pointer to allocated WQ request tag, or NULL if object cannot be allocated.

Definition at line 13380 of file ocs_hal.c.

void ocs_hal_reqtag_free ( ocs_hal_t *  hal,
hal_wq_callback_t *  wqcb 
)

Free a WQ request tag.

Free the passed in WQ request tag.

Parameters
halPointer to HAL object.
wqcbPointer to WQ request tag object to free.
Returns
None.

Definition at line 13406 of file ocs_hal.c.

hal_wq_callback_t* ocs_hal_reqtag_get_instance ( ocs_hal_t *  hal,
uint32_t  instance_index 
)

Return WQ request tag by index.

Description
Return pointer to WQ request tag object given an index.
Parameters
halPointer to HAL object.
instance_indexIndex of WQ request tag to return.
Returns
Pointer to WQ request tag, or NULL.

Definition at line 13426 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_reqtag_init ( ocs_hal_t *  hal)

Initialize the reqtag pool.

Description
The WQ request tag pool is initialized.
Parameters
halPointer to HAL object.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 13355 of file ocs_hal.c.

void ocs_hal_reqtag_reset ( ocs_hal_t *  hal)

Reset the WQ request tag pool.

Description
Reset the WQ request tag pool, returning all to the free list.
Parameters
halpointer to HAL object.
Returns
None.

Definition at line 13448 of file ocs_hal.c.

int32_t ocs_hal_reque_xri ( ocs_hal_t *  hal,
ocs_hal_io_t *  io 
)

Reque XRI.

Description
Reque XRI
Parameters
halPointer to HAL object.
ioPointer to HAL IO
Returns
Return 0 if successful else returns -1

Definition at line 13528 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_reset ( ocs_hal_t *  ,
ocs_hal_reset_e   
)

Definition at line 1670 of file ocs_hal.c.

uint32_t ocs_hal_rpi_active_count ( ocs_hal_t *  hal)

Called to obtain active RPI count.

Parameters
halHardware context.
Returns
Returns the number of RPIs on the specified list type.

Definition at line 9371 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_rqpair_auto_xfer_rdy_buffer_alloc ( ocs_hal_t *  hal,
uint32_t  num_buffers 
)
int32_t ocs_hal_rqpair_process_rq ( ocs_hal_t *  hal,
hal_cq_t *  cq,
uint8_t *  cqe 
)

Process receive queue completions for RQ Pair mode.

Description
RQ completions are processed. In RQ pair mode, a single header and single payload buffer are received, and passed to the function that has registered for unsolicited callbacks.
Parameters
halHardware context.
cqPointer to HAL completion queue.
cqeCompletion queue entry.
Returns
Returns 0 for success, or a negative error code value for failure.

Definition at line 66 of file ocs_hal_rqpair.c.

ocs_hal_rtn_e ocs_hal_rqpair_sequence_free ( ocs_hal_t *  hal,
ocs_hal_sequence_t *  seq 
)

Return RQ buffers (while in RQ pair mode).

Description
The header and payload buffers are returned to the Receive Queue.
Parameters
halHardware context.
seqHeader/payload sequence buffers.
Returns
Returns OCS_HAL_RTN_SUCCESS on success, or an error code value on failure.

Definition at line 540 of file ocs_hal_rqpair.c.

int32_t ocs_hal_rqpair_tow_cmd_process ( ocs_hal_t *  hal,
hal_cq_t *  cq,
uint8_t *  cqe 
)

Process receive queue completions for RQ Pair mode - Auto xfer rdy.

Description
RQ completions are processed. In RQ pair mode, a single header and single payload buffer are received, and passed to the function that has registered for unsolicited callbacks.
Parameters
halHardware context.
cqPointer to HAL completion queue.
cqeCompletion queue entry.
Returns
Returns 0 for success, or a negative error code value for failure.

Definition at line 180 of file ocs_hal_rqpair.c.

int32_t ocs_hal_rqpair_tow_data_process ( ocs_hal_t *  hal,
hal_cq_t *  cq,
uint8_t *  cqe 
)

Process CQ completions for Auto xfer rdy data phases.

Description
The data is DMA'd into the data buffer posted to the SGL prior to the XRI being assigned to an IO. When the completion is received, All of the data is in the single buffer.
Parameters
halHardware context.
cqPointer to HAL completion queue.
cqeCompletion queue entry.
Returns
Returns 0 for success, or a negative error code value for failure.

Definition at line 344 of file ocs_hal_rqpair.c.

void ocs_hal_rqpair_tow_move_to_host ( ocs_hal_t *  hal,
ocs_hal_io_t *  io 
)

Prepares an XRI to move back to the host.

Description
Releases any attached buffer back to the pool.
Parameters
halHardware context allocated by the caller.
ioPointer to the IO object.

Definition at line 741 of file ocs_hal_rqpair.c.

ocs_hal_rtn_e ocs_hal_rqpair_tow_move_to_port ( ocs_hal_t *  hal,
ocs_hal_io_t *  io 
)

Prepares an XRI to move to the chip.

Description
Puts the data SGL into the SGL list for the IO object and possibly registers an SGL list for the XRI. Since both the POST_XRI and POST_SGL_PAGES commands are mailbox commands, we don't need to wait for completion before preceding.
Parameters
halHardware context allocated by the caller.
ioPointer to the IO object.
Returns
Returns OCS_HAL_RTN_SUCCESS for success, or an error code value for failure.

Definition at line 695 of file ocs_hal_rqpair.c.

uint8_t ocs_hal_rqpair_tow_xri_buffer_attach ( ocs_hal_t *  hal,
ocs_hal_io_t *  io,
int  reuse_buf 
)
ocs_hal_rtn_e ocs_hal_run_biu_diag ( ocs_hal_t *  hal,
void *  tx_buff,
size_t  tx_buff_len,
void *  rx_buff,
size_t  rx_buff_len 
)

Run Diagnostic PCI Loopback test.

Description
This will run PCI loopback tests
Parameters
halHardware context.
TXDMA buffer address
TXDMA buffer size
RXDMA buffer address
RXDMA buffer size
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Definition at line 7801 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_rx_allocate ( ocs_hal_t *  hal)

Allocate the RQ data buffers.

Parameters
halPointer to HAL object.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 13129 of file ocs_hal.c.

void ocs_hal_rx_free ( ocs_hal_t *  hal)

Free the RQ data buffers.

Parameters
halPointer to HAL object.

Definition at line 13231 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_rx_post ( ocs_hal_t *  hal)

Post the RQ data buffers to the chip.

Parameters
halPointer to HAL object.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 13186 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_send_frame ( ocs_hal_t *  hal,
fc_header_le_t *  hdr,
uint8_t  sof,
uint8_t  eof,
ocs_dma_t *  payload,
ocs_hal_send_frame_context_t *  ctx,
void(*)(void *arg, uint8_t *cqe, int32_t status)  callback,
void *  arg 
)

Send a raw frame.

Description
Using the SEND_FRAME_WQE, a frame consisting of header and payload is sent.
Parameters
halPointer to HAL object.
hdrPointer to a little endian formatted FC header.
sofValue to use as the frame SOF.
eofValue to use as the frame EOF.
payloadPointer to payload DMA buffer.
ctxPointer to caller provided send frame context.
callbackCallback function.
argCallback function argument.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 4817 of file ocs_hal.c.

static void ocs_hal_sequence_copy ( ocs_hal_sequence_t *  dst,
ocs_hal_sequence_t *  src 
)
inlinestatic

Definition at line 1504 of file ocs_hal.h.

static ocs_hal_rtn_e ocs_hal_sequence_free ( ocs_hal_t *  hal,
ocs_hal_sequence_t *  seq 
)
inlinestatic

Definition at line 1512 of file ocs_hal.h.

ocs_hal_rtn_e ocs_hal_set ( ocs_hal_t *  ,
ocs_hal_property_e  ,
uint32_t   
)

Definition at line 2214 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set_dump_to_host_buffers ( ocs_hal_t *  hal)

Allocates dump dma buffers, if not already allocated. Set the Lancer dump location.

Description
This function tells a Lancer chip to use a specific DMA buffer as a dump location rather than the internal flash.
Parameters
halHardware context.
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Make sure the FW is new enough to support this command. If the FW is too old, the FW will UE.

Definition at line 7721 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set_loopback_mode ( ocs_hal_t *  hal,
uint32_t  type 
)

Set the Lancer dump location.

Description
This function set link loopback mode
Parameters
halHardware context.
typeloopback type to be set
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Definition at line 7772 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set_ptr ( ocs_hal_t *  ,
ocs_hal_property_e  ,
void *   
)

Definition at line 2437 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set_trunk_mode ( ocs_hal_t *  hal,
uint32_t  trunk_mode 
)

Set trunking mode.

Parameters
halHardware context.
trunk_modeTrunk mode to set
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Definition at line 6951 of file ocs_hal.c.

int ocs_hal_stop_fw_diagnostic_logging ( ocs_hal_t *  hal)

Stop firmware diagnostic logging (RAS).

Parameters
halHardware context.
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Definition at line 7016 of file ocs_hal.c.

void ocs_hal_unsol_process_bounce ( void *  arg)

Definition at line 2518 of file ocs_hal.c.

void ocs_hal_wq_process ( ocs_hal_t *  hal,
hal_cq_t *  cq,
uint8_t *  cqe,
int32_t  status,
uint16_t  rid 
)

Process WQ completion queue entries.

Parameters
halHardware context.
cqPointer to the HAL completion queue object.
cqePointer to WQ completion queue.
statusCompletion status.
ridResource ID (IO tag).
Returns
none

Definition at line 9898 of file ocs_hal.c.

void ocs_hal_xabt_process ( ocs_hal_t *  hal,
hal_cq_t *  cq,
uint8_t *  cqe,
uint16_t  rid 
)

Process XABT completions.

Parameters
halHardware context.
cqPointer to the HAL completion queue object.
cqePointer to WQ completion queue.
ridResource ID (IO tag).
Returns
None.

Definition at line 10284 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_xri_move_to_host_owned ( ocs_hal_t *  hal,
uint8_t  num_xri 
)

Move XRIs from the port-controlled pool to the host.

Requests XRIs from the FW to return to the host-owned pool.

Parameters
halHardware context.
num_xriThe number of XRIs being requested to moved from the chip.
Returns
Returns 0 for success, or a negative error code value for failure.

Definition at line 13022 of file ocs_hal.c.

uint32_t ocs_hal_xri_move_to_port_owned ( ocs_hal_t *  hal,
uint32_t  num_xri 
)

Move XRIs from the host-controlled pool to the port.

Description
Removes IOs from the free list and moves them to the port.
Parameters
halHardware context.
num_xriThe number of XRIs being requested to move to the chip.
Returns
Returns the number of XRIs that were moved.

Definition at line 12921 of file ocs_hal.c.

void ocs_read_temperature_lancer_cb ( int32_t  status,
uint32_t  curr_temp,
uint32_t  crit_temp_thr,
uint32_t  warn_temp_thr,
uint32_t  norm_temp_thr,
uint32_t  fan_off_thr,
uint32_t  fan_on_thr,
void *  arg 
)

Definition at line 1059 of file ocs_mgmt.c.

Variable Details

ocs_hal_global_t hal_global

Definition at line 78 of file ocs_hal.c.