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

Go to the source code of this file.

Detailed Description

Declarations for the interface exported by ocs_els.

Definition in file ocs_els.h.

Data Structures

struct  ocs_fdmi_get_cmd_req_info_t
 

Typedefs

typedef void(* els_cb_t )(ocs_node_t *node, ocs_node_cb_t *cbdata, void *arg)
 

Enumerations

enum  ocs_els_role_e { OCS_ELS_ROLE_ORIGINATOR, OCS_ELS_ROLE_RESPONDER }
 

Functions

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...
 
ocs_io_t * ocs_send_plogi (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, 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_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_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_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_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_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_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_grhl (ocs_node_t *node, uint32_t timeout_sec, uint32_t retries, els_cb_t cb, void *cbarg)
 
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 *)
 Send a GHRL CT request. More...
 
int ocs_fdmi_get_cmd (ocs_sport_t *sport, els_cb_t cb, void *cb_arg, ocs_fdmi_get_cmd_req_info_t *fdmi_cmd_req)
 
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...
 
void ocs_els_io_cleanup (ocs_io_t *els, ocs_sm_event_t node_evt, void *arg)
 Cleanup an ELS IO. 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_ls_rjt (ocs_io_t *io, uint32_t ox_id, uint32_t reason_cod, 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_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)
 
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_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_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_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_adisc_acc (ocs_io_t *io, uint32_t ox_id, els_cb_t cb, void *cbarg)
 Send an ADISC accept response. More...
 
void ocs_ddump_els (ocs_textbuf_t *textbuf, ocs_io_t *els)
 Generate ELS context ddump data. 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...
 
void ocs_els_post_event (ocs_io_t *els, ocs_sm_event_t evt, void *data)
 ELS state machine post event wrapper. 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_aborting (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_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_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...
 
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...
 
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...
 

Type Details

typedef void(* els_cb_t)(ocs_node_t *node, ocs_node_cb_t *cbdata, void *arg)

Definition at line 58 of file ocs_els.h.

Enumeration Details

Enumerator
OCS_ELS_ROLE_ORIGINATOR 
OCS_ELS_ROLE_RESPONDER 

Definition at line 42 of file ocs_els.h.

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.

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.

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.

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.

int ocs_fdmi_get_cmd ( ocs_sport_t *  sport,
els_cb_t  cb,
void *  cb_arg,
ocs_fdmi_get_cmd_req_info_t *  fdmi_cmd_req 
)

Definition at line 3700 of file ocs_fabric.c.

ocs_io_t* ocs_fdmi_send_grhl ( ocs_node_t *  node,
uint32_t  timeout_sec,
uint32_t  retries,
els_cb_t  cb,
void *  cbarg 
)
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.

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.