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 "ocs.h"
#include "ocs_hal.h"
#include "sli4.h"
#include "sli4_iscsi.h"
#include "ocs_iscsi_spec.h"

Go to the source code of this file.

Detailed Description

Implementation of common SLI-4 functions All common (i.e. transport independent) SLI-4 functions are implemented here.

Definition in file sli4.c.

Data Structures

struct  sli4_asic_entry_t
 

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)
 
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 SLI interface type. More...
 
static uint8_t sli_pci_rev_id (uint32_t val)
 Retrieve PCI revision ID. More...
 
static uint8_t sli_asic_revision (uint32_t val)
 Retrieve SLI ASIC revision. 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...
 
int32_t sli_raise_ue (sli4_t *sli4)
 
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_mailbox_queue_entry (sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t length, ocs_dma_t *dma)
 Write a MQE header in the provided buffer. More...
 
static int32_t sli_cmd_common_get_fw_version (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_GET_FW_VERSION command to the provided buffer. 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_get_vpd_data (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_GET_VPD_DATA command to the provided buffer. More...
 
static int32_t sli_cmd_common_get_cntl_attributes (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_GET_CNTL_ATTRIBUTES command to the provided buffer. More...
 
static int32_t sli_cmd_common_get_cntl_addl_attributes (sli4_t *sli4, void *buf, size_t size)
 Write a COMMON_GET_CNTL_ADDL_ATTRIBUTES command to the provided buffer. More...
 
static int32_t sli_cmd_common_function_reset (sli4_t *sli4, void *buf, size_t size, uint64_t tag)
 write a COMMON_FUNCTION_RESET command. More...
 
static int32_t sli_cmd_common_create_cq (sli4_t *sli4, void *buf, size_t size, uint64_t tag, 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, uint64_t tag, uint16_t cq_id)
 write a COMMON_DESTROY_CQ command. More...
 
static int32_t sli_cmd_common_create_eq (sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *qmem, uint16_t ignored1, uint16_t ignored2)
 write a COMMON_CREATE_EQ 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_destroy_eq (sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t eq_id)
 Write a COMMON_DESTROY_EQ command. More...
 
static int32_t sli_cmd_common_create_mq_ext (sli4_t *sli4, void *buf, size_t size, uint64_t tag, 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, uint64_t tag, uint16_t mq_id)
 Write a COMMON_DESTROY_MQ command. More...
 
int32_t sli_cmd_common_tcp_upload (sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t wq_id, uint8_t graceful)
 Write a COMMON_TCP_UPLOAD command. More...
 
int32_t sli_cmd_common_nop (sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint64_t context)
 Write a COMMON_NOP command. More...
 
static int32_t sli_cmd_common_read_transceiver_data (sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t page_num, uint32_t port, ocs_dma_t *dma)
 Write a COMMON_READ_TRANSCEIVER_DATA command. More...
 
static int32_t sli_cmd_common_get_be_configuration_and_resources (sli4_t *sli4, void *buf, size_t size, uint64_t tag)
 Write a COMMON_COMMON_GET_BE_CONFIGURATION_AND_RESOURCES command. More...
 
int32_t sli_cmd_common_set_be_configuration_and_resources (sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t *mac_addr)
 Write a COMMON_COMMON_SET_BE_CONFIGURATION_AND_RESOURCES command. More...
 
int32_t sli_cmd_common_get_function_config (sli4_t *sli4, void *buf, size_t size, uint64_t tag)
 Write a COMMON_COMMON_GET_FUNCTION_CONFIG command. More...
 
int32_t sli_cmd_common_get_profile_config (sli4_t *sli4, void *buf, size_t size, uint64_t tag, 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, uint64_t tag, 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, uint64_t tag, 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, uint64_t tag)
 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, uint64_t tag, 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, uint64_t tag, ocs_dma_t *dma)
 Write a COMMON_COMMON_GET_RECONFIG_LINK_INFO command. More...
 
int32_t sli_cmd_common_set_reconfig_link_id (sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma, uint32_t fd, uint32_t active_link_config_id)
 Write a COMMON_COMMON_SET_RECONFIG_LINK_ID 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_cqe_mq (void *buf)
 Check mailbox/queue completion entry. More...
 
int32_t sli_cqe_async (sli4_t *sli4, void *buf)
 Check asynchronous event completion entry. More...
 
static int32_t sli_common_function_reset (sli4_t *sli4)
 Issue a COMMON_FUNCTION_RESET command. More...
 
static int32_t sli_iscsi_remove_sgl_pages (sli4_t *sli4)
 Issue a ISCSI_CFG_REMOVE_SGL_PAGES command. More...
 
static int32_t sli_get_fw_version (sli4_t *sli4)
 Issue a GET_FW_VERSION mailbox command and store the results. More...
 
static int32_t sli_read_transceiver_data (sli4_t *sli4)
 Issue a READ_TRANSCEIVER_DATA mailbox command and store the results. 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_query_fw_mac_addr (sli4_t *sli4)
 Issue a mailbox command and find the MAC address. More...
 
static int32_t sli_get_all_if_ids (sli4_t *sli4)
 Retrieve all of the defines interface IDs and store the default interface. More...
 
int32_t sli_setup (sli4_t *sli4, ocs_os_handle_t os, sli4_port_type_e port_type)
 Setup 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)
 
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, uint32_t version, 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 command to create queue. 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_queue_free (sli4_t *sli4, sli4_queue_t *q)
 Free a queue. More...
 
int32_t sli_queue_reset (sli4_t *sli4, sli4_queue_t *q)
 Zero all queue entries and reset the indexes. More...
 
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_arm (sli4_t *sli4, sli4_queue_t *q, uint8_t arm)
 Arm or dis-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...
 
void * sli_queue_iscsi_wqe_complete (sli4_t *sli4, sli4_queue_t *q, uint8_t wqe_index)
 Processes a solicited IO completion. Moves the WRB to the free list. More...
 
int32_t sli_queue_iscsi_tcp_ack (sli4_t *sli4, sli4_queue_t *q, uint8_t wqe_index)
 Processes a TCP ACK completion. More...
 
void * sli_queue_iscsi_icd_lookup (sli4_t *sli4, sli4_queue_t *q, uint16_t icd_index)
 Returns the IO tied to a specific ICD index. More...
 
void * sli_queue_iscsi_icd_invalid (sli4_t *sli4, sli4_queue_t *q, uint16_t icd_index, uint8_t *wait_for_tcp_ack, uint8_t tcp_ack_status)
 Processes a target command invalidation IO completion. Moves the WRB to the free list. More...
 
uint32_t sli_queue_iscsi_free_cnt (sli4_t *sli4, sli4_queue_t *q)
 Return the number of free WRB entries. More...
 
void sli_queue_iscsi_cleanup (void *hal, sli4_t *sli4, sli4_queue_t *q)
 Moves any WQE entries from the busy back to the free list when a connection is uploaded. 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_queue_peek (sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
 
int32_t sli_queue_peek (sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
 
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_fields_t *fields)
 Parse a CQ entry to retrieve event type and associated queue. More...
 
void sli_interrupt_set (sli4_t *sli, uint8_t enable)
 
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...
 

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...
 
const char * SLI_QNAME []
 
sli4_asic_entry_t sli4_asic_table []
 
const sli4_reg_t regmap [SLI4_REG_MAX][SLI4_MAX_IF_TYPES]
 Define the mapping of registers to their BAR and offset. More...
 

Function Details

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

Definition at line 3941 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 3908 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
Returns SLI ASIC generation.

Definition at line 332 of file sli4.c.

static uint8_t sli_asic_revision ( uint32_t  val)
static

Retrieve SLI ASIC revision.

Parameters
val32-bit SLI_ASIC_ID register value.
Returns
Returns SLI ASIC revision in hex.

Definition at line 313 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. timed out).

Definition at line 346 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 was successful, or non-zero otherwise.

Definition at line 376 of file sli4.c.

static int32_t sli_cmd_common_create_cq ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint64_t  tag,
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.
tagCommand tag.
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 778 of file sli4.c.

static int32_t sli_cmd_common_create_eq ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint64_t  tag,
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.
tagCommand tag.
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 934 of file sli4.c.

static int32_t sli_cmd_common_create_mq_ext ( sli4_t *  sli4,
void *  buf,
size_t  size,
uint64_t  tag,
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.
tagCommand tag.
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 1085 of file sli4.c.

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

write a COMMON_DESTROY_CQ command.

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

Definition at line 891 of file sli4.c.

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

Write a COMMON_DESTROY_EQ command.

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

Definition at line 1047 of file sli4.c.

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

Write a COMMON_DESTROY_MQ command.

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

Definition at line 1157 of file sli4.c.

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

write a COMMON_FUNCTION_RESET command.

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

Definition at line 741 of file sli4.c.

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

Write a COMMON_GET_CNTL_ADDL_ATTRIBUTES command to the provided buffer.

Parameters
sli4SLI context pointer
bufvirtual pointer to destination buffer
sizebuffer size in bytes
Returns
number of bytes written

Definition at line 706 of file sli4.c.

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

Write a COMMON_GET_CNTL_ATTRIBUTES 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 672 of file sli4.c.

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

Write a COMMON_GET_FW_VERSION 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 577 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 1003 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 608 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 destination buffer.
sizeBuffer size in bytes.
Returns
Returns the number of bytes written.

Definition at line 466 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 destination buffer.
sizeBuffer size in bytes.
Returns
Returns number of bytes written.

Definition at line 485 of file sli4.c.

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

Write a COMMON_GET_VPD_DATA 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 640 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 success, or non-zero otherwise.

Definition at line 1904 of file sli4.c.

static int32_t sli_fw_init ( sli4_t *  sli4)
static

Initialize the firmware.

Description
Based on SLI-4 Architecture Specification 2.4.1
Parameters
sli4SLI context.
Returns
Returns 0 success, or non-zero otherwise.

Definition at line 1970 of file sli4.c.

int32_t sli_fw_reset ( sli4_t *  sli4)

Definition at line 2822 of file sli4.c.

static int32_t sli_fw_term ( sli4_t *  sli4)
static

Terminate the firmware.

Parameters
sli4SLI context.
Returns
Returns 0 success, or non-zero otherwise.

Definition at line 2056 of file sli4.c.

static int32_t sli_get_all_if_ids ( sli4_t *  sli4)
static

Retrieve all of the defines interface IDs and store the default interface.

Parameters
sli4SLI context.
Returns
Returns 0 success, non-zero otherwise.

Definition at line 2483 of file sli4.c.

static int32_t sli_get_fw_version ( sli4_t *  sli4)
static

Issue a GET_FW_VERSION mailbox command and store the results.

Parameters
sli4SLI context.
Returns
Returns 0 success, or non-zero otherwise.

Definition at line 2167 of file sli4.c.

int32_t sli_init ( sli4_t *  sli4)

Definition at line 2803 of file sli4.c.

void sli_interrupt_set ( sli4_t *  sli,
uint8_t  enable 
)

Definition at line 4037 of file sli4.c.

static uint8_t sli_intf_if_type ( uint32_t  val)
static

Retrieve SLI interface type.

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

Definition at line 287 of file sli4.c.

static uint8_t sli_intf_sli_family ( uint32_t  val)
static

Definition at line 274 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 SLI revision level.

Definition at line 268 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 if valid, or non-zero otherwise.

Definition at line 255 of file sli4.c.

static int32_t sli_iscsi_remove_sgl_pages ( sli4_t *  sli4)
static

Issue a ISCSI_CFG_REMOVE_SGL_PAGES command.

Parameters
sli4SLI context.
Returns
Returns 0 success, or non-zero otherwise.

Definition at line 1935 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 PCI revision ID.

Definition at line 300 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 success, or non-zero otherwise.

Definition at line 2272 of file sli4.c.

static int32_t sli_query_fw_mac_addr ( sli4_t *  sli4)
static

Issue a mailbox command and find the MAC address.

Parameters
sli4SLI context.
Returns
Returns 0 success, or non-zero otherwise.

Definition at line 2357 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 success, or non-zero otherwise.

Definition at line 2100 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 queue object.
qePointer to queue entry.
clearBoolean to clear valid bit.
Returns
Returns TRUE if entry is valid, or FALSE otherwise.

Definition at line 3775 of file sli4.c.

int32_t sli_queue_index ( sli4_t *  sli4,
sli4_queue_t *  q 
)

Definition at line 3897 of file sli4.c.

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

Definition at line 3960 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 3929 of file sli4.c.

int32_t sli_raise_ue ( sli4_t *  sli4)

Definition at line 360 of file sli4.c.

static int32_t sli_read_transceiver_data ( sli4_t *  sli4)
static

Issue a READ_TRANSCEIVER_DATA mailbox command and store the results.

Parameters
sli4SLI context.
Returns
Returns 0 success, or non-zero otherwise.

Definition at line 2203 of file sli4.c.

int32_t sli_reset ( sli4_t *  sli4)

Definition at line 2809 of file sli4.c.

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

Definition at line 546 of file sli4.c.

Variable Details

Define the mapping of registers to their BAR and offset.

Although SLI-4 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 -1 for either the register set (rset) or offset (off) indicates an invalid mapping.

Definition at line 120 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 67 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 62 of file sli4.c.

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

Definition at line 75 of file sli4.c.