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

Go to the source code of this file.

Detailed Description

Functions to build and send ELS/CT/BLS commands and responses.

Definition in file ocs_els.c.

Macros

#define ELS_IOFMT   "[i:%04x t:%04x h:%04x]"
 
#define ELS_IOFMT_ARGS(els)   els->init_task_tag, els->tgt_task_tag, els->hw_tag
 
#define node_els_trace()
 
#define els_io_printf(els, fmt,...)   ocs_log_debug(els->node->ocs, "[%s]" ELS_IOFMT " %-8s " fmt, els->node->display_name, ELS_IOFMT_ARGS(els), els->display_name, ##__VA_ARGS__);
 
#define OCS_ELS_RSP_LEN   1024
 
#define OCS_ELS_FDMI_REG_LEN   2048
 
#define OCS_ELS_FDMI_RSP_LEN   4096
 
#define OCS_ELS_GID_FT_RSP_LEN   8096 /* Enough for 2K remote target nodes */
 
#define OCS_ELS_GID_PT_RSP_LEN   8096 /* Enough for 2K remote target nodes */
 
#define MAX_FDMI_ATTRIBUTE_SIZE   256
 
#define std_els_state_decl(...)
 
#define els_sm_trace(...)
 

Functions

static int32_t ocs_els_send (ocs_io_t *els, uint32_t reqlen, uint32_t timeout_sec, ocs_hal_srrs_cb_t cb)
 Send the ELS command. More...
 
static int32_t ocs_els_send_rsp (ocs_io_t *els, uint32_t rsplen)
 Send the ELS response. More...
 
static int32_t ocs_els_acc_cb (ocs_hal_io_t *hio, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *arg)
 Handle ELS IO accept/response completions. More...
 
static ocs_io_t * ocs_bls_send_acc (ocs_io_t *io, uint32_t s_id, uint16_t ox_id, uint16_t rx_id)
 Send a BLS BA_ACC response. More...
 
static ocs_io_t * ocs_bls_send_rjt (ocs_io_t *io, uint32_t s_id, uint16_t ox_id, uint16_t rx_id)
 Send a BLS BA_RJT response. More...
 
static int32_t ocs_bls_send_acc_cb (ocs_hal_io_t *hio, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *app)
 Handle the BLS accept completion. More...
 
static int32_t ocs_bls_send_rjt_cb (ocs_hal_io_t *hio, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *app)
 Handle the BLS reject completion. More...
 
static void ocs_io_transition (ocs_io_t *els, ocs_sm_function_t state, void *data)
 ELS state machine transition wrapper. More...
 
static ocs_io_t * ocs_els_abort_io (ocs_io_t *els, int send_abts)
 Abort an ELS IO. More...
 
static void _ocs_els_io_free (void *arg)
 Free IO structure for an ELS IO context. More...
 
static void ocs_els_delay_timer_cb (void *arg)
 Handle delay retry timeout. More...
 
void ocs_els_post_event (ocs_io_t *els, ocs_sm_event_t evt, void *data)
 ELS state machine post event wrapper. More...
 
ocs_io_t * ocs_els_io_alloc (ocs_node_t *node, uint32_t reqlen, ocs_els_role_e role)
 Allocate an IO structure for an ELS IO context. More...
 
ocs_io_t * ocs_els_io_alloc_size (ocs_node_t *node, uint32_t reqlen, uint32_t rsplen, ocs_els_role_e role)
 Allocate an IO structure for an ELS IO context. More...
 
void ocs_els_io_free (ocs_io_t *els)
 Free IO structure for an ELS IO context. More...
 
static void ocs_els_make_active (ocs_io_t *els)
 Make ELS IO active. More...
 
static int32_t ocs_els_req_cb (ocs_hal_io_t *hio, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *arg)
 Handle ELS IO request completions. More...
 
ocs_io_t * ocs_send_plogi (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, void(*cb)(ocs_node_t *node, ocs_node_cb_t *cbdata, void *arg), void *cbarg)
 Format and send a PLOGI ELS command. More...
 
ocs_io_t * ocs_send_flogi (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Format and send a FLOGI ELS command. More...
 
ocs_io_t * ocs_send_fdisc (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Format and send a FDISC ELS command. More...
 
ocs_io_t * ocs_send_prli (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a PRLI ELS command. More...
 
ocs_io_t * ocs_send_prlo (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a PRLO ELS command. More...
 
ocs_io_t * ocs_send_logo (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a LOGO ELS command. More...
 
ocs_io_t * ocs_send_adisc (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send an ADISC ELS command. More...
 
ocs_io_t * ocs_send_pdisc (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a PDISC ELS command. More...
 
ocs_io_t * ocs_send_scr (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send an SCR ELS command. More...
 
ocs_io_t * ocs_send_rrq (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send an RRQ ELS command. More...
 
ocs_io_t * ocs_send_rscn (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, void *port_ids, uint32_t port_ids_count, els_cb_t cb, void *cbarg)
 Send an RSCN ELS command. More...
 
ocs_io_t * ocs_send_ls_rjt (ocs_io_t *io, uint32_t ox_id, uint32_t reason_code, uint32_t reason_code_expl, uint32_t vendor_unique, els_cb_t cb, void *cbarg)
 Send an LS_RJT ELS response. More...
 
ocs_io_t * ocs_send_plogi_acc (ocs_io_t *io, uint32_t ox_id, els_cb_t cb, void *cbarg)
 Send a PLOGI accept response. More...
 
ocs_io_t * ocs_send_flogi_p2p_acc (ocs_io_t *io, uint32_t ox_id, uint32_t s_id, els_cb_t cb, void *cbarg)
 Send an FLOGI accept response for point-to-point negotiation. More...
 
ocs_io_t * ocs_send_flogi_acc (ocs_io_t *io, uint32_t ox_id, uint32_t is_fport, els_cb_t cb, void *cbarg)
 
static int32_t ocs_node_first_burst_enabled (ocs_node_t *node)
 
static ocs_io_t * ocs_send_nvme_prli_acc (ocs_io_t *io)
 
static ocs_io_t * ocs_send_fcp_prli_acc (ocs_io_t *io)
 
ocs_io_t * ocs_send_prli_acc (ocs_io_t *io, uint32_t ox_id, uint8_t fc_type, els_cb_t cb, void *cbarg)
 Send a PRLI accept response. More...
 
ocs_io_t * ocs_send_prlo_acc (ocs_io_t *io, uint32_t ox_id, uint8_t fc_type, els_cb_t cb, void *cbarg)
 Send a PRLO accept response. More...
 
ocs_io_t * ocs_send_ls_acc (ocs_io_t *io, uint32_t ox_id, els_cb_t cb, void *cbarg)
 Send a generic LS_ACC response without a payload. More...
 
ocs_io_t * ocs_send_logo_acc (ocs_io_t *io, uint32_t ox_id, els_cb_t cb, void *cbarg)
 Send a LOGO accept response. More...
 
ocs_io_t * ocs_send_adisc_acc (ocs_io_t *io, uint32_t ox_id, els_cb_t cb, void *cbarg)
 Send an ADISC accept response. More...
 
ocs_io_t * ocs_ns_send_rftid (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a RFTID CT request. More...
 
ocs_io_t * ocs_ns_send_rffid (ocs_node_t *node, uint8_t fc_type, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a RFFID CT request. More...
 
ocs_io_t * ocs_ns_send_gidpt (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a GIDPT CT request. More...
 
ocs_io_t * ocs_ns_send_loopback_frame (ocs_node_t *node, void *buf, uint32_t size, void *rx_buf, uint32_t rx_buf_size, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 
ocs_io_t * ocs_ns_send_ganxt (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg, uint32_t port_id)
 Send a GA_NEXT CT request. More...
 
ocs_io_t * ocs_fdmi_send_rhba (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a RHBA CT request. More...
 
ocs_io_t * ocs_fdmi_send_dereg_cmd (ocs_node_t *node, uint16_t dereg_code, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a FDMI dereg CT request. More...
 
ocs_io_t * ocs_fdmi_send_reg_port (ocs_node_t *node, int req_code, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 Send a RPRT/RPA CT request. More...
 
ocs_io_t * ocs_fdmi_send_get_cmd (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg, ocs_fdmi_get_cmd_req_info_t *req_info)
 Send a GHRL CT request. More...
 
ocs_io_t * ocs_bls_send_acc_hdr (ocs_io_t *io, fc_header_t *hdr)
 Send a BA_ACC given the request's FC header. More...
 
ocs_io_t * ocs_bls_send_rjt_hdr (ocs_io_t *io, fc_header_t *hdr)
 Send a BA_RJT given the request's FC heade. More...
 
static int32_t ocs_els_abort_cb (ocs_hal_io_t *hio, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *app)
 ELS abort callback. More...
 
void ocs_els_io_cleanup (ocs_io_t *els, ocs_sm_event_t node_evt, void *arg)
 Cleanup an ELS IO. More...
 
void * __ocs_els_common (const char *funcname, ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Common event handler for the ELS IO state machine. More...
 
void * __ocs_els_init (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Initial ELS IO state. More...
 
void * __ocs_els_wait_resp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Wait for the ELS request to complete. More...
 
void * __ocs_els_retry (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Wait for the ELS IO abort request to complete, and retry the ELS. More...
 
void * __ocs_els_aborted_delay_retry (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Wait for a retry timer to expire having received an abort request. More...
 
void * __ocs_els_delay_retry (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Wait for a retry timer to expire. More...
 
void * __ocs_els_aborting (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Wait for the ELS IO abort request to complete. More...
 
static void ocs_els_abort_cleanup (ocs_io_t *els)
 cleanup ELS after abort More...
 
void * __ocs_els_aborting_wait_req_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Wait for the ELS IO abort request to complete. More...
 
void * __ocs_els_aborting_wait_abort_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Wait for the ELS IO abort request to complete. More...
 
void ocs_ddump_els (ocs_textbuf_t *textbuf, ocs_io_t *els)
 Generate ELS context ddump data. More...
 
int32_t ocs_els_io_list_empty (ocs_node_t *node, ocs_list_t *list)
 return TRUE if given ELS list is empty (while taking proper locks) More...
 
static int32_t ocs_ct_acc_cb (ocs_hal_io_t *hio, ocs_remote_node_t *rnode, uint32_t length, int32_t status, uint32_t ext_status, void *arg)
 Handle CT send response completion. More...
 
int32_t ocs_send_ct_rsp (ocs_io_t *io, uint32_t ox_id, fcct_iu_header_t *ct_hdr, uint32_t cmd_rsp_code, uint32_t reason_code, uint32_t reason_code_explanation)
 Send CT response. More...
 

Variables

int(* ocs_fdmi_hba_action [])(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
 
int(* ocs_fdmi_port_action [])(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
 

Macro Details

#define els_io_printf (   els,
  fmt,
  ... 
)    ocs_log_debug(els->node->ocs, "[%s]" ELS_IOFMT " %-8s " fmt, els->node->display_name, ELS_IOFMT_ARGS(els), els->display_name, ##__VA_ARGS__);

Definition at line 57 of file ocs_els.c.

#define ELS_IOFMT   "[i:%04x t:%04x h:%04x]"

Definition at line 48 of file ocs_els.c.

#define ELS_IOFMT_ARGS (   els)    els->init_task_tag, els->tgt_task_tag, els->hw_tag

Definition at line 49 of file ocs_els.c.

#define els_sm_trace (   ...)
Value:
do { \
ocs_log_info(ocs, "[%s] %-8s %-20s %-20s\n", node->display_name, els->display_name, \
__func__, ocs_sm_event_name(evt)); \
} while (0)
const char * ocs_sm_event_name(ocs_sm_event_t evt)
Definition: ocs_sm.c:92
#define OCS_LOG_ENABLE_ELS_TRACE(ocs)
Definition: ocs_debug.h:71

Definition at line 2923 of file ocs_els.c.

#define MAX_FDMI_ATTRIBUTE_SIZE   256

Definition at line 124 of file ocs_els.c.

#define node_els_trace ( )
Value:
do { \
ocs_log_info(ocs, "[%s] %-20s\n", node->display_name, __func__); \
} while (0)
#define OCS_LOG_ENABLE_ELS_TRACE(ocs)
Definition: ocs_debug.h:71

Definition at line 51 of file ocs_els.c.

#define OCS_ELS_FDMI_REG_LEN   2048

Definition at line 119 of file ocs_els.c.

#define OCS_ELS_FDMI_RSP_LEN   4096

Definition at line 120 of file ocs_els.c.

#define OCS_ELS_GID_FT_RSP_LEN   8096 /* Enough for 2K remote target nodes */

Definition at line 121 of file ocs_els.c.

#define OCS_ELS_GID_PT_RSP_LEN   8096 /* Enough for 2K remote target nodes */

Definition at line 122 of file ocs_els.c.

#define OCS_ELS_RSP_LEN   1024

Definition at line 118 of file ocs_els.c.

#define std_els_state_decl (   ...)
Value:
ocs_io_t *els = NULL; \
ocs_node_t *node = NULL; \
ocs_t *ocs = NULL; \
ocs_assert(ctx != NULL, NULL); \
els = ctx->app; \
ocs_assert(els != NULL, NULL); \
node = els->node; \
ocs_assert(node != NULL, NULL); \
ocs = node->ocs; \
ocs_assert(ocs != NULL, NULL);
#define ocs_assert(cond,...)
Definition: ocs_debug.h:176

Definition at line 2911 of file ocs_els.c.

Function Details

void* __ocs_els_aborted_delay_retry ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Wait for a retry timer to expire having received an abort request.

Description

This state is entered when waiting for a timer event, after having received an abort request, to avoid a race condition with the timer handler

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 3230 of file ocs_els.c.

void* __ocs_els_aborting ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Wait for the ELS IO abort request to complete.

Description

This state is entered after we abort an ELS WQE and are waiting for either the original ELS WQE request or the abort to complete.

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 3313 of file ocs_els.c.

void* __ocs_els_aborting_wait_abort_cmpl ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Wait for the ELS IO abort request to complete.

Description

This state is entered after we abort an ELS WQE, we received the original ELS WQE request completion first and are waiting for the abort to complete.

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 3428 of file ocs_els.c.

void* __ocs_els_aborting_wait_req_cmpl ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Wait for the ELS IO abort request to complete.

Description

This state is entered after we abort an ELS WQE, we received the abort completion first and are waiting for the original ELS WQE request to complete.

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 3385 of file ocs_els.c.

void* __ocs_els_common ( const char *  funcname,
ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Common event handler for the ELS IO state machine.

Description

Provide handler for events for which default actions are desired.

Parameters
funcnameName of the calling function (for logging).
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 2980 of file ocs_els.c.

void* __ocs_els_delay_retry ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Wait for a retry timer to expire.

Description

This state is entered when waiting for a timer event, so that the ELS request can be retried.

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 3267 of file ocs_els.c.

void* __ocs_els_init ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Initial ELS IO state.

Description

This is the initial ELS IO state. Upon entry, the requested ELS/CT is submitted to the hardware.

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 3021 of file ocs_els.c.

void* __ocs_els_retry ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Wait for the ELS IO abort request to complete, and retry the ELS.

Description

This state is entered when waiting for an abort of an ELS request to complete so the request can be retried.

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Definition at line 3164 of file ocs_els.c.

void* __ocs_els_wait_resp ( ocs_sm_ctx_t *  ctx,
ocs_sm_event_t  evt,
void *  arg 
)

Wait for the ELS request to complete.

Description

This is the ELS IO state that waits for the submitted ELS event to complete. If an error completion event is received, the requested ELS is aborted.

Parameters
ctxRemote node SM context.
evtEvent to process.
argPer event optional argument.
Returns
Returns NULL.

Disable BBCR by setting the BB_SC_N field in the Common Service Parameters to zero while retrying the FLOGI. Keep the BB_SC_N field set to zero for any additional retries while the link remains up. This is to work around a bug in the older Brocade switch firmware (FOS versions prior to 7.1.0). During subsequent linkup processing, if BBCR is enabled, attempt to enable BBCR again.

Definition at line 3065 of file ocs_els.c.

static int32_t ocs_bls_send_acc_cb ( ocs_hal_io_t *  hio,
ocs_remote_node_t *  rnode,
uint32_t  length,
int32_t  status,
uint32_t  ext_status,
void *  app 
)
static

Handle the BLS accept completion.

Description

Upon completion of sending a BA_ACC, this callback is invoked by the HAL.

Parameters
hioPointer to the HAL IO object.
rnodePointer to the HAL remote node.
lengthLength of the response payload, in bytes.
statusCompletion status.
ext_statusExtended completion status.
appCallback private argument.
Returns
Returns 0 on success; or a negative error value on failure.

Definition at line 2663 of file ocs_els.c.

static int32_t ocs_bls_send_rjt_cb ( ocs_hal_io_t *  hio,
ocs_remote_node_t *  rnode,
uint32_t  length,
int32_t  status,
uint32_t  ext_status,
void *  app 
)
static

Handle the BLS reject completion.

Description

Upon completion of sending a BA_RJT, this callback is invoked by the HAL.

Parameters
hioPointer to the HAL IO object.
rnodePointer to the HAL remote node.
lengthLength of the response payload, in bytes.
statusCompletion status.
ext_statusExtended completion status.
appCallback private argument.
Returns
Returns 0 on success; or a negative error value on failure.

Definition at line 2770 of file ocs_els.c.

ocs_io_t* ocs_bls_send_rjt_hdr ( ocs_io_t *  io,
fc_header_t *  hdr 
)

Send a BA_RJT given the request's FC heade.

Description

Using the S_ID/D_ID from the request's FC header, generate a BA_RJT.

Parameters
ioPointer to a SCSI IO object.
hdrPointer to the FC header.
Returns
Returns pointer to IO object, or NULL if error.

Definition at line 2685 of file ocs_els.c.

static int32_t ocs_ct_acc_cb ( ocs_hal_io_t *  hio,
ocs_remote_node_t *  rnode,
uint32_t  length,
int32_t  status,
uint32_t  ext_status,
void *  arg 
)
static

Handle CT send response completion.

Called when CT response completes, free IO

Parameters
hioPointer to the HAL IO context that completed.
rnodePointer to the remote node.
lengthLength of the returned payload data.
statusStatus of the completion.
ext_statusExtended status of the completion.
argApplication-specific argument (generally a pointer to the ELS IO context).
Returns
returns 0

Definition at line 3511 of file ocs_els.c.

void ocs_ddump_els ( ocs_textbuf_t *  textbuf,
ocs_io_t *  els 
)

Generate ELS context ddump data.

Description

Generate the ddump data for an ELS context.

Parameters
textbufPointer to the text buffer.
elsPointer to the ELS context.
Returns
None.

Definition at line 3463 of file ocs_els.c.

static int32_t ocs_els_abort_cb ( ocs_hal_io_t *  hio,
ocs_remote_node_t *  rnode,
uint32_t  length,
int32_t  status,
uint32_t  ext_status,
void *  app 
)
static

ELS abort callback.

Description

This callback is invoked by the HAL when an ELS IO is aborted.

Parameters
hioPointer to the HAL IO object.
rnodePointer to the HAL remote node.
lengthLength of the response payload, in bytes.
statusCompletion status.
ext_statusExtended completion status.
appCallback private argument.
Returns
Returns 0 on success; or a negative error value on failure.

Definition at line 2799 of file ocs_els.c.

static void ocs_els_abort_cleanup ( ocs_io_t *  els)
static

cleanup ELS after abort

Parameters
elsELS IO to cleanup
Returns
Returns None.

Definition at line 3356 of file ocs_els.c.

static ocs_io_t * ocs_els_abort_io ( ocs_io_t *  els,
int  send_abts 
)
static

Abort an ELS IO.

Description

The ELS IO is aborted by making a HAL abort IO request, optionally requesting that an ABTS is sent.

Note: This function allocates a HAL IO, and associates the HAL IO with the ELS IO that it is aborting. It does not associate the HAL IO with the node directly, like for ELS requests. The abort completion is propagated up to the node once the original WQE and the abort WQE are complete (the original WQE completion is not propagated up to node).

Parameters
elsPointer to the ELS IO.
send_abtsBoolean to indicate if hardware will automatically generate an ABTS.
Returns
Returns pointer to Abort IO object, or NULL if error.

Definition at line 2851 of file ocs_els.c.

static void ocs_els_delay_timer_cb ( void *  arg)
static

Handle delay retry timeout.

Callback is invoked when the delay retry timer expires.

Parameters
argpointer to the ELS IO object
Returns
none

Definition at line 3580 of file ocs_els.c.

void ocs_els_io_cleanup ( ocs_io_t *  els,
ocs_sm_event_t  node_evt,
void *  arg 
)

Cleanup an ELS IO.

Description

Cleans up an ELS IO by posting the requested event to the owning node object; invoking the callback, if one is provided; and then freeing the ELS IO object.

Parameters
elsPointer to the ELS IO.
node_evtNode SM event to post.
argNode SM event argument.
Returns
None.

Definition at line 2947 of file ocs_els.c.

int32_t ocs_els_io_list_empty ( ocs_node_t *  node,
ocs_list_t *  list 
)

return TRUE if given ELS list is empty (while taking proper locks)

Test if given ELS list is empty while holding the node->active_ios_lock.

Parameters
nodepointer to node object
listpointer to list
Returns
TRUE if els_io_list is empty

Definition at line 3487 of file ocs_els.c.

static int32_t ocs_node_first_burst_enabled ( ocs_node_t *  node)
inlinestatic

Definition at line 1586 of file ocs_els.c.

ocs_io_t* ocs_ns_send_loopback_frame ( ocs_node_t *  node,
void *  buf,
uint32_t  size,
void *  rx_buf,
uint32_t  rx_buf_size,
uint32_t  timeout_sec,
uint32_t  retries,
els_cb_t  cb,
void *  cbarg 
)

Definition at line 2118 of file ocs_els.c.

int32_t ocs_send_ct_rsp ( ocs_io_t *  io,
uint32_t  ox_id,
fcct_iu_header_t *  ct_hdr,
uint32_t  cmd_rsp_code,
uint32_t  reason_code,
uint32_t  reason_code_explanation 
)

Send CT response.

Sends a CT response frame with payload

Parameters
ioPointer to the IO context.
ox_idOriginator exchange ID
ct_hdrPointer to the CT IU
cmd_rsp_codeCT response code
reason_codeReason code
reason_code_explanationReason code explanation
Returns
returns 0 for success, a negative error code value for failure.

Definition at line 3535 of file ocs_els.c.

static ocs_io_t* ocs_send_fcp_prli_acc ( ocs_io_t *  io)
static

Definition at line 1625 of file ocs_els.c.

ocs_io_t* ocs_send_flogi_acc ( ocs_io_t *  io,
uint32_t  ox_id,
uint32_t  is_fport,
els_cb_t  cb,
void *  cbarg 
)

Definition at line 1534 of file ocs_els.c.

ocs_io_t* ocs_send_ls_rjt ( ocs_io_t *  io,
uint32_t  ox_id,
uint32_t  reason_code,
uint32_t  reason_code_expl,
uint32_t  vendor_unique,
els_cb_t  cb,
void *  cbarg 
)

Send an LS_RJT ELS response.

Description

Send an LS_RJT ELS response.

Parameters
ioPointer to a SCSI IO object.
ox_idOriginator exchange ID being responded to.
reason_codeReason code value for LS_RJT.
reason_code_explReason code explanation value for LS_RJT.
vendor_uniqueVendor-unique value for LS_RJT.
cbCallback function.
cbargCallback function argument.
Returns
Returns pointer to IO object, or NULL if error.

Definition at line 1353 of file ocs_els.c.

static ocs_io_t* ocs_send_nvme_prli_acc ( ocs_io_t *  io)
static

Definition at line 1592 of file ocs_els.c.

Variable Details

int(* ocs_fdmi_hba_action[])(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Initial value:
= {
NULL,
}
int ocs_fdmi_hba_attr_num_ports(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3030
int ocs_fdmi_hba_attr_bios_ver(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3063
int ocs_fdmi_hba_attr_model(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2858
int ocs_fdmi_hba_attr_fmw_ver(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2940
int ocs_fdmi_hba_attr_bios_state(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3082
int ocs_fdmi_hba_attr_ct_len(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2979
int ocs_fdmi_hba_attr_symbolic_name(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2994
int ocs_fdmi_hba_attr_rom_ver(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2920
int ocs_fdmi_hba_attr_drvr_ver(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2899
int ocs_fdmi_hba_attr_fabric_wwnn(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3046
int ocs_fdmi_hba_attr_vendor_info(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3016
int ocs_fdmi_hba_attr_wwnn(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2797
int ocs_fdmi_hba_attr_sn(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2834
int ocs_fdmi_hba_attr_description(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2878
int ocs_fdmi_hba_attr_os_ver(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2959
int ocs_fdmi_hba_attr_vendor_id(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3098
int ocs_fdmi_hba_attr_manufacturer(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:2814

Definition at line 75 of file ocs_els.c.

int(* ocs_fdmi_port_action[])(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Initial value:
= {
NULL,
}
int ocs_fdmi_port_attr_fabric_wwpn(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3584
int ocs_fdmi_port_attr_active_fc4type(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3608
int ocs_fdmi_port_attr_class(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3570
int ocs_fdmi_port_attr_nportid(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3650
int ocs_fdmi_port_attr_wwpn(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3515
int ocs_fdmi_port_attr_os_devname(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3457
int ocs_fdmi_port_attr_max_frame(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3432
int ocs_fdmi_port_attr_host_name(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3478
int ocs_fdmi_port_attr_speed(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3384
int ocs_fdmi_port_attr_wwnn(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3497
int ocs_fdmi_port_attr_fc4type(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3315
int ocs_fdmi_port_attr_support_speed(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3334
int ocs_fdmi_port_attr_symbolic_name(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3532
int ocs_fdmi_port_attr_port_type(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3549
int ocs_fdmi_port_attr_port_state(ocs_sport_t *sport, ocs_fdmi_attr_def_t *ad)
Definition: ocs_fabric.c:3626

Definition at line 98 of file ocs_els.c.