52 #if defined(OCS_INCLUDE_DEBUG)
55 #define ocs_queue_history_wq(...)
56 #define ocs_queue_history_cqe(...)
57 #define ocs_queue_history_init(...)
58 #define ocs_queue_history_free(...)
75 extern void _ocs_hal_assert(
const char *cond,
const char *filename,
int linenum);
76 extern void _ocs_hal_verify(
const char *cond,
const char *filename,
int linenum);
78 #if defined(HAL_NDEBUG)
79 #define ocs_hal_assert(cond)
80 #define ocs_hal_verify(cond, ...)
82 #define ocs_hal_assert(cond) \
85 _ocs_hal_assert(#cond, __FILE__, __LINE__); \
89 #define ocs_hal_verify(cond, ...) \
92 _ocs_hal_verify(#cond, __FILE__, __LINE__); \
97 #define ocs_hal_verify_arg(cond) ocs_hal_verify(cond, OCS_HAL_RTN_INVALID_ARG)
111 #define OCS_HAL_TIMECHECK_ITERATIONS 100
112 #define OCS_HAL_MAX_NUM_MQ 1
114 #define OCS_HAL_MAX_MRQ_SETS 2
115 #define OCE_HAL_MAX_NUM_MRQ_PAIRS 16 // MAX pairs in MRQ SET
119 #define OCS_HAL_MAX_RQ_PAIRS 38
120 #define OCS_HAL_MAX_NUM_RQ (OCS_HAL_MAX_RQ_PAIRS * 2)
121 #define OCS_HAL_MAX_NUM_EQ 128
122 #define OCS_HAL_MAX_NUM_WQ 128
123 #define OCE_HAL_MAX_NUM_MRQ_PAIRS 16
125 #define OCS_HAL_MAX_WQ_CLASS 4
126 #define OCS_HAL_MAX_WQ_CPU 128
132 #define OCS_HAL_MAX_NUM_CQ ((OCS_HAL_MAX_NUM_WQ*2) + 1 + (OCS_HAL_MAX_RQ_PAIRS))
138 #define OCS_HAL_Q_HASH_SIZE B32_NEXT_POWER_OF_2(OCS_MAX(OCS_HAL_MAX_NUM_MQ, OCS_MAX(OCS_HAL_MAX_NUM_RQ, \
139 OCS_MAX(OCS_HAL_MAX_NUM_EQ, OCS_MAX(OCS_HAL_MAX_NUM_WQ, \
140 OCS_HAL_MAX_NUM_CQ)))))
142 #define OCS_HAL_RQ_HEADER_SIZE 128
143 #define OCS_HAL_RQ_HEADER_INDEX 0
145 #define OCS_TOW_IO_SIZE_MAX 65536
146 #define OCS_TOW_AXR_IO_SIZE_MIN 2048
148 #define OCS_TOW_FEATURE_AXR 0x01
149 #define OCS_TOW_FEATURE_TFB 0x02
171 #define OCS_HAL_RTN_IS_ERROR(e) ((e) < 0)
286 #define OCS_HAL_MAX_PROFILES 40
293 char profile_description[512];
347 #define OCS_HAL_DIF_OPER_PASS_THRU OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_CRC
348 #define OCS_HAL_DIF_OPER_STRIP OCS_HAL_SGE_DIF_OP_IN_CRC_OUT_NODIF
349 #define OCS_HAL_DIF_OPER_INSERT OCS_HAL_SGE_DIF_OP_IN_NODIF_OUT_CRC
400 typedef struct ocs_hal_dif_info_s {
405 uint32_t app_tag_cmp:16,
407 uint32_t check_ref_tag:1,
420 disable_app_ref_ffff:1,
455 #define OCS_HAL_IO_TYPE_STRINGS \
458 "ELS response(set SID)", \
461 "BLS accept(set SID)", \
475 typedef struct ocs_command_ctx_s {
478 int32_t (*cb)(
struct ocs_hal_s *, int32_t, uint8_t *,
void *);
484 typedef struct ocs_hal_sgl_s {
497 typedef union ocs_hal_io_param_u {
573 uint32_t abort_wqe_submit_needed:1,
575 auto_xfer_rdy_dnrx:1,
813 #define OCS_HAL_RQ_INDEX_DUMMY_HDR 0xFF00
814 #define OCS_HAL_RQ_INDEX_DUMMY_DATA 0xFF01
815 typedef struct ocs_hal_tow_buffer_s {
847 #define TID_HASH_BITS 8
848 #define TID_HASH_LEN (1U << TID_HASH_BITS)
850 typedef struct ocs_hal_iopt_s {
878 #define OCS_HAL_QUARANTINE_QUEUE_DEPTH 4
890 void (*callback)(
void *arg, uint8_t *cqe, int32_t status);
1031 int32_t (*
bounce)(void (*)(
void *arg),
void *arg, uint32_t s_id, uint32_t d_id, uint32_t ox_id);
1081 #if defined(OCS_DEBUG_QUEUE_HISTORY)
1082 ocs_hal_q_hist_t q_hist;
1090 #define HAL_MAX_TCMD_THREADS 16
1220 uint32_t wq_pending_count;
1260 uint32_t hdr_use_count;
1261 uint32_t fb_use_count;
1262 uint32_t payload_use_count;
1266 typedef struct ocs_hal_global_s {
1272 typedef struct ocs_mq_mbx_results_s {
1282 extern hal_eq_t *
hal_new_eq(ocs_hal_t *hal, uint32_t entry_count);
1283 extern hal_cq_t *
hal_new_cq(hal_eq_t *eq, uint32_t entry_count);
1284 extern uint32_t
hal_new_cq_set(hal_eq_t *eqs[], hal_cq_t *cqs[], uint32_t num_cqs, uint32_t entry_count);
1285 extern hal_mq_t *
hal_new_mq(hal_cq_t *cq, uint32_t entry_count);
1286 extern hal_wq_t *
hal_new_wq(hal_cq_t *cq, uint32_t entry_count, uint32_t
class, uint32_t ulp);
1287 extern hal_rq_t *
hal_new_rq(hal_cq_t *cq, uint32_t entry_count, uint32_t ulp);
1288 extern 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);
1334 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);
1339 void *cb,
void *arg);
1351 typedef void (*
ocs_hal_fw_cb_t)(int32_t status, int32_t ext_status, uint32_t bytes_written,
1352 uint32_t change_status,
void *arg);
1362 uint32_t crit_temp_thrshld,
1363 uint32_t warn_temp_thrshld,
1364 uint32_t norm_temp_thrshld,
1365 uint32_t fan_off_thrshld,
1366 uint32_t fan_on_thrshld,
1370 uint32_t crit_temp_thr, uint32_t warn_temp_thr,
1371 uint32_t norm_temp_thr, uint32_t fan_off_thr,
1372 uint32_t fan_on_thr,
void *arg);
1376 uint32_t num_counters,
1380 uint8_t req_ext_counters,
1381 uint8_t clear_overflow_flags,
1382 uint8_t clear_all_counters,
1386 uint32_t num_counters,
1397 void *rx_buff,
size_t rx_buff_len);
1417 uint32_t profile_id,
void *arg);
1419 uint32_t preferred_d_id,
void *arg);
1423 uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id,
void *arg);
1424 extern int32_t
ocs_hal_eq_process(ocs_hal_t *hal, hal_eq_t *eq, uint32_t max_isr_time_msec);
1425 extern void ocs_hal_cq_process(ocs_hal_t *hal, hal_cq_t *cq, uint32_t cq_process_limit);
1426 extern void ocs_hal_wq_process(ocs_hal_t *hal, hal_cq_t *cq, uint8_t *cqe, int32_t status, uint16_t rid);
1452 void (*callback)(int32_t status,
void *arg);
1461 #define OCS_HAL_OBJECT_G5 0xfeaa0001
1462 #define OCS_HAL_OBJECT_G6 0xfeaa0003
1463 #define OCS_FILE_TYPE_GROUP 0xf7
1464 #define OCS_FILE_ID_GROUP 0xa2
1478 void (*callback)(
void *arg, uint8_t *cqe, int32_t status),
void *arg);
1508 ocs_memset(&dst->
link, 0,
sizeof(dst->
link));
1521 void (*callback)(
void *arg, uint8_t *cqe, int32_t status),
void *arg);
1527 #if defined(OCS_ENABLE_FIRST_BURST)
1528 int32_t ocs_first_burst_enabled(ocs_t *ocs);
1533 #ifdef ENABLE_CPUTRACE
1534 #define CPUTRACE(t) ocs_printf("trace: %-20s %2s %-16s cpu %2d\n", __func__, t, \
1535 ({ocs_thread_t *self = ocs_thread_self(); self != NULL ? self->name : "unknown";}), ocs_thread_getcpu());
1537 #define CPUTRACE(...)
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.
const char * queue_topology
ocs_hal_rtn_e ocs_hal_domain_attach(ocs_hal_t *hal, ocs_domain_t *domain, uint32_t fc_id)
Attach a SLI port to a domain.
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 ...
void ocs_hal_xabt_process(ocs_hal_t *hal, hal_cq_t *cq, uint8_t *cqe, uint16_t rid)
Process XABT completions.
int32_t ocs_hal_flush(ocs_hal_t *hal)
ocs_varray_t * wq_class_array[OCS_HAL_MAX_WQ_CLASS]
struct ocs_hal_io_s * sec_hio
#define OCS_HAL_MAX_WQ_CLASS
ocs_lock_t iopc_list_lock
int32_t ocs_hal_io_free(ocs_hal_t *hal, ocs_hal_io_t *io)
Free a previously-allocated HAL IO object.
ocs_hal_link_stat_e
HAL link stat types.
void _ocs_hal_assert(const char *cond, const char *filename, int linenum)
Handle HAL assertion.
ocs_domain_t * domains[SLI4_MAX_FCFI]
ocs_hal_rtn_e ocs_hal_srrs_send(ocs_hal_t *hal, ocs_hal_io_type_e type, ocs_hal_io_t *io, ocs_dma_t *send, uint32_t len, ocs_dma_t *receive, ocs_remote_node_t *rnode, ocs_hal_io_param_t *iparam, ocs_hal_srrs_cb_t cb, void *arg)
Send a Single Request/Response Sequence (SRRS).
ocs_hal_rq_buffer_t payload
uint32_t tcmd_wq_complete[OCS_HAL_MAX_NUM_WQ]
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)
ocs_hal_rtn_e ocs_hal_get_sfp(ocs_hal_t *hal, uint16_t page, ocs_hal_sfp_cb_t cb, void *arg)
Function to retrieve the SFP information.
int32_t(* port)(void *, ocs_hal_port_event_e, void *)
ocs_list_t ocs_list_link_t
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.
uint8_t ocs_hal_io_inuse(ocs_hal_t *hal, ocs_hal_io_t *io)
Check if given HAL IO is in-use.
ocs_hal_rtn_e ocs_hal_node_alloc(ocs_hal_t *hal, ocs_remote_node_t *rnode, uint32_t fc_addr, ocs_sli_port_t *sport)
Allocate a remote node object.
ocs_list_t sec_hio_wait_list
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.
uint32_t filter_def[SLI4_CMD_REG_FCFI_NUM_RQ_CFG]
uint32_t ocs_hal_get_rqes_produced_count(ocs_hal_t *hal)
Called to obtain the count of produced RQs.
HAL object describing fc host stats.
int32_t hal_wq_write(hal_wq_t *wq, ocs_hal_wqe_t *wqe)
Write a HAL IO to a work queue.
const char * sliport_pause_errors
void ocs_hal_reqtag_free(ocs_hal_t *hal, hal_wq_callback_t *wqcb)
Free a WQ request tag.
ocs_hal_rtn_e ocs_hal_get_port_protocol(ocs_hal_t *hal, uint32_t pci_func, ocs_get_port_protocol_cb_t cb, void *ul_arg)
Get the current port protocol.
uint8_t tow_app_tag_valid
int32_t(* domain)(void *, ocs_hal_domain_event_e, void *)
void ocs_hal_reqtag_reset(ocs_hal_t *hal)
Reset the WQ request tag pool.
ocs_hal_rtn_e ocs_hal_init(ocs_hal_t *hal)
Allocate memory structures to prepare for the device operation.
ocs_hal_rtn_e ocs_hal_rqpair_tow_buffer_alloc(ocs_hal_t *hal, uint32_t num_buffers)
Allocate tow buffers.
ocs_hal_rtn_e ocs_hal_port_migration(ocs_hal_t *hal)
HAL queue forward declarations.
ocs_hal_rq_buffer_t * header
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)
void(* ocs_set_active_profile_cb_t)(int32_t status, void *arg)
int32_t ocs_hal_io_get_xid(ocs_hal_t *hal, ocs_hal_io_t *io)
Return the OX_ID/RX_ID of the IO.
uint8_t ocs_hal_is_xri_port_owned(ocs_hal_t *hal, uint32_t xri)
Return TRUE if exchange is port-owned.
hal_eq_t * hal_eq[OCS_HAL_MAX_NUM_EQ]
void hal_queue_teardown(ocs_hal_t *hal)
Teardown HAL queue objects.
T10 DIF information passed to the transport.
void hal_del_wq(hal_wq_t *wq)
Free a WQ object.
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.
int32_t ocs_hal_get_num_eq(ocs_hal_t *hal)
ocs_hal_rtn_e ocs_hal_teardown(ocs_hal_t *hal)
Tear down the Hardware Abstraction Layer module.
void(* ocs_hal_parity_stat_cb_t)(int32_t status, uint8_t num_ulp, ocs_parity_err_count_t *counter, void *arg)
#define SLI4_CMD_REG_FCFI_NUM_RQ_CFG
REG_FCFI - activate a FC Forwarder.
struct ocs_hal_s::@23 callback
ocs_timer_t watchdog_timer
int32_t(* unsolicited)(void *, ocs_hal_sequence_t *)
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.
ocs_hal_rtn_e ocs_hal_unreg_rpi_all(ocs_hal_t *hal, ocs_sport_t *sport)
Free all remote node objects.
ocs_queue_hash_t * wq_hash
uint32_t ocs_list_t iopc_list
void ocs_hal_free_dump_to_host_buffers(ocs_hal_t *hal)
ocs_atomic_t send_frame_seq_id
void hal_del_rq(hal_rq_t *rq)
Free an RQ object.
ocs_hal_global_t hal_global
#define OCS_HAL_MAX_NUM_RQ
ocs_atomic_t rpi_attached
Node group rpi reference.
ocs_hal_rtn_e ocs_hal_io_abort(ocs_hal_t *hal, ocs_hal_io_t *io_to_abort, uint32_t send_abts, void *cb, void *arg)
Abort a previously-started IO.
void hal_del_cq(hal_cq_t *cq)
Free a CQ object.
ocs_hal_rtn_e ocs_hal_port_attach(ocs_hal_t *hal, ocs_sli_port_t *sport, uint32_t fc_id)
Attach a physical/virtual SLI port to a domain.
ocs_hal_rtn_e ocs_hal_get_profile_list(ocs_hal_t *hal, ocs_get_profile_list_cb_t cb, void *ul_arg)
Get a list of available profiles.
void(* ocs_get_profile_list_cb_t)(int32_t status, ocs_hal_profile_list_t *, void *arg)
ocs_hal_rtn_e ocs_hal_node_group_attach(ocs_hal_t *hal, ocs_remote_node_group_t *ngroup, ocs_remote_node_t *rnode)
ocs_hal_rq_buffer_t header
ocs_varray_t * wq_cpu_array[OCS_HAL_MAX_WQ_CPU]
ocs_hal_wq_steering_e wq_steering
ocs_hal_rq_buffer_type_e
Defines the type of RQ buffer.
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.
ocs_hal_rq_buffer_t ** hdr_buf
ocs_hal_rq_buffer_t ** payload_buf
uint32_t fw_diag_log_size
sli4_lsp_sge_t * ovfl_lsp
static void ocs_hal_sequence_copy(ocs_hal_sequence_t *dst, ocs_hal_sequence_t *src)
#define OCS_HAL_MAX_NUM_EQ
int32_t ocs_hal_reque_xri(ocs_hal_t *hal, ocs_hal_io_t *io)
Reque XRI.
Node group rpi reference.
void(* ocs_get_active_profile_cb_t)(int32_t status, uint32_t active_profile, void *arg)
ocs_hal_rtn_e ocs_hal_set_loopback_mode(ocs_hal_t *hal, uint32_t type)
Set the Lancer dump location.
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.
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.
uint8_t emulate_tgt_wqe_timeout
ocs_hal_io_param_t sec_iparam
ocs_hal_rtn_e ocs_hal_io_add_sge(ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr, uint32_t length)
Add a scatter gather list entry to an IO.
ocs_hal_rtn_e ocs_hal_domain_force_free(ocs_hal_t *hal, ocs_domain_t *domain)
Free a fabric domain object.
#define OCS_HAL_MAX_NUM_WQ
Define the WQ callback object.
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_hal_queue_hash_find(ocs_queue_hash_t *hash, uint16_t id)
Find index given queue ID.
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)
uint32_t ocs_pool_t * tow_buffer_pool
hal_rq_t * hal_new_rq(hal_cq_t *cq, uint32_t entry_count, uint32_t ulp)
Allocate a hal_rq_t object.
#define OCS_HAL_MAX_NUM_MQ
ocs_atomic_t io_alloc_failed_count
hal_wq_t * hal_wq[OCS_HAL_MAX_NUM_WQ]
hal_wq_callback_t * ocs_hal_reqtag_get_instance(ocs_hal_t *hal, uint32_t instance_index)
Return WQ request tag by index.
hal_cq_t * hal_new_cq(hal_eq_t *eq, uint32_t entry_count)
Allocate a new CQ object.
uint32_t fw_diag_log_level
uint32_t port_owned_abort_count
void(* ocs_hal_fw_cb_t)(int32_t status, int32_t ext_status, uint32_t bytes_written, uint32_t change_status, void *arg)
ocs_hal_rtn_e ocs_hal_rqpair_auto_xfer_rdy_buffer_alloc(ocs_hal_t *hal, uint32_t num_buffers)
ocs_hal_port_protocol_e
Port protocols.
ocs_hal_io_t * ocs_hal_io_lookup(ocs_hal_t *hal, uint32_t xri)
Find IO given indicator (xri).
uint8_t ocs_hal_rqpair_tow_xri_buffer_attach(ocs_hal_t *hal, ocs_hal_io_t *io, int reuse_buf)
int ocs_hal_can_accept_wqes(struct ocs_hal_io_s *hio)
Validate HAL IO state to make sure HAL can accept and post wqe to SLI.
static ocs_hal_rtn_e ocs_hal_sequence_free(ocs_hal_t *hal, ocs_hal_sequence_t *seq)
ocs_hal_dif_oper_e dif_oper
uint32_t sec_hio_wait_count
ocs_hal_io_t * ocs_hal_io_alloc(ocs_hal_t *hal)
Allocate a HAL IO object.
struct ocs_hal_tow_buffer_s * tow_buf
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.
ocs_hal_rtn_e ocs_hal_domain_alloc(ocs_hal_t *hal, ocs_domain_t *domain, uint32_t fcf, uint32_t vlan)
Allocate a fabric domain object.
uint32_t uint32_t saved_status
sli4_queue_t * cq[OCS_HAL_MAX_NUM_CQ]
ocs_hal_rtn_e ocs_hal_node_detach(ocs_hal_t *hal, ocs_remote_node_t *rnode)
Free a remote node object.
ocs_hal_rtn_e ocs_hal_reset(ocs_hal_t *hal, ocs_hal_reset_e reset)
ocs_hal_rtn_e ocs_hal_io_register_sgl(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_dma_t *sgl, uint32_t sgl_count)
ocs_remote_node_t * rnode
ocs_hal_io_t * send_frame_io
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.
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.
void(* ocs_set_nvparms_cb_t)(int32_t status, void *arg)
ocs_hal_rpi_ref_t * rpi_ref
uint32_t ocs_hal_rpi_active_count(ocs_hal_t *hal)
Called to obtain active RPI count.
uint32_t tcmd_wq_submit[OCS_HAL_MAX_NUM_WQ]
void(* ocs_hal_host_stat_cb_t)(int32_t status, uint32_t num_counters, ocs_hal_host_stat_counts_t *counters, void *arg)
hal_mq_t * hal_mq[OCS_HAL_MAX_NUM_MQ]
void(* ocs_hal_dump_clear_cb_t)(int32_t status, void *arg)
ocs_hal_sequence_t ** rq_tracker
void _ocs_hal_verify(const char *cond, const char *filename, int linenum)
Handle HAL verify.
ocs_array_t * iopt_cmd_array
sli4_queue_t * rq[OCS_HAL_MAX_NUM_RQ]
uint32_t in_active_wqe_timer
ocs_hal_linkcfg_e
Link configurations.
int32_t ocs_hal_set_nvparms(ocs_hal_t *hal, ocs_set_nvparms_cb_t cb, uint8_t *wwpn, uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id, void *ul_arg)
Write non-volatile parms.
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.
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.
ocs_hal_rtn_e ocs_hal_get(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t *value)
ocs_hal_rtn_e ocs_hal_port_free(ocs_hal_t *hal, ocs_sli_port_t *sport)
Free port resources.
hal_mq_t * hal_new_mq(hal_cq_t *cq, uint32_t entry_count)
Allocate a new MQ object.
int32_t hal_route_rqe(ocs_hal_t *hal, ocs_hal_sequence_t *seq)
ocs_pool_t * wq_reqtag_pool
ocs_quarantine_info_t quarantine_info
ocs_hal_rtn_e ocs_hal_node_attach(ocs_hal_t *hal, ocs_remote_node_t *rnode, ocs_dma_t *sparms)
Update a remote node object with the remote port's service parameters.
struct hal_rq_grp_s hal_rq_grp_t
ocs_hal_rtn_e ocs_hal_set_ptr(ocs_hal_t *hal, ocs_hal_property_e prop, void *value)
uint16_t fcf_index_fcfi[SLI4_MAX_FCF_INDEX]
ocs_hal_done_t abort_done
uint32_t suppress_rsp_capable
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.
int ocs_hal_stop_fw_diagnostic_logging(ocs_hal_t *hal)
Stop firmware diagnostic logging (RAS).
int32_t(* rnode)(void *, ocs_hal_remote_node_event_e, void *)
Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue...
uint32_t quarantine_first_phase
ocs_hal_rtn_e ocs_hal_raise_ue(ocs_hal_t *hal, uint8_t dump)
Cause chip to enter an unrecoverable error state.
ocs_hal_rtn_e ocs_hal_port_alloc(ocs_hal_t *hal, ocs_sli_port_t *sport, ocs_domain_t *domain, uint8_t *wwpn)
Allocate a port object.
ocs_queue_hash_t * rq_hash
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_hal_event_check(ocs_hal_t *hal, uint32_t vector)
Check for the events associated with the interrupt vector.
int32_t ocs_hal_get_nvparms(ocs_hal_t *hal, ocs_get_nvparms_cb_t cb, void *ul_arg)
Read non-volatile parms.
sli4_queue_t * eq[OCS_HAL_MAX_NUM_EQ]
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.
void(* ocs_get_port_protocol_cb_t)(int32_t status, ocs_hal_port_protocol_e port_protocol, void *arg)
ocs_hal_rtn_e ocs_hal_set_port_protocol(ocs_hal_t *hal, ocs_hal_port_protocol_e new_protocol, uint32_t pci_func, ocs_set_port_protocol_cb_t cb, void *ul_arg)
Set the port protocol.
ocs_domain_t * ocs_hal_domain_get(ocs_hal_t *hal, uint16_t fcfi)
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.
void hal_queue_dump(ocs_hal_t *hal)
Display HAL queue objects.
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)
uint32_t rq_default_buffer_size
ocs_hal_dif_blk_size_e
T10 DIF block sizes.
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.
ocs_list_link_t dnrx_link
void ocs_hal_rx_free(ocs_hal_t *hal)
Free the RQ data buffers.
sli4_queue_t * wq[OCS_HAL_MAX_NUM_WQ]
ocs_hal_rtn_e ocs_hal_node_free_resources(ocs_hal_t *hal, ocs_remote_node_t *rnode)
Free a remote node resource.
ocs_queue_hash_t * cq_hash
const char * queue_topology_string
ocs_hal_linkcfg_e linkcfg
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.
ocs_hal_rtn_e ocs_hal_set(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t value)
ocs_hal_unsol_status_e status
ocs_hal_rtn_e ocs_hal_rx_allocate(ocs_hal_t *hal)
Allocate the RQ data buffers.
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)
Send a read, write, or response IO.
#define OCS_HAL_MAX_NUM_CQ
uint16_t watchdog_timeout
ocs_hal_rtn_e ocs_hal_node_group_free(ocs_hal_t *hal, ocs_remote_node_group_t *ngroup)
void ocs_hal_unsol_process_bounce(void *arg)
ocs_hal_dif_oper_e dif_oper
ocs_hal_workaround_t workaround
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.
void(* ocs_hal_port_control_cb_t)(int32_t status, uintptr_t value, void *arg)
int32_t ocs_hal_get_active_profile(ocs_hal_t *hal, ocs_get_active_profile_cb_t cb, void *ul_arg)
Get the currently active profile.
struct ocs_hal_s::@22 config
ocs_hal_io_t * ocs_hal_io_activate_port_owned(ocs_hal_t *hal, ocs_hal_io_t *io)
Allocate/Activate a port owned HAL IO object.
int32_t ocs_hal_set_active_profile(ocs_hal_t *hal, ocs_set_active_profile_cb_t cb, uint32_t profile_id, void *ul_arg)
Set the currently active profile.
uint32_t quarantine_index
ocs_cbuf_t * iopt_work_queue
ocs_hal_rtn_e ocs_hal_domain_free(ocs_hal_t *hal, ocs_domain_t *domain)
Free a fabric domain object.
ocs_hal_rtn_e ocs_hal_rx_post(ocs_hal_t *hal)
Post the RQ data buffers to the chip.
int32_t(* xport)(void *, ocs_hal_xport_event_e)
hal_rq_t * hal_rq[OCS_HAL_MAX_NUM_RQ]
ocs_hal_rtn_e ocs_hal_get_trunk_info(ocs_hal_t *hal, uint32_t *trunk_info)
Get trunking mode information.
int32_t ocs_hal_process(ocs_hal_t *hal, uint32_t vector, uint32_t max_isr_time_msec)
ocs_hal_rtn_e ocs_hal_reqtag_init(ocs_hal_t *hal)
Initialize the reqtag pool.
Defines a general FC sequence object, consisting of a header, payload buffers and a HAL IO in the cas...
void(* tcmd_cq_handler)(ocs_hal_t *hal, uint32_t cq_idx, void *cq_handler_arg)
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.
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.
ocs_hal_domain_event_e
Fabric/Domain events.
uint8_t sliport_healthcheck
ocs_hal_rtn_e ocs_hal_node_group_alloc(ocs_hal_t *hal, ocs_remote_node_group_t *ngroup)
uint32_t total_submit_count
uint16_t tow_app_tag_value
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)
hal_eq_t * hal_new_eq(ocs_hal_t *hal, uint32_t entry_count)
Allocate a new EQ object.
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.
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.
void(* ocs_hal_sfp_cb_t)(void *, int32_t, uint32_t, uint32_t *, void *)
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.
void hal_del_eq(hal_eq_t *eq)
Free an EQ object.
void hal_del_mq(hal_mq_t *mq)
Free a MQ object.
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.
uint8_t rq_selection_policy
uint32_t rq_empty_err_count
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.
ocs_hal_remote_node_event_e
List Segment Pointer Scatter-Gather Entry (SGE)
#define SLI4_MAX_FCFI
Maximum value for a FCFI.
#define OCS_HAL_QUARANTINE_QUEUE_DEPTH
Define the fields required to implement the skyhawk DIF quarantine.
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.
ocs_hal_dif_oper_e
T10 DIF operations.
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.
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.
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).
ocs_hal_rtn_e ocs_hal_command(ocs_hal_t *hal, uint8_t *cmd, uint32_t opts, void *cb, void *arg)
Issue a SLI command.
ocs_hal_rtn_e ocs_hal_clear_dump_location(ocs_hal_t *hal)
Clear the Lancer dump location.
void(* ocs_hal_link_stat_cb_t)(int32_t status, uint32_t num_counters, ocs_hal_link_stat_counts_t *counters, void *arg)
void * ocs_hal_get_ptr(ocs_hal_t *hal, ocs_hal_property_e prop)
int32_t(* ocs_hal_async_cb_t)(ocs_hal_t *hal, int32_t status, uint8_t *mqe, void *arg)
#define SLI4_MAX_FCF_INDEX
Maximum value for FCF index.
#define OCS_HAL_MAX_WQ_CPU
int32_t ocs_hal_io_cancel(ocs_hal_t *hal)
void ocs_hal_rqpair_teardown(ocs_hal_t *hal)
Tear down the rq_pair function from ocs_hal_teardown().
uint32_t first_burst_entry_size
ocs_hal_dif_blk_size_e blk_size
ocs_cbuf_t * iopt_free_queue
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)
uint32_t abort_in_progress
uint32_t rq_empty_warn_count
ocs_hal_unsol_status_e
HAL unsolicited callback status.
ocs_hal_wq_steering_e
WQ steering mode.
uint32_t num_qentries[SLI_QTYPE_MAX]
uint16_t hal_rq_lookup[OCS_HAL_MAX_NUM_RQ]
struct ocs_hal_s::@24 args
uint32_t cq_process_limit
void(* ocs_set_port_protocol_cb_t)(int32_t status, void *arg)
ocs_hal_sequence_t * cmd_seq
unsigned long jiffies_prev
hal_cq_t * hal_cq[OCS_HAL_MAX_NUM_CQ]
ocs_hal_rtn_e ocs_hal_set_trunk_mode(ocs_hal_t *hal, uint32_t trunk_mode)
Set trunking mode.
ocs_hal_rq_buffer_t * payload
sli4_queue_t * mq[OCS_HAL_MAX_NUM_MQ]
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.
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.
void(* ocs_hal_dump_get_cb_t)(int32_t status, uint32_t bytes_read, uint8_t eof, void *arg)
Stucture used for the hash lookup of queue IDs.
ocs_hal_dif_blk_size_e blk_size
uint32_t active_wqe_timer_shutdown
#define OCS_HAL_MAX_PROFILES
sli4_queue_t * first_burst