45 #if defined(OCS_INCLUDE_DEBUG)
48 #define ocs_queue_history_wq(...)
49 #define ocs_queue_history_cqe(...)
50 #define ocs_queue_history_init(...)
51 #define ocs_queue_history_free(...)
70 #define OCS_HAL_TIMECHECK_ITERATIONS 100
71 #define OCS_HAL_MAX_NUM_EQ 3
72 #define OCS_HAL_MAX_NUM_RQ 4
74 #define OCS_DEFAULT_SGL_COUNT 64
201 typedef struct ocs_hal_dif_info_s {
206 uint32_t app_tag_cmp:16,
208 uint32_t check_ref_tag:1,
220 disable_app_ref_ffff:1,
261 uint8_t ip_address[16];
269 uint8_t ip_address[16];
298 #define OCS_HAL_MAX_PROFILES 40
305 char profile_description[512];
321 typedef struct ocs_hal_target_login_options_s {
323 uint8_t data_digest:1;
324 uint8_t hdr_digest:1;
360 typedef struct ocs_command_ctx_s {
373 int32_t (*cb)(
struct ocs_hal_s *, int32_t,
struct ocs_command_ctx_s *);
398 typedef struct ocs_hal_sgl_s {
410 #define HAL_BHS_ALLOC_SIZE 322
416 typedef struct ocs_ini_cmpl_fields_s {
432 typedef int32_t
io_cb_t (
struct ocs_hal_io_s *io,
451 typedef struct ocs_hal_sgl_info_s {
462 struct ocs_hal_io_s *
io;
471 typedef struct ocs_hal_io_s {
501 typedef union ocs_hal_io_param_u {
694 typedef struct ocs_hal_rq_buffer_s {
724 typedef struct ocs_hal_s {
786 int32_t (*link)(
void *, uint8_t isLinkUp);
793 int32_t (*bounce)(void (*)(
void *arg),
void *arg, uint32_t cpu);
832 #if defined(OCS_DEBUG_QUEUE_HISTORY)
833 ocs_hal_q_hist_t q_hist;
908 void *packet, uint32_t pkt_len,
947 uint32_t tcp_window_size,
950 uint32_t max_rcv_dsl,
int ocs_hal_fw_valid(ocs_hal_t *hal)
Check that firmware version meets minimum requirements.
ocs_hal_rq_buffer_t * rq_buf
sli4_wqe_context_t * wq_ctx
ocs_hal_ip_type_e ip_type
Structure to track RQ buffers submitted to the chip.
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.
SGL information structure.
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.
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.
ocs_list_t io_ini_read_quarantine
ocs_list_t ocs_list_link_t
int32_t ocs_hal_get_active_profile(ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
Get the currently active profile.
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.
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.
ocs_hal_sgl_info_t * sgl_info
ocs_hal_rtn_e ocs_hal_init(ocs_hal_t *hal)
Set up Hardware Abstraction Layer module.
ocs_hal_property_e
enum identifying the HAL properties.
ocs_hal_rtn_e ocs_hal_command_queue(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
ocs_hal_portal_event_e
enum identifying the port event types.
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.
ocs_list_t io_tgt_write_quarantine
ocs_dma_t non_emdedded_mem
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.
T10 DIF information passed to the transport.
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.
int32_t ocs_hal_get_num_eq(ocs_hal_t *hal)
int32_t ocs_hal_get_linkcfg(ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
Get the current link configuration.
ocs_hal_rtn_e ocs_hal_teardown(ocs_hal_t *hal)
Tear down Hardware Abstraction Layer module.
ocs_cxn_t * ocs_hal_cxn_alloc(ocs_hal_t *hal, uint32_t conn_hdl)
Gets a free connection structure.
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).
structure wrapping an IP address and subnet together with their type.
Structure to hold the fields returned on a target data digest error event.
#define OCS_HAL_MAX_NUM_RQ
ocs_command_ctx_t * ocs_hal_command_get_ctx(ocs_hal_t *hal)
Issue a SLI command.
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.
ocs_hal_ip_type_e
enum identifying the types of IP addresses.
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.
ocs_hal_target_login_options_t lgn_options
ocs_hal_dhcp_state_t dhcp_state
ocs_hal_rq_buffer_type_e
Defines the type of RQ buffer.
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.
ocs_hal_rtn_e ocs_hal_io_add_seed_sge(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_dif_info_t *dif_info)
Add a T10 PI seed scatter gather list entry.
ocs_hal_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.
ocs_hal_rtn_e
defines common HAL return statuses.
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.
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.
ocs_hal_abort_type_e
HAL abort types.
ocs_hal_rtn_e ocs_hal_command_bootstrap(ocs_hal_t *hal, uint8_t *cmd)
Issue a SLI command to the bootstrap mailbox.
ocs_hal_reset_e
defines the types of resets.
#define OCS_HAL_MAX_NUM_EQ
Structure to define what connection event occurred and it's parameters.
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.
void ocs_hal_cxn_req_invalidate(ocs_list_t *list_cxn)
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.
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.
Structure to hold the fields returned on a new connection event.
defines the parameters for an IO based on the IO type.
uint32_t ocs_hal_portal_t
ocs_hal_async_cb_t async_cb
void ocs_hal_command_free_ctx(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
ocs_hal_port_protocol_e
Port protocols.
defines the HAL scatter gather list element.
uint32_t io_tgt_write_quarantine_cnt
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.
ocs_hal_callback_e
enum identifying the types of callbacks that can be registered.
ocs_hal_io_t * ocs_hal_io_alloc(ocs_hal_t *hal)
Allocate a HAL IO object.
ocs_hal_io_type_e
enum identifying IO types.
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.
int32_t(* ocs_hal_async_cb_t)(struct ocs_hal_s *hal, int32_t status, void *arg)
ocs_hal_rtn_e ocs_hal_reset(ocs_hal_t *hal, ocs_hal_reset_e reset)
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.
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.
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.
uint8_t piggy_back_status
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.
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.
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.
ocs_hal_linkcfg_e
Link configurations.
ocs_hal_rtn_e ocs_hal_io_add_dif_sge(ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr)
Add a T10 DIF scatter gather list entry to an IO.
ocs_hal_rtn_e ocs_hal_get(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t *value)
ocs_hal_cxn_new_t cxn_new
ocs_hal_rtn_e ocs_hal_set_ptr(ocs_hal_t *hal, ocs_hal_property_e prop, void *value)
ocs_hal_ip_type_e ip_type
uint8_t use_v1_multi_protocol
Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue...
This structure is used to track the WQEs for iSCSI.
ocs_dma_t dataout_tmpl_mem
int32_t ocs_hal_event_check(ocs_hal_t *hal, uint32_t vector)
Check for events associated with the interrupt vector.
Used for returning IP information in return from ocs_hal_portal_ip_get()
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.
ocs_hal_rtn_e ocs_hal_cxn_free(ocs_hal_t *hal, ocs_cxn_t *cxn)
Frees a connection object for re-use.
Structure to track RQ buffers submitted to the chip.
ocs_hal_dif_blk_size_e
T10 DIF block sizes.
uint8_t is_hal_initialized
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.
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.
ocs_hal_abort_scope_e
HAL abort types.
ocs_hal_rtn_e ocs_hal_set(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t value)
void ocs_hal_io_free(ocs_hal_t *hal, ocs_hal_io_t *io)
Free a previously allocated HAL IO object.
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.
ocs_hal_dif_oper_e dif_oper
This structure is used to track the SLI4 queues.
ocs_hal_cxn_event_e
enum identifying the connection event types.
ocs_hal_rtn_e ocs_hal_domain_free(ocs_hal_t *hal, ocs_domain_t *domain)
Free a domain object.
structure wrapping an IP address together with it's type.
void cxn_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
connection callback function prototype.
ocs_hal_dif_info_t * dif_info
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.
defines a structure to contain the fields specific to an initiator IO completion. ...
ocs_hal_workaround_t workaround
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.
ocs_hal_port_e
enum identifying the port operations.
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.
void(* ocs_hal_fw_cb_t)(int32_t status, uint32_t bytes_written, void *arg)
uint32_t tcmd_thread_id(void)
Structure to hold the fields returned on a connection invalidation event.
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.
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.
ocs_hal_unsol_cb_t unsolicited
int32_t ocs_hal_async_call(ocs_hal_t *hal, ocs_hal_async_cb_t callback, void *arg)
Make an async callback using NOP mailbox command.
ocs_hal_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.
ocs_hal_cxn_event_e event
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.
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.
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.
ocs_hal_dif_oper_e
T10 DIF operations.
void portal_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
Portal callback function prototype.
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.
void * ocs_hal_get_ptr(ocs_hal_t *hal, ocs_hal_property_e prop)
ocs_hal_cxn_invalid_t cxn_invalid
void mgmt_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
management callback function prototype.
ocs_hal_dif_blk_size_e blk_size
uint32_t io_ini_read_quarantine_cnt
ocs_atomic_t io_alloc_failed_count
ocs_hal_dhcp_state_t
enum identifying the DHCP states.
ocs_hal_rq_buffer_t * rq_buf
ocs_hal_tgt_data_digest_t tgt_digest
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.
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.
ocs_session_login_options_t session_options
ocs_hal_rtn_e ocs_hal_firmware_write(ocs_hal_t *hal, ocs_dma_t *dma, uint32_t size, uint32_t offset, int last, ocs_hal_fw_cb_t cb, void *arg)
Write a portion of a firmware image to the device.
ocs_hal_rtn_e ocs_hal_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.
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.
ocs_hal_portal_t ocs_hal_portal_get_default(ocs_hal_t *hal)
Return the default portal.
void ocs_tgt_cxn_invalidate(ocs_cxn_t *cxn)
#define OCS_HAL_MAX_PROFILES
ocs_sgl_type_e
defines the types of SGL lists.