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

Go to the source code of this file.

Detailed Description

Define the Hardware Abstraction Layer (HAL) interface functions

Definition in file ocs_hal.h.

Data Structures

struct  ocs_hal_dif_info_t
 T10 DIF information passed to the transport. More...
 
struct  ocs_hal_ip_address_t
 structure wrapping an IP address together with it's type. More...
 
struct  ocs_hal_ip_address_subnet_t
 structure wrapping an IP address and subnet together with their type. More...
 
struct  ocs_hal_get_ip_t
 Used for returning IP information in return from ocs_hal_portal_ip_get() More...
 
struct  ocs_hal_profile_descriptor_t
 A Profile Descriptor. More...
 
struct  ocs_hal_profile_list_t
 A Profile List. More...
 
struct  ocs_hal_target_login_options_t
 TARGET_LOGIN_OPTIONS. More...
 
struct  ocs_command_ctx_t
 HAL command context. More...
 
struct  ocs_hal_sgl_t
 defines the HAL scatter gather list element. More...
 
struct  ocs_ini_cmpl_fields_t
 defines a structure to contain the fields specific to an initiator IO completion. More...
 
struct  ocs_hal_sgl_info_t
 SGL information structure. More...
 
struct  ocs_hal_io_t
 HAL IO object. More...
 
union  ocs_hal_io_param_t
 defines the parameters for an IO based on the IO type. More...
 
struct  ocs_hal_tgt_data_digest_t
 Structure to hold the fields returned on a target data digest error event. More...
 
struct  ocs_hal_cxn_invalid_t
 Structure to hold the fields returned on a connection invalidation event. More...
 
struct  ocs_hal_cxn_new_t
 Structure to hold the fields returned on a new connection event. More...
 
struct  ocs_hal_cxn_event_t
 Structure to define what connection event occurred and it's parameters. More...
 
struct  ocs_hal_rq_buffer_t
 Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue. More...
 
struct  ocs_hal_rq_lookup_t
 Structure to track RQ buffers submitted to the chip. More...
 
struct  ocs_hal_rq_list_t
 Structure to track RQ buffers submitted to the chip. More...
 
struct  ocs_hal_t
 HAL object. More...
 

Macros

#define ocs_queue_history_wq(...)
 
#define ocs_queue_history_cqe(...)
 
#define ocs_queue_history_init(...)
 
#define ocs_queue_history_free(...)
 
#define OCS_HAL_TIMECHECK_ITERATIONS   100
 
#define OCS_HAL_MAX_NUM_EQ   3
 
#define OCS_HAL_MAX_NUM_RQ   4
 
#define OCS_DEFAULT_SGL_COUNT   64
 
#define OCS_HAL_MAX_PROFILES   40
 
#define HAL_BHS_ALLOC_SIZE   322
 

Typedefs

typedef void portal_cb_t (void *ul_arg, int32_t status, uint32_t ext_status, void *params)
 Portal callback function prototype. More...
 
typedef void cxn_cb_t (void *ul_arg, int32_t status, uint32_t ext_status, void *params)
 connection callback function prototype. More...
 
typedef void mgmt_cb_t (void *ul_arg, int32_t status, uint32_t ext_status, void *params)
 management callback function prototype. More...
 
typedef int32_t(* ocs_hal_async_cb_t )(struct ocs_hal_s *hal, int32_t status, void *arg)
 
typedef int32_t io_cb_t (struct ocs_hal_io_s *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
 IO Completion function prototype. More...
 
typedef int32_t(* ocs_hal_unsol_cb_t )(void *, ocs_cxn_t *, ocs_hal_rq_buffer_t *, uint32_t, ocs_hal_rq_buffer_t *, uint32_t, uint8_t)
 HAL unsolicited callback. More...
 
typedef void(* ocs_hal_fw_cb_t )(int32_t status, uint32_t bytes_written, void *arg)
 

Enumerations

enum  ocs_hal_rtn_e { OCS_HAL_RTN_SUCCESS = 0, OCS_HAL_RTN_ERROR = -1, OCS_HAL_RTN_NO_RESOURCES = -2, OCS_HAL_RTN_NO_MEMORY = -3 }
 defines common HAL return statuses. More...
 
enum  ocs_hal_reset_e { OCS_HAL_RESET_FUNCTION, OCS_HAL_RESET_FIRMWARE, OCS_HAL_RESET_MAX }
 defines the types of resets. More...
 
enum  ocs_hal_property_e {
  OCS_HAL_N_IO, OCS_HAL_N_CXNS, OCS_HAL_RQ_QUEUE_SIZE, OCS_HAL_RQ_PAYLOAD_SIZE,
  OCS_HAL_MAX_IO, OCS_HAL_MAX_SGE, OCS_HAL_MAC_ADDR, OCS_HAL_FW_REV,
  OCS_HAL_FW_REV2, OCS_HAL_IPL, OCS_HAL_VPD, OCS_HAL_VPD_LEN,
  OCS_HAL_LINK_SPEED, OCS_HAL_IF_TYPE, OCS_HAL_SLI_REV, OCS_HAL_SLI_FAMILY,
  OCS_HAL_SGL_CHAINING_CAPABLE, OCS_HAL_SGL_CHAINING_ENABLE, OCS_HAL_DIF_CAPABLE, OCS_HAL_DIF_MODE,
  OCS_HAL_NUM_SGES_PER_ICD, OCS_HAL_POST_SGL_VERSION, OCS_HAL_PCI_FUNCTION, OCS_HAL_SFP_A0,
  OCS_HAL_SFP_A2, OCS_HAL_HW_REV1, OCS_HAL_HW_REV2, OCS_HAL_HW_REV3,
  OCS_HAL_NUM_CHUTES, OCS_HAL_WAR_VERSION, OCS_HAL_SEND_FRAME_CAPABLE
}
 enum identifying the HAL properties. More...
 
enum  { OCS_HAL_MODE_INITIATOR, OCS_HAL_MODE_TARGET, OCS_HAL_MODE_BOTH, OCS_HAL_MODE_MAX }
 
enum  ocs_hal_port_protocol_e {
  OCS_HAL_PORT_PROTOCOL_ISCSI, OCS_HAL_PORT_PROTOCOL_FCOE, OCS_HAL_PORT_PROTOCOL_FC, OCS_HAL_PORT_PROTOCOL_OTHER,
  OCS_HAL_PORT_PROTOCOL_UNKNOWN
}
 Port protocols. More...
 
enum  { OCS_HAL_DIF_MODE_INLINE, OCS_HAL_DIF_MODE_SEPARATE }
 Defines DIF operation modes. More...
 
enum  ocs_hal_dif_oper_e { OCS_HAL_DIF_OPER_DISABLED, OCS_HAL_DIF_OPER_PASS_THRU, OCS_HAL_DIF_OPER_STRIP, OCS_HAL_DIF_OPER_INSERT }
 T10 DIF operations. More...
 
enum  ocs_hal_dif_blk_size_e {
  OCS_HAL_DIF_BK_SIZE_512, OCS_HAL_DIF_BK_SIZE_1024, OCS_HAL_DIF_BK_SIZE_2048, OCS_HAL_DIF_BK_SIZE_4096,
  OCS_HAL_DIF_BK_SIZE_520, OCS_HAL_DIF_BK_SIZE_4104, OCS_HAL_DIF_BK_SIZE_NA = 0
}
 T10 DIF block sizes. More...
 
enum  ocs_hal_linkcfg_e {
  OCS_HAL_LINKCFG_4X10G = 0, OCS_HAL_LINKCFG_1X40G, OCS_HAL_LINKCFG_2X16G, OCS_HAL_LINKCFG_4X8G,
  OCS_HAL_LINKCFG_4X1G, OCS_HAL_LINKCFG_2X10G, OCS_HAL_LINKCFG_2X10G_2X8G, OCS_HAL_LINKCFG_NA
}
 Link configurations. More...
 
enum  ocs_hal_io_type_e {
  OCS_HAL_IO_INITIATOR_NODATA, OCS_HAL_IO_INITIATOR_READ, OCS_HAL_IO_INITIATOR_WRITE, OCS_HAL_IO_INITIATOR_TMF,
  OCS_HAL_IO_INITIATOR_NOP, OCS_HAL_IO_TARGET_READ, OCS_HAL_IO_TARGET_WRITE, OCS_HAL_IO_TARGET_RSP,
  OCS_HAL_IO_UNASSISTED, OCS_HAL_IO_CONTEXT_UPDATE, OCS_HAL_IO_MAX
}
 enum identifying IO types. More...
 
enum  ocs_hal_ip_type_e {
  OCS_HAL_IP_TYPE_V4 = 1, OCS_HAL_IP_TYPE_DHCP_V4, OCS_HAL_IP_TYPE_V6, OCS_HAL_IP_TYPE_AUTO_V6,
  OCS_HAL_IP_TYPE_ROUTABLE_V6, OCS_HAL_IP_TYPE_LINK_LOCAL_V6
}
 enum identifying the types of IP addresses. More...
 
enum  ocs_hal_dhcp_state_t {
  ocs_HAL_DHCP_STATE_IN_PROGRESS =1, ocs_HAL_DHCP_STATE_INITIALIZATION, ocs_HAL_DHCP_STATE_SELECTING, ocs_HAL_DHCP_STATE_BOUND,
  ocs_HAL_DHCP_STATE_REQUESTING, ocs_HAL_DHCP_STATE_RENEW, ocs_HAL_DHCP_STATE_REBIND
}
 enum identifying the DHCP states. More...
 
enum  ocs_sgl_type_e { OCS_HAL_SGL_NORMAL, OCS_HAL_SGL_CHAINED }
 defines the types of SGL lists. More...
 
enum  ocs_hal_port_e { OCS_HAL_PORT_INIT, OCS_HAL_PORT_SHUTDOWN }
 enum identifying the port operations. More...
 
enum  ocs_hal_portal_event_e {
  OCS_HAL_PORTAL_CREATED, OCS_HAL_PORTAL_DELETED, OCS_HAL_PORTAL_IP_ADDED, OCS_HAL_PORTAL_IP_REMOVED,
  OCS_HAL_PORTAL_LISTENING_STARTED, OCS_HAL_PORTAL_LISTENING_STOPPED, OCS_HAL_PORTAL_ISNS_DISCOVERY_COMPLETE, OCS_HAL_PORTAL_ISNS_SEND_COMPLETE
}
 enum identifying the port event types. More...
 
enum  ocs_hal_cxn_event_e { OCS_HAL_CXN_NEW, OCS_HAL_CXN_INVALID, OCS_HAL_CXN_TGT_DATA_DIGEST, OCS_HAL_CXN_MAX }
 enum identifying the connection event types. More...
 
enum  ocs_hal_callback_e {
  OCS_HAL_CB_LINK, OCS_HAL_CB_CXN, OCS_HAL_CB_UNSOLICITED, OCS_HAL_CB_BOUNCE,
  OCS_HAL_CB_MAX
}
 enum identifying the types of callbacks that can be registered. More...
 
enum  ocs_hal_abort_scope_e {
  OCS_HAL_IO_ABORT_SCOPE_IO, OCS_HAL_IO_ABORT_SCOPE_NODE, OCS_HAL_IO_ABORT_SCOPE_PORT, OCS_HAL_IO_ABORT_SCOPE_DOMAIN,
  OCS_HAL_IO_ABORT_SCOPE_MAX
}
 HAL abort types. More...
 
enum  ocs_hal_abort_type_e { OCS_HAL_IO_ABORT_TYPE_TMF, OCS_HAL_IO_ABORT_TYPE_TCP_CLOSED, OCS_HAL_IO_ABORT_TYPE_MAX }
 HAL abort types. More...
 
enum  ocs_hal_rq_buffer_type_e { OCS_HAL_RQ_BUFFER_TYPE_HDR, OCS_HAL_RQ_BUFFER_TYPE_DATA, OCS_HAL_RQ_BUFFER_TYPE_MAX }
 Defines the type of RQ buffer. More...
 

Functions

ocs_hal_rtn_e ocs_hal_setup (ocs_hal_t *, ocs_os_handle_t, sli4_port_type_e)
 Set up the Hardware Abstraction Layer module. More...
 
ocs_hal_rtn_e ocs_hal_get (ocs_hal_t *, ocs_hal_property_e, uint32_t *)
 
void * ocs_hal_get_ptr (ocs_hal_t *, ocs_hal_property_e)
 
ocs_hal_rtn_e ocs_hal_set (ocs_hal_t *, ocs_hal_property_e, uint32_t)
 
ocs_hal_rtn_e ocs_hal_set_ptr (ocs_hal_t *, ocs_hal_property_e, void *)
 
ocs_hal_rtn_e ocs_hal_callback (ocs_hal_t *, ocs_hal_callback_e, void *, void *)
 register a callback for the given event. More...
 
ocs_hal_rtn_e ocs_hal_init (ocs_hal_t *)
 Set up Hardware Abstraction Layer module. More...
 
ocs_hal_rtn_e ocs_hal_teardown (ocs_hal_t *)
 Tear down Hardware Abstraction Layer module. More...
 
ocs_hal_rtn_e ocs_hal_reset (ocs_hal_t *, ocs_hal_reset_e)
 
int32_t ocs_hal_get_num_eq (ocs_hal_t *)
 
void ocs_hal_cxn_req_invalidate (ocs_list_t *list_cxn)
 
void ocs_tgt_cxn_invalidate (ocs_cxn_t *cxn)
 
ocs_hal_rtn_e ocs_hal_domain_add (ocs_hal_t *, ocs_sli_port_t *, ocs_domain_t *)
 Adds a domain object. More...
 
ocs_hal_rtn_e ocs_hal_domain_free (ocs_hal_t *, ocs_domain_t *)
 Free a domain object. 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...
 
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...
 
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...
 
ocs_hal_rtn_e ocs_hal_portal_set_mac (ocs_hal_t *, uint8_t *mac_address, portal_cb_t, void *ul_arg)
 Set the MAC address on the portal. More...
 
ocs_hal_rtn_e ocs_hal_portal_set_mtu (ocs_hal_t *, uint8_t is_jumbo, portal_cb_t, void *ul_arg)
 Enable Jumbo frame support on the portal. More...
 
ocs_hal_portal_t ocs_hal_portal_get_default (ocs_hal_t *)
 Return the default portal. More...
 
ocs_hal_rtn_e ocs_hal_portal_create (ocs_hal_t *, unsigned int vlan_tag, portal_cb_t, void *ul_arg)
 Create a new VLAN interface handle. More...
 
ocs_hal_rtn_e ocs_hal_portal_delete (ocs_hal_t *, ocs_hal_portal_t, portal_cb_t, void *ul_arg)
 Delete a VLAN interface handle. More...
 
ocs_hal_rtn_e ocs_hal_portal_ip_add (ocs_hal_t *, ocs_hal_portal_t, ocs_hal_ip_address_subnet_t *, portal_cb_t, void *ul_arg)
 Add an IP address to an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_ip_remove (ocs_hal_t *, ocs_hal_portal_t, ocs_hal_ip_address_subnet_t *, portal_cb_t, void *ul_arg)
 Removes an IP address from an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_ip_get (ocs_hal_t *, ocs_hal_portal_t, ocs_hal_ip_type_e ip_type, portal_cb_t, void *ul_arg)
 Retrieves the IP addresses on an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_gateway_get (ocs_hal_t *, ocs_hal_ip_type_e, portal_cb_t, void *ul_arg)
 Retrieves the default gateway on an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_gateway_add (ocs_hal_t *, ocs_hal_ip_address_t *, portal_cb_t, void *ul_arg)
 adds the default gateway on an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_gateway_remove (ocs_hal_t *, ocs_hal_ip_address_t *, portal_cb_t, void *ul_arg)
 removes a default gateway on an interface. More...
 
ocs_hal_rtn_e ocs_hal_portal_listen_start (ocs_hal_t *, ocs_hal_ip_address_t *, uint32_t tcp_port, portal_cb_t, void *ul_arg)
 Starts listening on a TCP port. More...
 
ocs_hal_rtn_e ocs_hal_portal_listen_stop (ocs_hal_t *, ocs_hal_ip_address_t *, uint32_t tcp_port, portal_cb_t, void *ul_arg)
 Stops listening on a TCP port. More...
 
ocs_hal_rtn_e ocs_hal_portal_isns_discover (ocs_hal_t *, ocs_hal_portal_t, portal_cb_t, void *ul_arg)
 Discovers iSNS servers via DHCP. More...
 
ocs_hal_rtn_e ocs_hal_portal_isns_send_packet (ocs_hal_t *, ocs_hal_ip_address_t *, uint32_t tcp_port, void *packet, uint32_t pkt_len, portal_cb_t, 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 *, ocs_hal_ip_address_t *, uint32_t tcp_port, portal_cb_t, 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 *, ocs_hal_ip_address_t *, uint32_t tcp_port, portal_cb_t, void *ul_arg)
 Stops listening on an iSNS ESI TCP port. More...
 
int32_t ocs_hal_event_check (ocs_hal_t *, uint32_t)
 Check for events associated with the interrupt vector. More...
 
int32_t ocs_hal_process (ocs_hal_t *, uint32_t, uint32_t)
 Process events associated with the interrupt vector. More...
 
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_firmware_write (ocs_hal_t *, ocs_dma_t *, uint32_t, uint32_t, int, ocs_hal_fw_cb_t, void *)
 Write a portion of a firmware image to the device. More...
 
ocs_hal_rtn_e ocs_hal_get_active_profile (ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void *ul_arg)
 Get the currently active profile. More...
 
ocs_hal_rtn_e ocs_hal_set_active_profile (ocs_hal_t *hal, mgmt_cb_t mgmt_cb, uint32_t profile_id, void *ul_arg)
 Set the currently active profile. 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...
 
ocs_hal_rtn_e ocs_hal_get_port_protocol (ocs_hal_t *hal, uint32_t pci_func, mgmt_cb_t mgmt_cb, void *ul_arg)
 Get the current port protocol. More...
 
ocs_hal_rtn_e ocs_hal_set_port_protocol (ocs_hal_t *hal, uint32_t pci_func, ocs_hal_port_protocol_e profile, mgmt_cb_t mgmt_cb, void *ul_arg)
 Set the port protocol. More...
 
ocs_hal_rtn_e ocs_hal_set_linkcfg (ocs_hal_t *hal, mgmt_cb_t mgmt_cb, uint32_t config_id, void *ul_arg)
 
ocs_hal_rtn_e ocs_hal_get_linkcfg (ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void *ul_arg)
 Get the current link configuration. More...
 
ocs_hal_rtn_e ocs_hal_rxbuffer (ocs_hal_t *, ocs_hal_rq_buffer_t *hdr, ocs_hal_rq_buffer_t *data)
 Add a receive buffer pair to the Receive Queue. More...
 
ocs_cxn_t * ocs_hal_cxn_alloc (ocs_hal_t *, uint32_t conn_hdl)
 Gets a free connection structure. More...
 
ocs_hal_rtn_e ocs_hal_cxn_connect (ocs_hal_t *, ocs_cxn_t *, ocs_hal_ip_address_t *, uint32_t tcp_port, uint16_t window_size, uint8_t window_scale, cxn_cb_t, void *ul_arg)
 Establish a TCP connection from an initiator to a target. 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...
 
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...
 
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 *, ocs_cxn_t *)
 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 *, ocs_cxn_t *, uint8_t invalidate, cxn_cb_t, 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 *, ocs_cxn_t *)
 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...
 
void ocs_hal_io_free (ocs_hal_t *, ocs_hal_io_t *)
 Free a previously allocated HAL IO object. More...
 
ocs_hal_rtn_e ocs_hal_io_send (ocs_hal_t *, ocs_hal_io_type_e, ocs_hal_io_t *, uint32_t, ocs_hal_io_param_t *, ocs_cxn_t *, io_cb_t, void *)
 Send a read, write, or response IO. More...
 
ocs_hal_rtn_e ocs_hal_io_init_sges (ocs_hal_t *, ocs_hal_io_t *, ocs_hal_io_type_e, uint32_t)
 Initialize the Scatter Gather List entries of an IO. More...
 
ocs_hal_rtn_e ocs_hal_io_add_sge (ocs_hal_t *, ocs_hal_io_t *, uintptr_t, uint32_t)
 Add a Scatter Gather list Entry to an IO. More...
 
ocs_hal_rtn_e ocs_hal_io_add_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...
 
ocs_hal_rtn_e ocs_hal_io_abort (ocs_hal_t *, ocs_hal_io_t *, ocs_hal_abort_scope_e, ocs_hal_abort_type_e)
 Abort a currently running IO. 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)
 
int ocs_hal_fw_valid (ocs_hal_t *hal)
 Check that firmware version meets minimum requirements. 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...
 

Macro Details

#define HAL_BHS_ALLOC_SIZE   322

Definition at line 410 of file ocs_hal.h.

#define OCS_DEFAULT_SGL_COUNT   64

Definition at line 74 of file ocs_hal.h.

#define OCS_HAL_MAX_NUM_EQ   3

Definition at line 71 of file ocs_hal.h.

#define OCS_HAL_MAX_NUM_RQ   4

Definition at line 72 of file ocs_hal.h.

#define OCS_HAL_MAX_PROFILES   40

Definition at line 298 of file ocs_hal.h.

#define OCS_HAL_TIMECHECK_ITERATIONS   100

Definition at line 70 of file ocs_hal.h.

#define ocs_queue_history_cqe (   ...)

Definition at line 49 of file ocs_hal.h.

#define ocs_queue_history_free (   ...)

Definition at line 51 of file ocs_hal.h.

#define ocs_queue_history_init (   ...)

Definition at line 50 of file ocs_hal.h.

#define ocs_queue_history_wq (   ...)

Definition at line 48 of file ocs_hal.h.

Type Details

typedef void cxn_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)

connection callback function prototype.

Definition at line 340 of file ocs_hal.h.

typedef int32_t io_cb_t(struct ocs_hal_io_s *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)

IO Completion function prototype.

Definition at line 432 of file ocs_hal.h.

typedef void mgmt_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)

management callback function prototype.

Definition at line 348 of file ocs_hal.h.

typedef int32_t(* ocs_hal_async_cb_t)(struct ocs_hal_s *hal, int32_t status, void *arg)

Definition at line 353 of file ocs_hal.h.

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

Definition at line 926 of file ocs_hal.h.

typedef int32_t(* ocs_hal_unsol_cb_t)(void *, ocs_cxn_t *, ocs_hal_rq_buffer_t *, uint32_t, ocs_hal_rq_buffer_t *, uint32_t, uint8_t)

HAL unsolicited callback.

Definition at line 719 of file ocs_hal.h.

typedef void portal_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)

Portal callback function prototype.

Definition at line 332 of file ocs_hal.h.

Enumeration Details

anonymous enum
Enumerator
OCS_HAL_MODE_INITIATOR 
OCS_HAL_MODE_TARGET 
OCS_HAL_MODE_BOTH 
OCS_HAL_MODE_MAX 

Definition at line 131 of file ocs_hal.h.

anonymous enum

Defines DIF operation modes.

Enumerator
OCS_HAL_DIF_MODE_INLINE 
OCS_HAL_DIF_MODE_SEPARATE 

Definition at line 153 of file ocs_hal.h.

HAL abort types.

Enumerator
OCS_HAL_IO_ABORT_SCOPE_IO 
OCS_HAL_IO_ABORT_SCOPE_NODE 
OCS_HAL_IO_ABORT_SCOPE_PORT 
OCS_HAL_IO_ABORT_SCOPE_DOMAIN 
OCS_HAL_IO_ABORT_SCOPE_MAX 

must be last

Definition at line 664 of file ocs_hal.h.

HAL abort types.

Enumerator
OCS_HAL_IO_ABORT_TYPE_TMF 
OCS_HAL_IO_ABORT_TYPE_TCP_CLOSED 
OCS_HAL_IO_ABORT_TYPE_MAX 

must be last

Definition at line 675 of file ocs_hal.h.

enum identifying the types of callbacks that can be registered.

Enumerator
OCS_HAL_CB_LINK 
OCS_HAL_CB_CXN 
OCS_HAL_CB_UNSOLICITED 
OCS_HAL_CB_BOUNCE 
OCS_HAL_CB_MAX 

must be last

Definition at line 653 of file ocs_hal.h.

enum identifying the connection event types.

Enumerator
OCS_HAL_CXN_NEW 
OCS_HAL_CXN_INVALID 
OCS_HAL_CXN_TGT_DATA_DIGEST 
OCS_HAL_CXN_MAX 

must be last

Definition at line 594 of file ocs_hal.h.

enum identifying the DHCP states.

Enumerator
ocs_HAL_DHCP_STATE_IN_PROGRESS 
ocs_HAL_DHCP_STATE_INITIALIZATION 
ocs_HAL_DHCP_STATE_SELECTING 
ocs_HAL_DHCP_STATE_BOUND 
ocs_HAL_DHCP_STATE_REQUESTING 
ocs_HAL_DHCP_STATE_RENEW 
ocs_HAL_DHCP_STATE_REBIND 

Definition at line 276 of file ocs_hal.h.

T10 DIF block sizes.

Enumerator
OCS_HAL_DIF_BK_SIZE_512 
OCS_HAL_DIF_BK_SIZE_1024 
OCS_HAL_DIF_BK_SIZE_2048 
OCS_HAL_DIF_BK_SIZE_4096 
OCS_HAL_DIF_BK_SIZE_520 
OCS_HAL_DIF_BK_SIZE_4104 
OCS_HAL_DIF_BK_SIZE_NA 

Definition at line 171 of file ocs_hal.h.

T10 DIF operations.

Enumerator
OCS_HAL_DIF_OPER_DISABLED 
OCS_HAL_DIF_OPER_PASS_THRU 
OCS_HAL_DIF_OPER_STRIP 
OCS_HAL_DIF_OPER_INSERT 

Definition at line 161 of file ocs_hal.h.

enum identifying IO types.

Enumerator
OCS_HAL_IO_INITIATOR_NODATA 
OCS_HAL_IO_INITIATOR_READ 
OCS_HAL_IO_INITIATOR_WRITE 
OCS_HAL_IO_INITIATOR_TMF 
OCS_HAL_IO_INITIATOR_NOP 
OCS_HAL_IO_TARGET_READ 
OCS_HAL_IO_TARGET_WRITE 
OCS_HAL_IO_TARGET_RSP 
OCS_HAL_IO_UNASSISTED 
OCS_HAL_IO_CONTEXT_UPDATE 
OCS_HAL_IO_MAX 

Definition at line 227 of file ocs_hal.h.

enum identifying the types of IP addresses.

Enumerator
OCS_HAL_IP_TYPE_V4 
OCS_HAL_IP_TYPE_DHCP_V4 
OCS_HAL_IP_TYPE_V6 
OCS_HAL_IP_TYPE_AUTO_V6 
OCS_HAL_IP_TYPE_ROUTABLE_V6 
OCS_HAL_IP_TYPE_LINK_LOCAL_V6 

Definition at line 244 of file ocs_hal.h.

Link configurations.

Enumerator
OCS_HAL_LINKCFG_4X10G 
OCS_HAL_LINKCFG_1X40G 
OCS_HAL_LINKCFG_2X16G 
OCS_HAL_LINKCFG_4X8G 
OCS_HAL_LINKCFG_4X1G 
OCS_HAL_LINKCFG_2X10G 
OCS_HAL_LINKCFG_2X10G_2X8G 
OCS_HAL_LINKCFG_NA 

Definition at line 184 of file ocs_hal.h.

enum identifying the port operations.

Enumerator
OCS_HAL_PORT_INIT 
OCS_HAL_PORT_SHUTDOWN 

Definition at line 572 of file ocs_hal.h.

Port protocols.

Enumerator
OCS_HAL_PORT_PROTOCOL_ISCSI 
OCS_HAL_PORT_PROTOCOL_FCOE 
OCS_HAL_PORT_PROTOCOL_FC 
OCS_HAL_PORT_PROTOCOL_OTHER 
OCS_HAL_PORT_PROTOCOL_UNKNOWN 

Definition at line 142 of file ocs_hal.h.

enum identifying the port event types.

Enumerator
OCS_HAL_PORTAL_CREATED 
OCS_HAL_PORTAL_DELETED 
OCS_HAL_PORTAL_IP_ADDED 
OCS_HAL_PORTAL_IP_REMOVED 
OCS_HAL_PORTAL_LISTENING_STARTED 
OCS_HAL_PORTAL_LISTENING_STOPPED 
OCS_HAL_PORTAL_ISNS_DISCOVERY_COMPLETE 
OCS_HAL_PORTAL_ISNS_SEND_COMPLETE 

Definition at line 580 of file ocs_hal.h.

enum identifying the HAL properties.

Enumerator
OCS_HAL_N_IO 
OCS_HAL_N_CXNS 
OCS_HAL_RQ_QUEUE_SIZE 
OCS_HAL_RQ_PAYLOAD_SIZE 
OCS_HAL_MAX_IO 
OCS_HAL_MAX_SGE 
OCS_HAL_MAC_ADDR 
OCS_HAL_FW_REV 
OCS_HAL_FW_REV2 
OCS_HAL_IPL 
OCS_HAL_VPD 
OCS_HAL_VPD_LEN 
OCS_HAL_LINK_SPEED 
OCS_HAL_IF_TYPE 
OCS_HAL_SLI_REV 
OCS_HAL_SLI_FAMILY 
OCS_HAL_SGL_CHAINING_CAPABLE 
OCS_HAL_SGL_CHAINING_ENABLE 
OCS_HAL_DIF_CAPABLE 
OCS_HAL_DIF_MODE 
OCS_HAL_NUM_SGES_PER_ICD 
OCS_HAL_POST_SGL_VERSION 
OCS_HAL_PCI_FUNCTION 
OCS_HAL_SFP_A0 
OCS_HAL_SFP_A2 
OCS_HAL_HW_REV1 
OCS_HAL_HW_REV2 
OCS_HAL_HW_REV3 
OCS_HAL_NUM_CHUTES 
OCS_HAL_WAR_VERSION 
OCS_HAL_SEND_FRAME_CAPABLE 

Definition at line 97 of file ocs_hal.h.

defines the types of resets.

Enumerator
OCS_HAL_RESET_FUNCTION 
OCS_HAL_RESET_FIRMWARE 
OCS_HAL_RESET_MAX 

Definition at line 88 of file ocs_hal.h.

Defines the type of RQ buffer.

Enumerator
OCS_HAL_RQ_BUFFER_TYPE_HDR 
OCS_HAL_RQ_BUFFER_TYPE_DATA 
OCS_HAL_RQ_BUFFER_TYPE_MAX 

Definition at line 684 of file ocs_hal.h.

defines common HAL return statuses.

Enumerator
OCS_HAL_RTN_SUCCESS 
OCS_HAL_RTN_ERROR 
OCS_HAL_RTN_NO_RESOURCES 
OCS_HAL_RTN_NO_MEMORY 

Definition at line 78 of file ocs_hal.h.

defines the types of SGL lists.

Enumerator
OCS_HAL_SGL_NORMAL 
OCS_HAL_SGL_CHAINED 

Definition at line 441 of file ocs_hal.h.

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.

void ocs_hal_cxn_req_invalidate ( ocs_list_t *  list_cxn)

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

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 *  ,
ocs_hal_property_e  ,
uint32_t *   
)

Definition at line 2666 of file ocs_hal.c.

int32_t ocs_hal_get_num_eq ( ocs_hal_t *  )

Definition at line 2660 of file ocs_hal.c.

void* ocs_hal_get_ptr ( ocs_hal_t *  ,
ocs_hal_property_e   
)

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

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.

ocs_hal_rtn_e ocs_hal_reset ( ocs_hal_t *  ,
ocs_hal_reset_e   
)

Definition at line 2558 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set ( ocs_hal_t *  ,
ocs_hal_property_e  ,
uint32_t   
)

Definition at line 2790 of file ocs_hal.c.

ocs_hal_rtn_e ocs_hal_set_linkcfg ( ocs_hal_t *  hal,
mgmt_cb_t  mgmt_cb,
uint32_t  config_id,
void *  ul_arg 
)
ocs_hal_rtn_e ocs_hal_set_ptr ( ocs_hal_t *  ,
ocs_hal_property_e  ,
void *   
)

Definition at line 2897 of file ocs_hal.c.

void ocs_tgt_cxn_invalidate ( ocs_cxn_t *  cxn)

Definition at line 1617 of file ocs_cxn.c.

uint32_t tcmd_thread_id ( void  )

Definition at line 7209 of file ocs_hal.c.