Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sli4.c File Reference
#include "sli4.h"
#include "sli4_fc.h"
#include "ocs.h"

Go to the source code of this file.

Detailed Description

All common (i.e. transport-independent) SLI-4 functions are implemented in this file.

Definition in file sli4.c.

Data Structures

struct  sli4_asic_entry_t
 

Macros

#define SLI4_BMBX_DELAY_US   1000 /* 1 ms */
 
#define SLI4_INIT_PORT_DELAY_US   10000 /* 10 ms */
 

Functions

static int32_t sli_fw_init (sli4_t *sli4)
 Initialize the firmware. More...
 
static int32_t sli_fw_term (sli4_t *sli4)
 Terminate the firmware. More...
 
static int32_t sli_sliport_control (sli4_t *sli4, uint32_t endian)
 Initialize SLI Port control register. More...
 
static int32_t sli_cmd_fw_deinitialize (sli4_t *sli4, void *buf, size_t size)
 Write a FW_DEINITIALIZE command to the provided buffer. More...
 
static int32_t sli_cmd_fw_initialize (sli4_t *sli4, void *buf, size_t size)
 Write a FW_INITIALIZE command to the provided buffer. More...
 
static int32_t sli_queue_doorbell (sli4_t *sli4, sli4_queue_t *q)
 Write the doorbell register associated with the queue object. More...
 
static uint8_t sli_queue_entry_is_valid (sli4_queue_t *q, uint8_t *qe, uint8_t clear)
 Check if the current queue entry is valid. More...
 
uint32_t sli_reg_read (sli4_t *sli, sli4_regname_e reg)
 Read the given SLI register. More...
 
void sli_reg_write (sli4_t *sli, sli4_regname_e reg, uint32_t val)
 Write the value to the given SLI register. More...
 
static uint8_t sli_intf_valid_check (uint32_t val)
 Check if the SLI_INTF register is valid. More...
 
static uint8_t sli_intf_sli_revision (uint32_t val)
 Retrieve the SLI revision level. More...
 
static uint8_t sli_intf_sli_family (uint32_t val)
 
static uint8_t sli_intf_if_type (uint32_t val)
 Retrieve the SLI interface type. More...
 
static uint8_t sli_pci_rev_id (uint32_t val)
 Retrieve PCI revision ID. More...
 
static uint8_t sli_asic_gen (uint32_t val)
 retrieve SLI ASIC generation More...
 
static int32_t sli_bmbx_wait (sli4_t *sli4, uint32_t msec)
 Wait for the bootstrap mailbox to report "ready". More...
 
static int32_t sli_bmbx_write (sli4_t *sli4)
 Write bootstrap mailbox. More...
 
int32_t sli_bmbx_command (sli4_t *sli4)
 Submit a command to the bootstrap mailbox and check the status. More...
 
int32_t sli_cmd_config_link (sli4_t *sli4, void *buf, size_t size)
 Write a CONFIG_LINK command to the provided buffer. More...
 
int32_t sli_cmd_down_link (sli4_t *sli4, void *buf, size_t size)
 Write a DOWN_LINK command to the provided buffer. More...
 
int32_t sli_cmd_dump_type4 (sli4_t *sli4, void *buf, size_t size, uint16_t wki)
 Write a DUMP Type 4 command to the provided buffer. More...
 
int32_t sli_cmd_common_read_transceiver_data (sli4_t *sli4, void *buf, size_t size, uint32_t page_num, ocs_dma_t *dma)
 Write a COMMON_READ_TRANSCEIVER_DATA command. More...
 
int32_t sli_cmd_read_link_stats (sli4_t *sli4, void *buf, size_t size, uint8_t req_ext_counters, uint8_t clear_overflow_flags, uint8_t clear_all_counters)
 Write a READ_LINK_STAT command to the provided buffer. More...
 
int32_t sli_cmd_read_status (sli4_t *sli4, void *buf, size_t size, uint8_t clear_counters)
 Write a READ_STATUS command to the provided buffer. More...
 
int32_t sli_cmd_init_link (sli4_t *sli4, void *buf, size_t size, uint32_t speed, uint8_t reset_alpa)
 Write an INIT_LINK command to the provided buffer. More...
 
int32_t sli_cmd_init_vfi (sli4_t *sli4, void *buf, size_t size, uint16_t vfi, uint16_t fcfi, uint16_t vpi)
 Write an INIT_VFI command to the provided buffer. More...
 
int32_t sli_cmd_init_vpi (sli4_t *sli4, void *buf, size_t size, uint16_t vpi, uint16_t vfi)
 Write an INIT_VPI command to the provided buffer. More...
 
int32_t sli_cmd_post_xri (sli4_t *sli4, void *buf, size_t size, uint16_t xri_base, uint16_t xri_count)
 Write a POST_XRI command to the provided buffer. More...
 
int32_t sli_cmd_release_xri (sli4_t *sli4, void *buf, size_t size, uint8_t num_xri)
 Write a RELEASE_XRI command to the provided buffer. More...
 
int32_t sli_cmd_read_config (sli4_t *sli4, void *buf, size_t size)
 Write a READ_CONFIG command to the provided buffer. More...
 
int32_t sli_cmd_read_nvparms (sli4_t *sli4, void *buf, size_t size)
 Write a READ_NVPARMS command to the provided buffer. More...
 
int32_t sli_cmd_write_nvparms (sli4_t *sli4, void *buf, size_t size, uint8_t *wwpn, uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id)
 Write a WRITE_NVPARMS command to the provided buffer. More...
 
static int32_t sli_cmd_read_rev (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *vpd)
 Write a READ_REV command to the provided buffer. More...
 
int32_t sli_cmd_read_sparm64 (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint16_t vpi)
 Write a READ_SPARM64 command to the provided buffer. More...
 
int32_t sli_cmd_read_topology (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
 Write a READ_TOPOLOGY command to the provided buffer. More...
 
int32_t sli_cmd_reg_fcfi (sli4_t *sli4, void *buf, size_t size, uint16_t index, sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG], uint16_t vlan_id)
 Write a REG_FCFI command to the provided buffer. More...
 
int32_t sli_cmd_reg_fcfi_mrq (sli4_t *sli4, void *buf, size_t size, uint8_t mode, uint16_t fcf_index, uint16_t vlan_id, sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG])
 Write REG_FCFI_MRQ to provided command buffer. More...
 
int32_t sli_cmd_reg_rpi (sli4_t *sli4, void *buf, size_t size, uint32_t nport_id, uint16_t rpi, uint16_t vpi, ocs_dma_t *dma, uint8_t update, uint8_t enable_t10_pi, uint8_t hlm)
 Write a REG_RPI command to the provided buffer. More...
 
int32_t sli_cmd_reg_vfi (sli4_t *sli4, void *buf, size_t size, ocs_domain_t *domain)
 Write a REG_VFI command to the provided buffer. More...
 
int32_t sli_cmd_reg_vpi (sli4_t *sli4, void *buf, size_t size, ocs_sli_port_t *sport, uint8_t update)
 Write a REG_VPI command to the provided buffer. More...
 
static int32_t sli_cmd_request_features (sli4_t *sli4, void *buf, size_t size, sli4_features_t mask, uint8_t query)
 Write a REQUEST_FEATURES command to the provided buffer. More...
 
int32_t sli_cmd_sli_config (sli4_t *sli4, void *buf, size_t size, uint32_t length, ocs_dma_t *dma)
 Write a SLI_CONFIG command to the provided buffer. More...
 
int32_t sli_cmd_unreg_fcfi (sli4_t *sli4, void *buf, size_t size, uint16_t indicator)
 Write a UNREG_FCFI command to the provided buffer. More...
 
int32_t sli_cmd_unreg_rpi (sli4_t *sli4, void *buf, size_t size, uint16_t indicator, sli4_resource_e which, uint32_t fc_id)
 Write an UNREG_RPI command to the provided buffer. More...
 
int32_t sli_cmd_unreg_vfi (sli4_t *sli4, void *buf, size_t size, ocs_domain_t *domain, uint32_t which)
 Write an UNREG_VFI command to the provided buffer. More...
 
int32_t sli_cmd_unreg_vpi (sli4_t *sli4, void *buf, size_t size, uint16_t indicator, uint32_t which)
 Write an UNREG_VPI command to the provided buffer. More...
 
int32_t sli_cmd_config_auto_xfer_rdy (sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len)
 Write an CONFIG_AUTO_XFER_RDY command to the provided buffer. Command to enable AXR in G5. More...
 
int32_t sli_cmd_config_auto_xfer_rdy_hp (sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len, uint32_t block_size)
 Write an CONFIG_AUTO_XFER_RDY_HP command to the provided buffer. More...
 
int32_t sli_cmd_config_optimized_write (sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len, uint32_t xri_cnt, uint32_t tow_feature)
 Write an CONFIG_OPTIMIZED_WRITE command to the provided buffer. More...
 
int32_t sli_cmd_config_optimized_write_hp (sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len, uint32_t xri_cnt, uint32_t block_size, uint32_t tow_feature)
 Write an CONFIG_OPTIMIZED_WRITE_HP command to the provided buffer. More...
 
static int32_t sli_cmd_common_function_reset (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_FUNCTION_RESET command. More...
 
static int32_t sli_cmd_common_create_cq (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t eq_id, uint16_t ignored)
 Write a COMMON_CREATE_CQ command. More...
 
static int32_t sli_cmd_common_destroy_cq (sli4_t *sli4, void *buf, size_t size, uint16_t cq_id)
 Write a COMMON_DESTROY_CQ command. More...
 
static int32_t sli_cmd_common_modify_eq_delay (sli4_t *sli4, void *buf, size_t size, sli4_queue_t *q, int num_q, uint32_t shift, uint32_t delay_mult)
 Write a COMMON_MODIFY_EQ_DELAY command. More...
 
static int32_t sli_cmd_common_create_eq (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t ignored1, uint16_t ignored2)
 Write a COMMON_CREATE_EQ command. More...
 
static int32_t sli_cmd_common_destroy_eq (sli4_t *sli4, void *buf, size_t size, uint16_t eq_id)
 Write a COMMON_DESTROY_EQ command. More...
 
void sli4_cmd_lowlevel_set_watchdog (sli4_t *sli4, void *buf, size_t size, uint16_t timeout)
 Write a LOWLEVEL_SET_WATCHDOG command. More...
 
void sli4_cmd_lowlevel_enable_ras (sli4_t *sli4, void *buf, size_t size, int log_level, uint32_t unit_size, int32_t buf_count, uint32_t *phys_addr, uintptr_t lwpd_phys_addr)
 Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command. More...
 
void sli4_cmd_lowlevel_disable_ras (sli4_t *sli4, void *buf, size_t size)
 Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command. More...
 
void sli4_cmd_lowlevel_get_itcm_parity_stats (sli4_t *sli4, void *buf, size_t size, bool clear_stats)
 
static int32_t sli_cmd_common_get_cntl_attributes (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
 
static int32_t sli_cmd_common_get_cntl_addl_attributes (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
 Write a COMMON_GET_CNTL_ADDL_ATTRIBUTES command. More...
 
static int32_t sli_cmd_common_create_mq_ext (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ignored)
 Write a COMMON_CREATE_MQ_EXT command. More...
 
static int32_t sli_cmd_common_destroy_mq (sli4_t *sli4, void *buf, size_t size, uint16_t mq_id)
 Write a COMMON_DESTROY_MQ command. More...
 
int32_t sli_cmd_common_nop (sli4_t *sli4, void *buf, size_t size, uint64_t context)
 Write a COMMON_NOP command. More...
 
int32_t sli_cmd_common_get_resource_extent_info (sli4_t *sli4, void *buf, size_t size, uint16_t rtype)
 Write a COMMON_GET_RESOURCE_EXTENT_INFO command. More...
 
int32_t sli_cmd_common_get_sli4_parameters (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_GET_SLI4_PARAMETERS command. More...
 
static int32_t sli_cmd_common_query_fw_config (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_QUERY_FW_CONFIG command to the provided buffer. More...
 
static int32_t sli_cmd_common_get_port_name (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_GET_PORT_NAME command to the provided buffer. More...
 
int32_t sli_cmd_common_write_object (sli4_t *sli4, void *buf, size_t size, uint16_t noc, uint16_t eof, uint32_t desired_write_length, uint32_t offset, char *object_name, ocs_dma_t *dma)
 Write a COMMON_WRITE_OBJECT command. More...
 
int32_t sli_cmd_common_delete_object (sli4_t *sli4, void *buf, size_t size, char *object_name)
 Write a COMMON_DELETE_OBJECT command. More...
 
int32_t sli_cmd_common_read_object (sli4_t *sli4, void *buf, size_t size, uint32_t desired_read_length, uint32_t offset, char *object_name, ocs_dma_t *dma)
 Write a COMMON_READ_OBJECT command. More...
 
int32_t sli_cmd_dmtf_exec_clp_cmd (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *cmd, ocs_dma_t *resp)
 Write a DMTF_EXEC_CLP_CMD command. More...
 
int32_t sli_cmd_common_set_dump_location (sli4_t *sli4, void *buf, size_t size, uint8_t query, uint8_t is_buffer_list, ocs_dma_t *buffer, uint8_t fdb)
 Write a COMMON_SET_DUMP_LOCATION command. More...
 
int32_t sli_cmd_config_run_biu_diag (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *tx_buffer, size_t tx_buf_len, ocs_dma_t *rx_buffer, size_t rx_buf_len)
 Write a RUN_BIU_DIAG command. More...
 
int32_t sli_cmd_fcoe_set_loopback_mode (sli4_t *sli4, void *buf, size_t size, int type)
 Write a SLI4_OPC_FCOE_SET_LINK_DIAG_LOOPBACK command. More...
 
int32_t sli_cmd_fc_set_trunk_mode (sli4_t *sli4, void *buf, size_t size, uint32_t trunk_mode)
 Write a SLI4_OPC_FC_SET_TRUNK_MODE command. More...
 
int32_t sli_cmd_common_set_features (sli4_t *sli4, void *buf, size_t size, uint32_t feature, uint32_t param_len, void *parameter)
 Write a COMMON_SET_FEATURES command. More...
 
int32_t sli_cmd_common_get_profile_config (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
 Write a COMMON_COMMON_GET_PROFILE_CONFIG command. More...
 
int32_t sli_cmd_common_set_profile_config (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint8_t profile_id, uint32_t descriptor_count, uint8_t isap)
 Write a COMMON_COMMON_SET_PROFILE_CONFIG command. More...
 
int32_t sli_cmd_common_get_profile_list (sli4_t *sli4, void *buf, size_t size, uint32_t start_profile_index, ocs_dma_t *dma)
 Write a COMMON_COMMON_GET_PROFILE_LIST command. More...
 
int32_t sli_cmd_common_get_active_profile (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_COMMON_GET_ACTIVE_PROFILE command. More...
 
int32_t sli_cmd_common_set_active_profile (sli4_t *sli4, void *buf, size_t size, uint32_t fd, uint32_t active_profile_id)
 Write a COMMON_COMMON_SET_ACTIVE_PROFILE command. More...
 
int32_t sli_cmd_common_get_reconfig_link_info (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
 Write a COMMON_GET_RECONFIG_LINK_INFO command. More...
 
int32_t sli_cmd_common_set_reconfig_link_id (sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint32_t fd, uint32_t active_link_config_id)
 Write a COMMON_SET_RECONFIG_LINK_ID command. More...
 
int32_t sli_cqe_mq (void *buf)
 Check the mailbox/queue completion entry. More...
 
int32_t sli_cqe_async (sli4_t *sli4, void *buf)
 Check the asynchronous event completion entry. More...
 
static int32_t sli_res_sli_config (void *buf)
 Check the SLI_CONFIG response. More...
 
static int32_t sli_common_function_reset (sli4_t *sli4)
 Issue a COMMON_FUNCTION_RESET command. More...
 
static int32_t sli_wait_for_fw_ready (sli4_t *sli4, uint32_t timeout_ms)
 check to see if the FW is ready. More...
 
static int32_t sli_request_features (sli4_t *sli4, sli4_features_t *features, uint8_t query)
 
void sli_calc_max_qentries (sli4_t *sli4)
 Calculate max queue entries. More...
 
static int32_t sli_query_fw_config (sli4_t *sli4)
 Issue a FW_CONFIG mailbox command and store the results. More...
 
static int32_t sli_get_config (sli4_t *sli4)
 
int32_t sli_setup (sli4_t *sli4, ocs_os_handle_t os, sli4_port_type_e port_type)
 Set up the SLI context. More...
 
int32_t sli_init (sli4_t *sli4)
 
int32_t sli_reset (sli4_t *sli4)
 
int32_t sli_fw_reset (sli4_t *sli4)
 Issue a Firmware Reset. More...
 
int32_t sli_port_migration (sli4_t *sli4)
 
int32_t sli_teardown (sli4_t *sli4)
 Tear down a SLI context. More...
 
int32_t sli_callback (sli4_t *sli4, sli4_callback_e which, void *func, void *arg)
 Register a callback for the given event. More...
 
int32_t __sli_queue_init (sli4_t *sli4, sli4_queue_t *q, uint32_t qtype, size_t size, uint32_t n_entries, uint32_t align)
 Initialize a queue object. More...
 
int32_t __sli_create_queue (sli4_t *sli4, sli4_queue_t *q)
 Issue the command to create a queue. More...
 
int32_t sli_get_queue_entry_size (sli4_t *sli4, uint32_t qtype)
 Get queue entry size. More...
 
int32_t sli_eq_modify_delay (sli4_t *sli4, sli4_queue_t *eq, uint32_t num_eq, uint32_t shift, uint32_t delay_mult)
 Modify the delay timer for all the EQs. More...
 
int32_t sli_queue_alloc (sli4_t *sli4, uint32_t qtype, sli4_queue_t *q, uint32_t n_entries, sli4_queue_t *assoc, uint16_t ulp)
 Allocate a queue. More...
 
int32_t sli_cq_alloc_set (sli4_t *sli4, sli4_queue_t *qs[], uint32_t num_cqs, uint32_t n_entries, sli4_queue_t *eqs[])
 Allocate a c queue set. More...
 
int32_t sli_queue_free (sli4_t *sli4, sli4_queue_t *q, uint32_t destroy_queues, uint32_t free_memory)
 Free a queue. More...
 
int32_t sli_queue_reset (sli4_t *sli4, sli4_queue_t *q)
 
int32_t sli_queue_is_empty (sli4_t *sli4, sli4_queue_t *q)
 Check if the given queue is empty. More...
 
int32_t sli_queue_eq_arm (sli4_t *sli4, sli4_queue_t *q, uint8_t arm)
 Arm an EQ. More...
 
int32_t sli_queue_arm (sli4_t *sli4, sli4_queue_t *q, uint8_t arm)
 Arm a queue. More...
 
int32_t _sli_queue_write (sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
 Write an entry to the queue object. More...
 
int32_t sli_queue_write (sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
 Write an entry to the queue object. More...
 
int32_t sli_queue_read (sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
 Read an entry from the queue object. More...
 
int32_t sli_queue_index (sli4_t *sli4, sli4_queue_t *q)
 
int32_t sli_queue_poke (sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
 
int32_t _sli_queue_poke (sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
 
int32_t sli_resource_alloc (sli4_t *sli4, sli4_resource_e rtype, uint32_t *rid, uint32_t *index)
 Allocate SLI Port resources. More...
 
int32_t sli_resource_free (sli4_t *sli4, sli4_resource_e rtype, uint32_t rid)
 Free the SLI Port resources. More...
 
int32_t sli_resource_reset (sli4_t *sli4, sli4_resource_e rtype)
 
int32_t sli_eq_parse (sli4_t *sli4, uint8_t *buf, uint16_t *cq_id)
 Parse an EQ entry to retrieve the CQ_ID for this event. More...
 
int32_t sli_cq_parse (sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_e *etype, uint16_t *q_id)
 Parse a CQ entry to retrieve the event type and the associated queue. More...
 
int32_t sli_raise_ue (sli4_t *sli4, uint8_t dump)
 Cause chip to enter an unrecoverable error state. More...
 
int32_t sli_dump_is_ready (sli4_t *sli4)
 Read the SLIPORT_STATUS register to to check if a dump is present. More...
 
int32_t sli_dump_is_present (sli4_t *sli4)
 Read the SLIPORT_STATUS register to check if a dump is present. More...
 
int32_t sli_reset_required (sli4_t *sli4)
 Read the SLIPORT_STATUS register to check if the reset required is set. More...
 
int32_t sli_fw_error_status (sli4_t *sli4)
 Read the SLIPORT_SEMAPHORE and SLIPORT_STATUS registers to check if the port status indicates that a FW error has occurred. More...
 
int32_t sli_fw_ready (sli4_t *sli4)
 Determine if the chip FW is in a ready state. More...
 
int32_t sli_link_is_configurable (sli4_t *sli)
 Determine if the link can be configured. More...
 
int32_t sli_is_paused (sli4_t *sli4)
 
void sli_validate_pause_errors (sli4_t *sli4, uint32_t *skip_dump)
 

Variables

const uint8_t sli4_fw_initialize []
 FW_INITIALIZE - initialize a SLI port. More...
 
const uint8_t sli4_fw_deinitialize []
 FW_DEINITIALIZE - deinitialize a SLI port. More...
 
sli4_asic_entry_t sli4_asic_table []
 
const char * SLI_QNAME []
 
const sli4_reg_t regmap [SLI4_REG_MAX][SLI4_MAX_IF_TYPES]
 Define the mapping of registers to their BAR and offset. More...
 

Macro Details

#define SLI4_BMBX_DELAY_US   1000 /* 1 ms */

Definition at line 52 of file sli4.c.

#define SLI4_INIT_PORT_DELAY_US   10000 /* 10 ms */

Definition at line 53 of file sli4.c.

Function Details

int32_t _sli_queue_poke ( sli4_t *  sli4,
sli4_queue_t *  q,
uint32_t  index,
uint8_t *  entry 
)

Definition at line 5813 of file sli4.c.

void sli4_cmd_lowlevel_disable_ras ( sli4_t *  sli4,
void *  buf,
size_t  size 
)

Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
timeoutwatchdog timer timeout in seconds
Returns
void

Definition at line 2389 of file sli4.c.

void sli4_cmd_lowlevel_enable_ras ( sli4_t *  sli4,
void *  buf,
size_t  size,
int  log_level,
uint32_t  unit_size,
int32_t  buf_count,
uint32_t *  phys_addr,
uintptr_t  lwpd_phys_addr 
)

Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
timeoutwatchdog timer timeout in seconds
Returns
void

Definition at line 2339 of file sli4.c.

void sli4_cmd_lowlevel_get_itcm_parity_stats ( sli4_t *  sli4,
void *  buf,
size_t  size,
bool  clear_stats 
)

Definition at line 2412 of file sli4.c.

void sli4_cmd_lowlevel_set_watchdog ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint16_t  timeout 
)

Write a LOWLEVEL_SET_WATCHDOG command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
timeoutwatchdog timer timeout in seconds
Returns
void

Definition at line 2304 of file sli4.c.

static uint8_t sli_asic_gen ( uint32_t  val)
static

retrieve SLI ASIC generation

Parameters
val32-bit SLI_ASIC_ID register value
Returns
SLI ASIC generation

Definition at line 342 of file sli4.c.

static int32_t sli_bmbx_wait ( sli4_t *  sli4,
uint32_t  msec 
)
static

Wait for the bootstrap mailbox to report "ready".

Parameters
sli4SLI context pointer.
msecNumber of milliseconds to wait.
Returns
Returns 0 if BMBX is ready, or non-zero otherwise (i.e. time out occurred).

Definition at line 356 of file sli4.c.

static int32_t sli_bmbx_write ( sli4_t *  sli4)
static

Write bootstrap mailbox.

Parameters
sli4SLI context pointer.
Returns
Returns 0 if command succeeded, or non-zero otherwise.

Definition at line 377 of file sli4.c.

void sli_calc_max_qentries ( sli4_t *  sli4)

Calculate max queue entries.

Parameters
sli4SLI context.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3959 of file sli4.c.

static int32_t sli_cmd_common_create_cq ( sli4_t *  sli4,
void *  buf,
size_t  size,
ocs_dma_t *  qmem,
uint16_t  eq_id,
uint16_t  ignored 
)
static

Write a COMMON_CREATE_CQ command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
qmemDMA memory for the queue.
eq_idAssociated EQ_ID
ignoredThis parameter carries the ULP which is only used for WQ and RQs
Note
This creates a Version 0 message.
Returns
Returns the number of bytes written.

Definition at line 1924 of file sli4.c.

static int32_t sli_cmd_common_create_eq ( sli4_t *  sli4,
void *  buf,
size_t  size,
ocs_dma_t *  qmem,
uint16_t  ignored1,
uint16_t  ignored2 
)
static

Write a COMMON_CREATE_EQ command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
qmemDMA memory for the queue.
ignored1Ignored (used for consistency among queue creation functions).
ignored2Ignored (used for consistency among queue creation functions).
Note
Other queue creation routines use the last parameter to pass in the associated Q_ID and ULP. EQ doesn't have an associated queue or ULP, so these parameters are ignored
This creates a Version 0 message
Returns
Returns the number of bytes written.

Definition at line 2187 of file sli4.c.

static int32_t sli_cmd_common_create_mq_ext ( sli4_t *  sli4,
void *  buf,
size_t  size,
ocs_dma_t *  qmem,
uint16_t  cq_id,
uint16_t  ignored 
)
static

Write a COMMON_CREATE_MQ_EXT command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
qmemDMA memory for the queue.
cq_idAssociated CQ_ID.
ignoredThis parameter carries the ULP which is only used for WQ and RQs
Note
This creates a Version 0 message.
Returns
Returns the number of bytes written.

Definition at line 2513 of file sli4.c.

static int32_t sli_cmd_common_destroy_cq ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint16_t  cq_id 
)
static

Write a COMMON_DESTROY_CQ command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
cq_idCQ ID
Note
This creates a Version 0 message.
Returns
Returns the number of bytes written.

Definition at line 2099 of file sli4.c.

static int32_t sli_cmd_common_destroy_eq ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint16_t  eq_id 
)
static

Write a COMMON_DESTROY_EQ command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
eq_idQueue ID to destroy.
Note
Other queue creation routines use the last parameter to pass in the associated Q_ID. EQ doesn't have an associated queue so this parameter is ignored.
This creates a Version 0 message.
Returns
Returns the number of bytes written.

Definition at line 2269 of file sli4.c.

static int32_t sli_cmd_common_destroy_mq ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint16_t  mq_id 
)
static

Write a COMMON_DESTROY_MQ command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
mq_idMQ ID
Note
This creates a Version 0 message.
Returns
Returns the number of bytes written.

Definition at line 2592 of file sli4.c.

static int32_t sli_cmd_common_function_reset ( sli4_t *  sli4,
void *  buf,
size_t  size 
)
static

Write a COMMON_FUNCTION_RESET command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
Returns
Returns the number of bytes written.

Definition at line 1886 of file sli4.c.

static int32_t sli_cmd_common_get_cntl_addl_attributes ( sli4_t *  sli4,
void *  buf,
size_t  size,
ocs_dma_t *  dma 
)
static

Write a COMMON_GET_CNTL_ADDL_ATTRIBUTES command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
dmaDMA structure from which the data will be copied.
Note
This creates a Version 0 message.
Returns
Returns the number of bytes written.

Definition at line 2474 of file sli4.c.

static int32_t sli_cmd_common_get_cntl_attributes ( sli4_t *  sli4,
void *  buf,
size_t  size,
ocs_dma_t *  dma 
)
static

Definition at line 2435 of file sli4.c.

static int32_t sli_cmd_common_get_port_name ( sli4_t *  sli4,
void *  buf,
size_t  size 
)
static

Write a COMMON_GET_PORT_NAME command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to destination buffer.
sizeBuffer size in bytes.
Note
Function supports both version 0 and 1 forms of this command via the IF_TYPE.
Returns
Returns the number of bytes written.

Definition at line 2762 of file sli4.c.

static int32_t sli_cmd_common_modify_eq_delay ( sli4_t *  sli4,
void *  buf,
size_t  size,
sli4_queue_t *  q,
int  num_q,
uint32_t  shift,
uint32_t  delay_mult 
)
static

Write a COMMON_MODIFY_EQ_DELAY command.

Parameters
sli4SLI context.
bufDestination buffer for the command.
sizeBuffer size, in bytes.
qQueue object array.
num_qQueue object array count.
shiftPhase shift for staggering interrupts.
delay_multDelay multiplier for limiting interrupt frequency.
Returns
Returns the number of bytes written.

Definition at line 2136 of file sli4.c.

static int32_t sli_cmd_common_query_fw_config ( sli4_t *  sli4,
void *  buf,
size_t  size 
)
static

Write a COMMON_QUERY_FW_CONFIG command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to destination buffer.
sizeBuffer size in bytes.
Returns
Returns the number of bytes written

Definition at line 2726 of file sli4.c.

static int32_t sli_cmd_fw_deinitialize ( sli4_t *  sli4,
void *  buf,
size_t  size 
)
static

Write a FW_DEINITIALIZE command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes.
Returns
Returns the number of bytes written.

Definition at line 729 of file sli4.c.

static int32_t sli_cmd_fw_initialize ( sli4_t *  sli4,
void *  buf,
size_t  size 
)
static

Write a FW_INITIALIZE command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes.
Returns
Returns the number of bytes written.

Definition at line 749 of file sli4.c.

int32_t sli_cmd_read_config ( sli4_t *  sli4,
void *  buf,
size_t  size 
)

Write a READ_CONFIG command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes
Returns
Returns the number of bytes written.

Definition at line 961 of file sli4.c.

int32_t sli_cmd_read_nvparms ( sli4_t *  sli4,
void *  buf,
size_t  size 
)

Write a READ_NVPARMS command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes.
Returns
Returns the number of bytes written.

Definition at line 982 of file sli4.c.

static int32_t sli_cmd_read_rev ( sli4_t *  sli4,
void *  buf,
size_t  size,
ocs_dma_t *  vpd 
)
static

Write a READ_REV command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes.
vpdPointer to the buffer.
Returns
Returns the number of bytes written.

Definition at line 1034 of file sli4.c.

int32_t sli_cmd_reg_fcfi_mrq ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint8_t  mode,
uint16_t  fcf_index,
uint16_t  vlan_id,
sli4_cmd_rq_cfg_t  rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG] 
)

Write REG_FCFI_MRQ to provided command buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes.
fcf_indexFCF index returned by READ_FCF_TABLE.
vlan_idVLAN ID tag.
rq_cfgRQ_ID/R_CTL/TYPE routing information
Returns
returns 0 for success, a negative error code value for failure.

Definition at line 1193 of file sli4.c.

static int32_t sli_cmd_request_features ( sli4_t *  sli4,
void *  buf,
size_t  size,
sli4_features_t  mask,
uint8_t  query 
)
static

Write a REQUEST_FEATURES command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes.
maskFeatures to request.
queryUse feature query mode (does not change FW).
Returns
Returns the number of bytes written.

Definition at line 1456 of file sli4.c.

int32_t sli_cmd_write_nvparms ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint8_t *  wwpn,
uint8_t *  wwnn,
uint8_t  hard_alpa,
uint32_t  preferred_d_id 
)

Write a WRITE_NVPARMS command to the provided buffer.

Parameters
sli4SLI context pointer.
bufVirtual pointer to the destination buffer.
sizeBuffer size, in bytes.
wwpnWWPN to write - pointer to array of 8 uint8_t.
wwnnWWNN to write - pointer to array of 8 uint8_t.
hard_alpaHard ALPA to write.
preferred_d_idPreferred D_ID to write.
Returns
Returns the number of bytes written.

Definition at line 1007 of file sli4.c.

static int32_t sli_common_function_reset ( sli4_t *  sli4)
static

Issue a COMMON_FUNCTION_RESET command.

Parameters
sli4SLI context.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3667 of file sli4.c.

static int32_t sli_fw_init ( sli4_t *  sli4)
static

Initialize the firmware.

Description
Based on SLI-4 Architecture Specification, Revision 4.x0-13 (2012)..
Parameters
sli4SLI context.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3728 of file sli4.c.

static int32_t sli_fw_term ( sli4_t *  sli4)
static

Terminate the firmware.

Parameters
sli4SLI context.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3796 of file sli4.c.

static int32_t sli_get_config ( sli4_t *  sli4)
static

Definition at line 4056 of file sli4.c.

int32_t sli_init ( sli4_t *  sli4)

Definition at line 4590 of file sli4.c.

static uint8_t sli_intf_if_type ( uint32_t  val)
static

Retrieve the SLI interface type.

Parameters
val32-bit SLI_INTF register value.
Returns
Returns the SLI interface type.

Definition at line 316 of file sli4.c.

static uint8_t sli_intf_sli_family ( uint32_t  val)
static

Definition at line 303 of file sli4.c.

static uint8_t sli_intf_sli_revision ( uint32_t  val)
static

Retrieve the SLI revision level.

Parameters
val32-bit SLI_INTF register value.
Returns
Returns the SLI revision level.

Definition at line 297 of file sli4.c.

static uint8_t sli_intf_valid_check ( uint32_t  val)
static

Check if the SLI_INTF register is valid.

Parameters
val32-bit SLI_INTF register value.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 284 of file sli4.c.

int32_t sli_is_paused ( sli4_t *  sli4)

Definition at line 6390 of file sli4.c.

static uint8_t sli_pci_rev_id ( uint32_t  val)
static

Retrieve PCI revision ID.

Parameters
val32-bit PCI CLASS_REVISION register value.
Returns
Returns the PCI revision ID.

Definition at line 329 of file sli4.c.

int32_t sli_port_migration ( sli4_t *  sli4)

Definition at line 4701 of file sli4.c.

static int32_t sli_query_fw_config ( sli4_t *  sli4)
static

Issue a FW_CONFIG mailbox command and store the results.

Parameters
sli4SLI context.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3999 of file sli4.c.

static int32_t sli_queue_doorbell ( sli4_t *  sli4,
sli4_queue_t *  q 
)
static

Write the doorbell register associated with the queue object.

Parameters
sli4SLI context.
qQueue object.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3843 of file sli4.c.

static uint8_t sli_queue_entry_is_valid ( sli4_queue_t *  q,
uint8_t *  qe,
uint8_t  clear 
)
static

Check if the current queue entry is valid.

Parameters
qPointer to the queue object.
qePointer to the queue entry.
clearBoolean to clear valid bit.
Returns
Returns TRUE if the entry is valid, or FALSE otherwise.

Definition at line 5666 of file sli4.c.

int32_t sli_queue_index ( sli4_t *  sli4,
sli4_queue_t *  q 
)

Definition at line 5790 of file sli4.c.

int32_t sli_queue_poke ( sli4_t *  sli4,
sli4_queue_t *  q,
uint32_t  index,
uint8_t *  entry 
)

Definition at line 5801 of file sli4.c.

int32_t sli_queue_reset ( sli4_t *  sli4,
sli4_queue_t *  q 
)

Definition at line 5429 of file sli4.c.

uint32_t sli_reg_read ( sli4_t *  sli,
sli4_regname_e  reg 
)

Read the given SLI register.

Parameters
sliPointer to the SLI context.
regRegister name enum.
Returns
Returns the register value.

Definition at line 240 of file sli4.c.

void sli_reg_write ( sli4_t *  sli,
sli4_regname_e  reg,
uint32_t  val 
)

Write the value to the given SLI register.

Parameters
sliPointer to the SLI context.
regRegister name enum.
valValue to write.
Returns
None.

Definition at line 263 of file sli4.c.

static int32_t sli_request_features ( sli4_t *  sli4,
sli4_features_t *  features,
uint8_t  query 
)
static

Definition at line 3926 of file sli4.c.

static int32_t sli_res_sli_config ( void *  buf)
static

Check the SLI_CONFIG response.

Description
Function checks the SLI_CONFIG response and the payload status.
Parameters
bufPointer to SLI_CONFIG response.
Returns
Returns 0 on success, or a non-zero value on failure.

Definition at line 3636 of file sli4.c.

int32_t sli_reset ( sli4_t *  sli4)

Definition at line 4611 of file sli4.c.

int32_t sli_resource_reset ( sli4_t *  sli4,
sli4_resource_e  rtype 
)

Definition at line 5960 of file sli4.c.

static int32_t sli_sliport_control ( sli4_t *  sli4,
uint32_t  endian 
)
static

Initialize SLI Port control register.

Parameters
sli4SLI context pointer.
endianEndian value to write.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 1532 of file sli4.c.

void sli_validate_pause_errors ( sli4_t *  sli4,
uint32_t *  skip_dump 
)

Definition at line 6400 of file sli4.c.

static int32_t sli_wait_for_fw_ready ( sli4_t *  sli4,
uint32_t  timeout_ms 
)
static

check to see if the FW is ready.

Description
Based on SLI-4 Architecture Specification, Revision 4.x0-13 (2012)..
Parameters
sli4SLI context.
timeout_msTime, in milliseconds, to wait for the port to be ready before failing.
Returns
Returns TRUE for ready, or FALSE otherwise.

Definition at line 3701 of file sli4.c.

Variable Details

Define the mapping of registers to their BAR and offset.

Description
Although SLI-4 specification defines a common set of registers, their locations (both BAR and offset) depend on the interface type. This array maps a register enum to an array of BAR/offset pairs indexed by the interface type. For example, to access the bootstrap mailbox register on an interface type 0 device, code can refer to the offset using regmap[SLI4_REG_BMBX][0].offset.

Note: A value of UINT32_MAX for either the register set (rset) or offset (off) indicates an invalid mapping.

Definition at line 126 of file sli4.c.

sli4_asic_entry_t sli4_asic_table[]
Initial value:
= {
}

Definition at line 80 of file sli4.c.

const uint8_t sli4_fw_deinitialize[]
Initial value:
= {
0xff, 0xaa, 0xbb, 0xff,
0xff, 0xcc, 0xdd, 0xff,
}

FW_DEINITIALIZE - deinitialize a SLI port.

Note
This command uses a different format than all others.

Definition at line 68 of file sli4.c.

const uint8_t sli4_fw_initialize[]
Initial value:
= {
0xff, 0x12, 0x34, 0xff,
0xff, 0x56, 0x78, 0xff,
}

FW_INITIALIZE - initialize a SLI port.

Note
This command uses a different format than all others.

Definition at line 63 of file sli4.c.

const char* SLI_QNAME[]
Initial value:
= {
"Event Queue",
"Completion Queue",
"Mailbox Queue",
"Work Queue",
"Receive Queue",
"Undefined"
}

Definition at line 104 of file sli4.c.