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

Go to the source code of this file.

Detailed Description

Define and implement the iSCSI Hardware Abstraction Layer (iHAL) All interaction with the hardware is done through the iHAL which abstracts away details of the underlying SLI implementation.

Definition in file ocs_hal.c.

Data Structures

struct  ocs_hal_skyhawk_linkcfg_map_t
 HAL link configuration enum to Skyhawk link config ID mapping. More...
 
struct  port_protocol_args_t
 

Macros

#define RC_MOVE_ASYNC   0x4173796e /* Asyn in hex */
 
#define OCS_HAL_WQ_ENTRIES   128 /* The number of WQEs per queue */
 
#define OCS_HAL_WQ_ENTRIES_USED   (OCS_HAL_WQ_ENTRIES / 2) /* Prevent CQ overflow */
 
#define OCS_HAL_CQ_NUM_FOR_INI   2 /* Number of CQs reserved for INI */
 
#define OCS_HAL_MAX_ABORT_IOS   128 /* max number of IO that we can abort */
 

Functions

static int32_t ocs_hal_cq_find (ocs_hal_t *hal, uint16_t cq_id)
 Find the CQ structure given the CQ_ID. More...
 
static sli4_queue_t * ocs_hal_wq_find (ocs_hal_t *hal, uint16_t wq_id)
 Find the WQ structure given the CQ_ID. More...
 
static int32_t ocs_hal_cq_process (ocs_hal_t *hal, sli4_queue_t *cq)
 Process entries on the give completion queue. More...
 
static int32_t ocs_hal_cb_link (void *ctx, void *e)
 Callback function for SLI link events. More...
 
static int32_t ocs_hal_cb_iscsi_async (void *ctx, void *e)
 Callback function for SLI iSCSI asynchromous events. More...
 
static int32_t ocs_hal_command_process (ocs_hal_t *, int32_t, uint8_t *, size_t)
 
static int32_t ocs_hal_cmd_submit_pending (ocs_hal_t *hal)
 Submit queued (pending) mbx commands. More...
 
static int32_t ocs_hal_mq_process (ocs_hal_t *hal, int32_t status, sli4_queue_t *mq)
 Process entries on the give mailbox queue. More...
 
static ocs_hal_rtn_e ocs_hal_setup_cxns (ocs_hal_t *hal)
 Initialize the pool of HAL connection objects. More...
 
static ocs_hal_rtn_e ocs_hal_setup_io (ocs_hal_t *hal)
 Initialize the pool of HAL IO objects. More...
 
static ocs_hal_rtn_e ocs_hal_init_io (ocs_hal_t *)
 
static ocs_hal_rtn_e ocs_hal_set_dif_mode (ocs_hal_t *hal)
 Sets the DIF mode value. More...
 
static int32_t ocs_hal_discovered_isns_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of retrieving the iSNS discovered list. More...
 
static int32_t ocs_hal_stateless_cb_if_info (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion if get_if_info for a configure stateless command. More...
 
static ocs_hal_sgl_info_t * ocs_hal_sgl_info_alloc (ocs_hal_t *hal)
 Allocate a HAL SGL Chaining object. More...
 
static void ocs_hal_sgl_info_free (ocs_hal_t *hal, ocs_hal_sgl_info_t *sgl_info)
 Free a previously allocated HAL SGL Chaining object. More...
 
static ocs_hal_rtn_e ocs_hal_rx_allocate (ocs_hal_t *hal)
 Allocate the RQ data buffers. More...
 
static ocs_hal_rtn_e ocs_hal_rx_post (ocs_hal_t *hal)
 Post the RQ data buffers to the chip. More...
 
static void ocs_hal_rx_free (ocs_hal_t *hal)
 Free the RQ data buffers. More...
 
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. More...
 
ocs_hal_rtn_e ocs_hal_init (ocs_hal_t *hal)
 Set up Hardware Abstraction Layer module. More...
 
int ocs_hal_fw_valid (ocs_hal_t *hal)
 Check that firmware version meets minimum requirements. More...
 
static ocs_cxn_t * ocs_hal_cxn_find (ocs_hal_t *hal, uint16_t wq_id)
 Find the connection structure given the WQ_ID. More...
 
static int32_t ocs_hal_rq_put (ocs_hal_t *hal, ocs_hal_rq_buffer_t *buffer)
 Posts an RX buffer to a queue and update the verification structures. More...
 
static ocs_hal_rq_buffer_t * ocs_hal_rq_get (ocs_hal_t *hal, uint16_t rqindex, uint16_t bufindex, uint32_t addr_high, uint32_t addr_low, uint32_t length)
 Process an unsolicited hdr/data. More...
 
static int32_t ocs_hal_dpdu_process (ocs_hal_t *hal, sli4_qentry_fields_dpdu_t *dpdu)
 Process an unsolicited hdr/data. More...
 
static int32_t ocs_hal_dmsg_process (ocs_hal_t *hal, sli4_qentry_fields_dmsg_t *dmsg)
 Process an TCK acknowledgement(DMSG). More...
 
static int32_t ocs_hal_tsol_process (ocs_hal_t *hal, sli4_qentry_fields_tsol_t *tsol)
 Process an solicited target IO completion. More...
 
static int32_t ocs_hal_isol_process (ocs_hal_t *hal, sli4_qentry_fields_isol_t *isol)
 Process an solicited initiator IO completion. More...
 
static int32_t ocs_hal_cmdinv_process (ocs_hal_t *hal, sli4_qentry_fields_tcmdinv_t *cmdinv)
 Process an target command error IO completion. More...
 
static int32_t ocs_hal_cxn_invalid_process (ocs_hal_t *hal, sli4_qentry_fields_cnxinv_t *cxn_invalid)
 Process an Connection invalid completion entry. More...
 
static int32_t ocs_hal_data_digest_process (ocs_hal_t *hal, sli4_qentry_fields_data_digest_t *data_digest)
 Process an data digest completion entry. More...
 
static int32_t ocs_hal_tx_dif_error_process (ocs_hal_t *hal, sli4_qentry_fields_tx_dif_error_t *dif_err)
 Process an transmit DIF error completion entry. More...
 
static int32_t ocs_hal_compl_async_ctx_bad_status (ocs_hal_t *hal, ocs_command_ctx_t *ctx, uint8_t status, uint8_t additional_status)
 Sends a bad status to the caller when an asynchronous message fails. More...
 
static int32_t ocs_hal_stateless_async_event (ocs_hal_t *hal, sli4_stateless_op_cmpl_event_t *event, uint8_t isv4)
 Processes the asynchronous stateless completion message. More...
 
static int32_t ocs_hal_dhcp_async_event (ocs_hal_t *hal, sli4_dhcp_op_cmpl_event_t *event)
 Processes the asynchronous DHCP completion message. More...
 
static int32_t ocs_hal_flush (ocs_hal_t *hal)
 
ocs_hal_rtn_e ocs_hal_command_bootstrap (ocs_hal_t *hal, uint8_t *cmd)
 Issue a SLI command to the bootstrap mailbox. More...
 
ocs_command_ctx_t * ocs_hal_command_get_ctx (ocs_hal_t *hal)
 Issue a SLI command. More...
 
void ocs_hal_command_free_ctx (ocs_hal_t *hal, ocs_command_ctx_t *ctx)
 Issue a SLI command. More...
 
ocs_hal_rtn_e ocs_hal_command_queue (ocs_hal_t *hal, ocs_command_ctx_t *ctx)
 Issue a SLI command. More...
 
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. More...
 
ocs_hal_rtn_e ocs_hal_rxbuffer (ocs_hal_t *hal, ocs_hal_rq_buffer_t *header, ocs_hal_rq_buffer_t *payload)
 Add a receive buffer pair to the Receive Queue. More...
 
static int32_t ocs_hal_command_cancel (ocs_hal_t *hal)
 
static void ocs_hal_ctx_cleanup (ocs_hal_t *hal)
 Free the command contents. More...
 
static void ocs_hal_cxn_cleanup (ocs_list_t *list)
 Free the connection tracking structures. More...
 
ocs_hal_rtn_e ocs_hal_teardown (ocs_hal_t *hal)
 Tear down Hardware Abstraction Layer module. More...
 
ocs_hal_rtn_e ocs_hal_reset (ocs_hal_t *hal, ocs_hal_reset_e reset)
 
int32_t ocs_hal_get_num_eq (ocs_hal_t *hal)
 
ocs_hal_rtn_e ocs_hal_get (ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t *value)
 
void * ocs_hal_get_ptr (ocs_hal_t *hal, ocs_hal_property_e prop)
 
ocs_hal_rtn_e ocs_hal_set (ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t value)
 
ocs_hal_rtn_e ocs_hal_set_ptr (ocs_hal_t *hal, ocs_hal_property_e prop, void *value)
 
int32_t ocs_hal_event_check (ocs_hal_t *hal, uint32_t vector)
 Check for events associated with the interrupt vector. More...
 
int32_t ocs_hal_process (ocs_hal_t *hal, uint32_t vector, uint32_t max_isr_time_msec)
 Process events associated with the interrupt vector. More...
 
ocs_hal_rtn_e ocs_hal_domain_add (ocs_hal_t *hal, ocs_sli_port_t *sport, ocs_domain_t *domain)
 Adds a domain object. More...
 
ocs_hal_rtn_e ocs_hal_domain_free (ocs_hal_t *hal, ocs_domain_t *domain)
 Free a domain object. More...
 
static int32_t ocs_hal_portal_std_cb_no_parms (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Send the callback for a network interface delete command. More...
 
ocs_hal_rtn_e ocs_hal_portal_set_mac (ocs_hal_t *hal, uint8_t *mac_address, portal_cb_t portal_cb, void *ul_arg)
 Set the MAC address on the portal. More...
 
ocs_hal_rtn_e ocs_hal_portal_set_mtu (ocs_hal_t *hal, uint8_t is_jumbo, portal_cb_t portal_cb, void *ul_arg)
 Enable Jumbo frame support on the portal. More...
 
ocs_hal_portal_t ocs_hal_portal_get_default (ocs_hal_t *hal)
 Return the default portal. More...
 
static int32_t ocs_hal_portal_create_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Send the callback for a network interface create command. More...
 
ocs_hal_rtn_e ocs_hal_portal_create (ocs_hal_t *hal, unsigned int vlan_tag, portal_cb_t portal_cb, void *ul_arg)
 Create a new VLAN interface handle. More...
 
ocs_hal_rtn_e ocs_hal_portal_delete (ocs_hal_t *hal, ocs_hal_portal_t portal, portal_cb_t portal_cb, void *ul_arg)
 Delete a VLAN interface handle. More...
 
static int32_t ocs_hal_cb_wait_async (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the mailbox completion of command waiting for async messages. More...
 
int32_t ocs_hal_portal_set_route_table_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of Set Route table command. More...
 
int32_t ocs_hal_portal_get_route_table_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of Get Route table command. More...
 
ocs_hal_rtn_e ocs_hal_portal_set_route_table (ocs_hal_t *hal, ocs_hal_ip_address_subnet_t *hal_ipsub, ocs_hal_ip_address_t *hal_gateway, int32_t add, portal_cb_t portal_cb, void *ul_arg)
 Add/Remove an entry to routing table. More...
 
ocs_hal_rtn_e ocs_hal_portal_get_route_table (ocs_hal_t *hal, portal_cb_t portal_cb, void *ul_arg)
 Read routing table. More...
 
ocs_hal_rtn_e ocs_hal_portal_ip_add (ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_address_subnet_t *ipaddr, portal_cb_t portal_cb, void *ul_arg)
 Add an IP address to an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_ip_remove (ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_address_subnet_t *ipaddr, portal_cb_t portal_cb, void *ul_arg)
 Removes an IP address from an interface. More...
 
static int32_t ocs_hal_portal_ip_get_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion if get_if_info for a user request. More...
 
ocs_hal_rtn_e ocs_hal_portal_ip_get (ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_type_e ip_type, portal_cb_t portal_cb, void *ul_arg)
 Retrieves the IP addresses on an interface. More...
 
static int32_t ocs_hal_portal_get_default_gateway_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of get_default_gateway for a user request. More...
 
ocs_hal_rtn_e ocs_hal_portal_gateway_get (ocs_hal_t *hal, ocs_hal_ip_type_e ip_type, portal_cb_t portal_cb, void *ul_arg)
 Retrieves the default gateway on an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_gateway_add (ocs_hal_t *hal, ocs_hal_ip_address_t *gateway, portal_cb_t portal_cb, void *ul_arg)
 adds the default gateway on an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_gateway_remove (ocs_hal_t *hal, ocs_hal_ip_address_t *gateway, portal_cb_t portal_cb, void *ul_arg)
 removes a default gateway on an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_listen_start (ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
 Starts listening on a TCP port. More...
 
ocs_hal_rtn_e ocs_hal_portal_listen_stop (ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
 Stops listening on a TCP port. More...
 
ocs_hal_rtn_e ocs_hal_portal_isns_discover (ocs_hal_t *hal, ocs_hal_portal_t portal, portal_cb_t portal_cb, void *ul_arg)
 Discovers iSNS servers via DHCP. More...
 
static int32_t ocs_hal_portal_isns_send_packet_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Send the callback for the sending of an iSNS packet. More...
 
ocs_hal_rtn_e ocs_hal_portal_isns_send_packet (ocs_hal_t *hal, ocs_hal_ip_address_t *isns_server, uint32_t tcp_port, void *packet, uint32_t pkt_len, portal_cb_t portal_cb, void *ul_arg)
 Sends an iSNS packet to the requested server. More...
 
ocs_hal_rtn_e ocs_hal_portal_esi_listen_start (ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
 Starts listening for iSNS ESI messages on a TCP port. More...
 
ocs_hal_rtn_e ocs_hal_portal_esi_listen_stop (ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
 Stops listening on an iSNS ESI TCP port. More...
 
ocs_cxn_t * ocs_hal_cxn_alloc (ocs_hal_t *hal, uint32_t conn_hdl)
 Gets a free connection structure. More...
 
static int32_t ocs_hal_cxn_tcp_connect_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Process the completion of a request for a new tcp connection. More...
 
ocs_hal_rtn_e ocs_hal_cxn_connect (ocs_hal_t *hal, ocs_cxn_t *cxn, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t window_size, uint8_t window_scale, cxn_cb_t cxn_cb, void *ul_arg)
 Establish a TCP connection from an initiator to a target. More...
 
static int32_t ocs_hal_cxn_std_cb_no_parms (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Send the connection callback with no parameters passed back. More...
 
ocs_hal_rtn_e ocs_hal_cxn_reject (ocs_hal_t *hal, uint32_t conn_hdl, cxn_cb_t cxn_cb, void *ul_arg)
 Rejects an incoming connection on a target. More...
 
static int32_t ocs_hal_cxn_get_info_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Process the completion of a request for connection information. More...
 
ocs_hal_rtn_e ocs_hal_cxn_get_info (ocs_hal_t *hal, ocs_cxn_t *cxn, cxn_cb_t cxn_cb, void *ul_arg)
 Retrieves information about an incoming context. More...
 
static void ocs_hal_cxn_cq_select (ocs_hal_t *hal, ocs_cxn_t *cxn)
 Assign a CQ for the connection. More...
 
static void ocs_hal_cxn_cq_release (ocs_hal_t *hal, ocs_cxn_t *cxn)
 Release a CQ for the connection. More...
 
ocs_hal_rtn_e ocs_hal_cxn_offload (ocs_hal_t *hal, ocs_cxn_t *cxn, uint32_t tcp_window_size, uint8_t data_digest, uint8_t hdr_digest, uint32_t max_rcv_dsl, cxn_cb_t cxn_cb, void *ul_arg)
 Offloads an incoming connection on a target. More...
 
uint32_t ocs_hal_cxn_get_free_wq_cnt (ocs_hal_t *hal, ocs_cxn_t *cxn)
 Returns the number of free entries on the work queue for this connection. More...
 
ocs_hal_rtn_e ocs_hal_cxn_close (ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t sendRst, cxn_cb_t cxn_cb, void *ul_arg)
 Invalidates a connection and optionally sends a TCP Reset. More...
 
ocs_hal_rtn_e ocs_hal_cxn_upload (ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t graceful, cxn_cb_t cxn_cb, void *ul_arg)
 uploads an incoming connection on a target. More...
 
ocs_hal_rtn_e ocs_hal_cxn_free (ocs_hal_t *hal, ocs_cxn_t *cxn)
 Frees a connection object for re-use. More...
 
ocs_hal_io_t * ocs_hal_io_alloc (ocs_hal_t *hal)
 Allocate a HAL IO object. More...
 
static void ocs_hal_io_check_quarantine_list (ocs_hal_t *hal, uint32_t *quarantine_cnt, ocs_list_t *quarantine_list)
 If there are more than 4 objects on the quarantine list, then free IOs until there are at most 4 left on the list. More...
 
void ocs_hal_io_free (ocs_hal_t *hal, ocs_hal_io_t *io)
 Free a previously allocated HAL IO object. 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_cxn_t *cxn, io_cb_t cb, void *arg)
 Send a read, write, or response IO. More...
 
ocs_hal_rtn_e ocs_hal_io_init_sges (ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_io_type_e type, uint32_t offset)
 Initialize the Scatter Gather List entries of an IO. More...
 
static ocs_hal_sgl_info_t * ocs_hal_io_get_sgl_info (ocs_hal_t *hal, ocs_hal_io_t *io)
 Find the correct position to add an SGL. This may result in the allocation of a chained SGL List. More...
 
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. 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_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...
 
static int32_t ocs_hal_io_abort_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Receives the callback for an invalidate commands mailbox cmd. More...
 
static ocs_hal_rtn_e ocs_hal_io_abort_send_cmd (ocs_hal_t *hal, ocs_hal_io_t **ios, uint16_t num_ios, ocs_hal_abort_type_e abort_type)
 Abort a list of IOs. More...
 
static ocs_hal_rtn_e ocs_hal_io_abort_add_entry (ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_io_t **ios, uint16_t *io_index, ocs_hal_abort_type_e abort_type)
 Abort a list of IOs. More...
 
ocs_hal_rtn_e ocs_hal_io_abort (ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_abort_scope_e abort_scope, ocs_hal_abort_type_e abort_type)
 Abort a currently running IO. More...
 
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. More...
 
static int32_t ocs_hal_get_profile_list_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of get_profile_list for a user request. More...
 
ocs_hal_rtn_e ocs_hal_get_profile_list (ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void *ul_arg)
 Get a list of available profiles. More...
 
static int32_t ocs_hal_get_active_profile_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of get_active_profile for a user request. More...
 
int32_t ocs_hal_get_active_profile (ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
 Get the currently active profile. More...
 
static int32_t ocs_hal_set_active_profile_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of set_active_profile for a user request. More...
 
ocs_hal_rtn_e ocs_hal_set_active_profile (ocs_hal_t *hal, mgmt_cb_t cb, uint32_t profile_id, void *ul_arg)
 Set the currently active profile. More...
 
static uint32_t ocs_hal_config_id_from_linkcfg (ocs_hal_linkcfg_e linkcfg)
 Helper function for getting a Skyhawk link config ID from the HAL linkcfg enum. More...
 
static ocs_hal_linkcfg_e ocs_hal_linkcfg_from_config_id (const uint32_t config_id)
 Helper function for getting the HAL linkcfg enum from a Skyhawk config ID. More...
 
static int32_t ocs_hal_get_linkcfg_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of get_linkcfg for a user request. More...
 
int32_t ocs_hal_get_linkcfg (ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
 Get the current link configuration. More...
 
static int32_t ocs_hal_set_linkcfg_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of set_linkcfg for a user request. More...
 
ocs_hal_rtn_e ocs_hal_set_linkcfg (ocs_hal_t *hal, mgmt_cb_t cb, ocs_hal_linkcfg_e value, void *ul_arg)
 Set the link configuration (Skyhawk only). More...
 
static int32_t ocs_hal_get_port_profile_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of get_port_profile for a user request. More...
 
int32_t ocs_hal_get_port_protocol (ocs_hal_t *hal, uint32_t pci_func, mgmt_cb_t cb, void *ul_arg)
 Get the current port protocol. More...
 
static int32_t ocs_hal_set_port_protocol_cb2 (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of set_port_profile for a user request. More...
 
static int32_t ocs_hal_set_port_protocol_cb1 (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Called for the completion of set_port_profile for a user request. More...
 
ocs_hal_rtn_e ocs_hal_set_port_protocol (ocs_hal_t *hal, uint32_t pci_func, ocs_hal_port_protocol_e new_protocol, mgmt_cb_t cb, void *ul_arg)
 Set the port protocol. More...
 
ocs_hal_io_t * ocs_hal_io_find_itt (ocs_hal_t *hal, uint32_t itt)
 Find an IO based on the initiator task tag. More...
 
uint32_t tcmd_thread_id (void)
 
static ocs_hal_rq_buffer_t * ocs_hal_rx_buffer_alloc (ocs_hal_t *hal, uint32_t rqindex, uint32_t count, uint32_t size)
 Allocate an ocs_hal_rx_buffer_t array. More...
 
static void ocs_hal_rx_buffer_free (ocs_hal_t *hal, ocs_hal_rq_buffer_t *rq_buf, uint32_t count)
 Free an ocs_hal_rx_buffer_t array. More...
 
static int32_t ocs_scsi_async_cb (ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
 Check pending error asynchronous callback function. More...
 
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...
 
void ocs_hal_cxn_req_invalidate (ocs_list_t *list_cxn)
 

Variables

static
ocs_hal_skyhawk_linkcfg_map_t 
skyhawk_linkcfg_map []
 Mapping from the HAL linkcfg enum to the Skyhawk link config IDs. More...
 

Macro Details

#define OCS_HAL_CQ_NUM_FOR_INI   2 /* Number of CQs reserved for INI */

Definition at line 61 of file ocs_hal.c.

#define OCS_HAL_MAX_ABORT_IOS   128 /* max number of IO that we can abort */

Definition at line 62 of file ocs_hal.c.

#define OCS_HAL_WQ_ENTRIES   128 /* The number of WQEs per queue */

Definition at line 59 of file ocs_hal.c.

#define OCS_HAL_WQ_ENTRIES_USED   (OCS_HAL_WQ_ENTRIES / 2) /* Prevent CQ overflow */

Definition at line 60 of file ocs_hal.c.

#define RC_MOVE_ASYNC   0x4173796e /* Asyn in hex */

Definition at line 58 of file ocs_hal.c.

Function Details

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 7518 of file ocs_hal.c.

static int32_t ocs_hal_cb_iscsi_async ( void *  ctx,
void *  e 
)
static

Callback function for SLI iSCSI asynchromous events.

Parameters
ctxHardware context pointer (i.e. ocs_hal_t *).
eEvent structure pointer (i.e. sli4_iscsi_async_event_t *).
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1721 of file ocs_hal.c.

static int32_t ocs_hal_cb_link ( void *  ctx,
void *  e 
)
static

Callback function for SLI link events.

Description
This function allocates memory which must be freed in its callback.
Parameters
ctxHardware context pointer (i.e. ocs_hal_t *).
eEvent structure pointer (i.e. sli4_link_event_t *).
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1521 of file ocs_hal.c.

static int32_t ocs_hal_cb_wait_async ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the mailbox completion of command waiting for async messages.

Description
We must wait for the asynchronous message completion that the operation is complete; so we queue the request and wait for the event.
Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3351 of file ocs_hal.c.

static int32_t ocs_hal_cmd_submit_pending ( ocs_hal_t *  hal)
static

Submit queued (pending) mbx commands.

Description
Submit queued mailbox commands.

— Assumes that hal->cmd_lock is held —
Parameters
halHardware context.
Returns
Returns 0 one success, or a negative error code value on failure.

Definition at line 2112 of file ocs_hal.c.

static int32_t ocs_hal_cmdinv_process ( ocs_hal_t *  hal,
sli4_qentry_fields_tcmdinv_t *  cmdinv 
)
static

Process an target command error IO completion.

Parameters
halHardware context.
cmdinvPointer T_CMNDINV CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1117 of file ocs_hal.c.

static int32_t ocs_hal_command_cancel ( ocs_hal_t *  hal)
static

Definition at line 2290 of file ocs_hal.c.

static int32_t ocs_hal_command_process ( ocs_hal_t *  hal,
int32_t  status,
uint8_t *  mqe,
size_t  size 
)
static

Definition at line 1456 of file ocs_hal.c.

static int32_t ocs_hal_compl_async_ctx_bad_status ( ocs_hal_t *  hal,
ocs_command_ctx_t *  ctx,
uint8_t  status,
uint8_t  additional_status 
)
static

Sends a bad status to the caller when an asynchronous message fails.

Description
This function calls the callback function for the context and puts it back on the free list.
Parameters
halHardware context.
ctxCommand context from ocs_hal_command_get_ctx().
statusAsynchronous status.
additional_statusAsynchronous additional status.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1565 of file ocs_hal.c.

static uint32_t ocs_hal_config_id_from_linkcfg ( ocs_hal_linkcfg_e  linkcfg)
static

Helper function for getting a Skyhawk link config ID from the HAL linkcfg enum.

Parameters
linkcfgHAL linkcfg enum.
Returns
Returns the Skyhawk link config ID corresponding to given linkcfg.

Definition at line 6545 of file ocs_hal.c.

static int32_t ocs_hal_cq_find ( ocs_hal_t *  hal,
uint16_t  cq_id 
)
static

Find the CQ structure given the CQ_ID.

Parameters
halHardware context.
cq_idCQ ID to find.
Returns
Returns index of queue object, or -1 otherwise.

Definition at line 637 of file ocs_hal.c.

static int32_t ocs_hal_cq_process ( ocs_hal_t *  hal,
sli4_queue_t *  cq 
)
static

Process entries on the give completion queue.

Parameters
halHardware context.
cqPointer to the completion queue object.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1347 of file ocs_hal.c.

static ocs_cxn_t* ocs_hal_cxn_find ( ocs_hal_t *  hal,
uint16_t  wq_id 
)
static

Find the connection structure given the WQ_ID.

Parameters
halHardware context.
wq_idWQ ID to find.
Returns
Returns the pointer to the queue object, or NULL otherwise.

Definition at line 714 of file ocs_hal.c.

static int32_t ocs_hal_cxn_get_info_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Process the completion of a request for connection information.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 4727 of file ocs_hal.c.

static int32_t ocs_hal_cxn_invalid_process ( ocs_hal_t *  hal,
sli4_qentry_fields_cnxinv_t *  cxn_invalid 
)
static

Process an Connection invalid completion entry.

Parameters
halHardware context.
cxn_invalidPointer T_CNXINV CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1173 of file ocs_hal.c.

void ocs_hal_cxn_req_invalidate ( ocs_list_t *  list_cxn)

Definition at line 7547 of file ocs_hal.c.

static int32_t ocs_hal_cxn_std_cb_no_parms ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Send the connection callback with no parameters passed back.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 4651 of file ocs_hal.c.

static int32_t ocs_hal_cxn_tcp_connect_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Process the completion of a request for a new tcp connection.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 4513 of file ocs_hal.c.

static int32_t ocs_hal_data_digest_process ( ocs_hal_t *  hal,
sli4_qentry_fields_data_digest_t *  data_digest 
)
static

Process an data digest completion entry.

Parameters
halHardware context.
data_digestPointer T_SOL_DATA_DIGEST CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1247 of file ocs_hal.c.

static int32_t ocs_hal_dhcp_async_event ( ocs_hal_t *  hal,
sli4_dhcp_op_cmpl_event_t *  event 
)
static

Processes the asynchronous DHCP completion message.

Description
This function searches the mailbox list of commands waiting for asynchronous completions. If they are found then a new mailbox command is issued to retrieve the iSNS servers that were discovered.
Parameters
halHardware context.
eventThe stateless event message.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1667 of file ocs_hal.c.

static int32_t ocs_hal_discovered_isns_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of retrieving the iSNS discovered list.

Description
This callback is the end of the sequence. The IP address list is returned to the caller.
Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3388 of file ocs_hal.c.

static int32_t ocs_hal_dmsg_process ( ocs_hal_t *  hal,
sli4_qentry_fields_dmsg_t *  dmsg 
)
static

Process an TCK acknowledgement(DMSG).

Parameters
halHardware context.
dmsgPointer I_T_DMSG CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 994 of file ocs_hal.c.

static int32_t ocs_hal_dpdu_process ( ocs_hal_t *  hal,
sli4_qentry_fields_dpdu_t *  dpdu 
)
static

Process an unsolicited hdr/data.

Parameters
halHardware context.
dpduPointer I_T_DPDU CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 889 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.

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 will be 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 otherwise.

Definition at line 6229 of file ocs_hal.c.

static int32_t ocs_hal_flush ( ocs_hal_t *  hal)
static

Definition at line 1994 of file ocs_hal.c.

int ocs_hal_fw_valid ( ocs_hal_t *  hal)

Check that firmware version meets minimum requirements.

Parameters
halHardware context.
Returns
Returns TRUE if firmware version is acceptable, or FALSE if not.

Definition at line 624 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_get ( ocs_hal_t *  hal,
ocs_hal_property_e  prop,
uint32_t *  value 
)

Definition at line 2666 of file ocs_hal.c.

static int32_t ocs_hal_get_active_profile_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of get_active_profile for a user request.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6361 of file ocs_hal.c.

static int32_t ocs_hal_get_linkcfg_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of get_linkcfg for a user request.

Parameters
halHardware context.
statusStatus from the MQE
ctxPointer to the command context
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6588 of file ocs_hal.c.

int32_t ocs_hal_get_num_eq ( ocs_hal_t *  hal)

Definition at line 2660 of file ocs_hal.c.

static int32_t ocs_hal_get_port_profile_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of get_port_profile for a user request.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6771 of file ocs_hal.c.

static int32_t ocs_hal_get_profile_list_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of get_profile_list for a user request.

Description
This function is called when the COMMMON_GET_PROFILE_LIST mailbox completes. The response will be in ctx->non_embedded_mem.virt. This function parses the response and creates a ocs_hal_profile_list, then calls the mgmt_cb callback function and passes that list to it.
Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6253 of file ocs_hal.c.

void* ocs_hal_get_ptr ( ocs_hal_t *  hal,
ocs_hal_property_e  prop 
)

Definition at line 2753 of file ocs_hal.c.

static ocs_hal_rtn_e ocs_hal_init_io ( ocs_hal_t *  hal)
static

Definition at line 1916 of file ocs_hal.c.

static int32_t ocs_hal_io_abort_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Receives the callback for an invalidate commands mailbox cmd.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context for this request.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 5931 of file ocs_hal.c.

static int32_t ocs_hal_isol_process ( ocs_hal_t *  hal,
sli4_qentry_fields_isol_t *  isol 
)
static

Process an solicited initiator IO completion.

Parameters
halHardware context.
isolPointer I_SOL CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1061 of file ocs_hal.c.

static ocs_hal_linkcfg_e ocs_hal_linkcfg_from_config_id ( const uint32_t  config_id)
static

Helper function for getting the HAL linkcfg enum from a Skyhawk config ID.

Parameters
config_idSkyhawk link config ID.
Returns
Returns the HAL linkcfg enum corresponding to config_id.

Definition at line 6565 of file ocs_hal.c.

static int32_t ocs_hal_mq_process ( ocs_hal_t *  hal,
int32_t  status,
sli4_queue_t *  mq 
)
static

Process entries on the give mailbox queue.

Parameters
halHardware context.
statusCQE status.
mqPointer to the mailbox queue object.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1498 of file ocs_hal.c.

static int32_t ocs_hal_portal_create_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Send the callback for a network interface create command.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3230 of file ocs_hal.c.

static int32_t ocs_hal_portal_get_default_gateway_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of get_default_gateway for a user request.

Parameters
halHardware context.
statusThe status from the MQE
ctxpointer to the command context
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3972 of file ocs_hal.c.

int32_t ocs_hal_portal_get_route_table_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)

Called for the completion of Get Route table command.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3518 of file ocs_hal.c.

static int32_t ocs_hal_portal_ip_get_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion if get_if_info for a user request.

Parameters
halHardware context.
statusThe status from the MQE
ctxpointer to the command context
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3874 of file ocs_hal.c.

static int32_t ocs_hal_portal_isns_send_packet_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Send the callback for the sending of an iSNS packet.

Parameters
halHardware context.
statusThe status from the MQE
ctxpointer to the command context
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 4288 of file ocs_hal.c.

int32_t ocs_hal_portal_set_route_table_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)

Called for the completion of Set Route table command.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3479 of file ocs_hal.c.

static int32_t ocs_hal_portal_std_cb_no_parms ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Send the callback for a network interface delete command.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3090 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_reset ( ocs_hal_t *  hal,
ocs_hal_reset_e  reset 
)

Definition at line 2558 of file ocs_hal.c.

static ocs_hal_rq_buffer_t* ocs_hal_rq_get ( ocs_hal_t *  hal,
uint16_t  rqindex,
uint16_t  bufindex,
uint32_t  addr_high,
uint32_t  addr_low,
uint32_t  length 
)
static

Process an unsolicited hdr/data.

Parameters
halHardware context.
rqindexIndex of the RQ that is being processed.
bufindexIndex into the RQ that is being processed.
addr_highUpper 32 bits of buffer address.
addr_lowLower 32 bits of buffer address.
lengthLength of data placed.
Returns
Returns the pointer to the dma buffer structure, or NULL otherwise.

Definition at line 794 of file ocs_hal.c.

static int32_t ocs_hal_rq_put ( ocs_hal_t *  hal,
ocs_hal_rq_buffer_t *  buffer 
)
static

Posts an RX buffer to a queue and update the verification structures.

Parameters
halHardware context.
bufferPointer to the RX buffer.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 736 of file ocs_hal.c.

static ocs_hal_rtn_e ocs_hal_rx_allocate ( ocs_hal_t *  hal)
static

Allocate the RQ data buffers.

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

Definition at line 7300 of file ocs_hal.c.

static ocs_hal_rq_buffer_t* ocs_hal_rx_buffer_alloc ( ocs_hal_t *  hal,
uint32_t  rqindex,
uint32_t  count,
uint32_t  size 
)
static

Allocate an ocs_hal_rx_buffer_t array.

Description
An ocs_hal_rx_buffer_t array is allocated, along with the required DMA memory
Parameters
halPointer to HAL object.
rqindexRQ index for this buffer.
countCount of buffers in array.
sizeSize of buffer.
Returns
Pointer to allocated ocs_hal_rq_buffer_t array.

Definition at line 7228 of file ocs_hal.c.

static void ocs_hal_rx_buffer_free ( ocs_hal_t *  hal,
ocs_hal_rq_buffer_t *  rq_buf,
uint32_t  count 
)
static

Free an ocs_hal_rx_buffer_t array.

Description
The ocs_hal_rx_buffer_t array is freed, along with allocated DMA memory.
Parameters
halPointer to HAL object.
rq_bufPointer to ocs_hal_rx_buffer_t array.
countCount of buffers in array.
Returns
none

Definition at line 7278 of file ocs_hal.c.

static void ocs_hal_rx_free ( ocs_hal_t *  hal)
static

Free the RQ data buffers.

Parameters
halPointer to HAL object.

Definition at line 7445 of file ocs_hal.c.

static ocs_hal_rtn_e ocs_hal_rx_post ( ocs_hal_t *  hal)
static

Post the RQ data buffers to the chip.

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

Definition at line 7383 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set ( ocs_hal_t *  hal,
ocs_hal_property_e  prop,
uint32_t  value 
)

Definition at line 2790 of file ocs_hal.c.

static int32_t ocs_hal_set_active_profile_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of set_active_profile for a user request.

Parameters
halHardware context.
statusStatus from the MQE
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6444 of file ocs_hal.c.

static ocs_hal_rtn_e ocs_hal_set_dif_mode ( ocs_hal_t *  hal)
static

Sets the DIF mode value.

Parameters
halHardware context.
Returns
Returns OCS_HAL_RTN_SUCCESS on success.

Definition at line 1943 of file ocs_hal.c.

static int32_t ocs_hal_set_linkcfg_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of set_linkcfg for a user request.

Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6682 of file ocs_hal.c.

static int32_t ocs_hal_set_port_protocol_cb1 ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of set_port_profile for a user request.

Description
This is the first of 2 callbacks for the set_port_protocol function. The set operation is a read-modify-write. This callback is called when the read completes (GET_PROFILE_CONFG). It will updated the resource descriptors, then queue the write (SET_PROFILE_CONFIG).
Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6951 of file ocs_hal.c.

static int32_t ocs_hal_set_port_protocol_cb2 ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion of set_port_profile for a user request.

Description
This is the second of 2 callbacks for the set_port_protocol function. The set operation is a read-modify-write. This callback is called when the write (SET_PROFILE_CONFIG) completes.
Parameters
halHardware context.
statusStatus from the MQE.
ctxPointer to the command context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 6920 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set_ptr ( ocs_hal_t *  hal,
ocs_hal_property_e  prop,
void *  value 
)

Definition at line 2897 of file ocs_hal.c.

static ocs_hal_rtn_e ocs_hal_setup_cxns ( ocs_hal_t *  hal)
static

Initialize the pool of HAL connection objects.

Parameters
halHardware context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1766 of file ocs_hal.c.

static ocs_hal_rtn_e ocs_hal_setup_io ( ocs_hal_t *  hal)
static

Initialize the pool of HAL IO objects.

Parameters
halHardware context.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1837 of file ocs_hal.c.

static int32_t ocs_hal_stateless_async_event ( ocs_hal_t *  hal,
sli4_stateless_op_cmpl_event_t *  event,
uint8_t  isv4 
)
static

Processes the asynchronous stateless completion message.

Description
This function searches the mailbox list of commands waiting for asynchronous completions. If they are found then a new mailbox command is issued to retrieve the IP address that was assigned.
Parameters
halHardware context.
eventStateless event message.
isv4TRUE for IPv4 event, FALSE for IPv6.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1606 of file ocs_hal.c.

static int32_t ocs_hal_stateless_cb_if_info ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Called for the completion if get_if_info for a configure stateless command.

This callback is the end of the sequence. The IP address list is searched for the assigned IP address.

Parameters
halHardware context.
statusStatus from the MQE
ctxpointer to the command context
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 3432 of file ocs_hal.c.

static int32_t ocs_hal_tsol_process ( ocs_hal_t *  hal,
sli4_qentry_fields_tsol_t *  tsol 
)
static

Process an solicited target IO completion.

Parameters
halHardware context.
tsolpointer T_SOL CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1020 of file ocs_hal.c.

static int32_t ocs_hal_tx_dif_error_process ( ocs_hal_t *  hal,
sli4_qentry_fields_tx_dif_error_t *  dif_err 
)
static

Process an transmit DIF error completion entry.

Parameters
halHardware context.
dif_errPointer TX_DIF_ERR CQE fields.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 1291 of file ocs_hal.c.

static sli4_queue_t * ocs_hal_wq_find ( ocs_hal_t *  hal,
uint16_t  wq_id 
)
static

Find the WQ structure given the CQ_ID.

Parameters
halHardware context.
wq_idWQ ID to find.
Returns
Returns the Pointer to the queue object, or NULL otherwise.

Definition at line 670 of file ocs_hal.c.

static int32_t ocs_scsi_async_cb ( ocs_hal_t *  hal,
int32_t  status,
ocs_command_ctx_t *  ctx 
)
static

Check pending error asynchronous callback function.

Description
Invoke the HAL callback function for a given IO. This function is called from the NOP mailbox completion context.
Parameters
halPointer to HAL object.
statusCompletion status.
ctxPointer to command context.
Returns
0

Definition at line 7489 of file ocs_hal.c.

uint32_t tcmd_thread_id ( void  )

Definition at line 7209 of file ocs_hal.c.

Variable Details

ocs_hal_skyhawk_linkcfg_map_t skyhawk_linkcfg_map[]
static
Initial value:

Mapping from the HAL linkcfg enum to the Skyhawk link config IDs.

Definition at line 6530 of file ocs_hal.c.