Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Node common support

Functions

void ocs_node_abort_all_els (ocs_node_t *node)
 Device node state machine wait for all ELS's to complete. More...
 
int32_t ocs_remote_node_cb (void *arg, ocs_hal_remote_node_event_e event, void *data)
 Handle remote node events from HAL. More...
 
int32_t ocs_node_attach (ocs_node_t *node)
 Perform HAL call to attach a remote node. More...
 
void ocs_node_fcid_display (uint32_t fc_id, char *buffer, uint32_t buffer_length)
 Generate text for a node's fc_id. More...
 
void * __ocs_node_shutdown (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 state: shutdown a node More...
 
void * __ocs_node_wait_els_shutdown (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 Node state machine: Wait for all ELSs to complete. More...
 
void * __ocs_node_wait_ios_shutdown (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 state: initiate node shutdown More...
 
void * __ocs_node_common (const char *funcname, ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 state: common node event handler More...
 
void ocs_node_save_sparms (ocs_node_t *node, void *payload)
 save node service parameters More...
 
void ocs_node_post_event (ocs_node_t *node, ocs_sm_event_t evt, void *arg)
 Post event to node state machine context. More...
 
void ocs_node_transition (ocs_node_t *node, ocs_sm_function_t state, void *data)
 transition state of a node More...
 
void ocs_node_build_eui_name (char *buffer, uint32_t buffer_len, uint64_t eui_name)
 build EUI formatted WWN More...
 
uint64_t ocs_node_get_wwpn (ocs_node_t *node)
 return nodes' WWPN as a uint64_t More...
 
uint64_t ocs_node_get_wwnn (ocs_node_t *node)
 return nodes' WWNN as a uint64_t More...
 
int32_t ocs_node_recv_els_frame (ocs_node_t *node, ocs_hal_sequence_t *seq)
 Dispatch a ELS frame. More...
 
int32_t ocs_node_recv_abts_frame (ocs_node_t *node, ocs_hal_sequence_t *seq)
 Dispatch a ABTS frame (RQ Pair/sequence coalescing). More...
 
int32_t ocs_node_recv_ct_frame (ocs_node_t *node, ocs_hal_sequence_t *seq)
 Dispatch a CT frame. More...
 
int32_t ocs_node_recv_fcp_cmd (ocs_node_t *node, ocs_hal_sequence_t *seq)
 Dispatch a FCP command frame when the node is not ready. More...
 
int32_t ocs_node_recv_bls_no_sit (ocs_node_t *node, ocs_hal_sequence_t *seq)
 Stub handler for non-ABTS BLS frames. More...
 
int32_t ocs_node_suppress_resp (ocs_remote_node_t *rnode)
 Return node suppress_rsp state. More...
 

Function Details

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

state: common node event handler

Handle common/shared node events

Parameters
funcnamecalling function's name
ctxremote node sm context
evtevent to process
argper event optional argument
Returns
returns NULL

Definition at line 1317 of file ocs_node.c.

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

state: shutdown a node

A node is shutdown,

Parameters
ctxremote node sm context
evtevent to process
argper event optional argument
Returns
returns NULL
Note

Definition at line 841 of file ocs_node.c.

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

Node state machine: Wait for all ELSs to complete.

Description

State waits for all ELSs to complete after aborting all outstanding .

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

Definition at line 1102 of file ocs_node.c.

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

state: initiate node shutdown

State is entered when a node receives a shutdown event, and it's waiting for all the active IOs and ELS IOs associated with the node to complete.

Parameters
ctxremote node sm context
evtevent to process
argper event optional argument
Returns
returns NULL

Definition at line 1252 of file ocs_node.c.

void ocs_node_abort_all_els ( ocs_node_t *  node)

Device node state machine wait for all ELS's to complete.

Abort all ELS's for given node.

Parameters
nodenode for which ELS's will be aborted

Definition at line 83 of file ocs_node.c.

int32_t ocs_node_attach ( ocs_node_t *  node)

Perform HAL call to attach a remote node.

Parameters
nodepointer to node object
Returns
0 on success, non-zero otherwise

Definition at line 671 of file ocs_node.c.

void ocs_node_build_eui_name ( char *  buffer,
uint32_t  buffer_len,
uint64_t  eui_name 
)

build EUI formatted WWN

Build a WWN given the somewhat transport agnostic iScsi naming specification, for FC use the eui. format, an ascii string such as: "eui.10000000C9A19501"

Parameters
bufferbuffer to place formatted name into
buffer_lenlength in bytes of the buffer
eui_namecpu endian 64 bit WWN value
Returns
none

Definition at line 1577 of file ocs_node.c.

void ocs_node_fcid_display ( uint32_t  fc_id,
char *  buffer,
uint32_t  buffer_length 
)

Generate text for a node's fc_id.

The text for a nodes fc_id is generated, either as a well known name, or a 6 digit hex value.

Parameters
fc_idfc_id
buffertext buffer
buffer_lengthtext buffer length in bytes
Returns
none

Definition at line 719 of file ocs_node.c.

uint64_t ocs_node_get_wwnn ( ocs_node_t *  node)

return nodes' WWNN as a uint64_t

The WWNN is computed from service parameters and returned as a uint64_t

Parameters
nodepointer to node structure
Returns
WWNN

Definition at line 1617 of file ocs_node.c.

uint64_t ocs_node_get_wwpn ( ocs_node_t *  node)

return nodes' WWPN as a uint64_t

The WWPN is computed from service parameters and returned as a uint64_t

Parameters
nodepointer to node structure
Returns
WWPN

Definition at line 1597 of file ocs_node.c.

void ocs_node_post_event ( ocs_node_t *  node,
ocs_sm_event_t  evt,
void *  arg 
)

Post event to node state machine context.

This is used by the node state machine code to post events to the nodes. Upon completion of the event posting, if the nesting depth is zero and we're not holding inbound frames, then the pending frames are processed.

Parameters
nodepointer to node
evtevent to post
argevent posting argument
Returns
none

Definition at line 1498 of file ocs_node.c.

int32_t ocs_node_recv_abts_frame ( ocs_node_t *  node,
ocs_hal_sequence_t *  seq 
)

Dispatch a ABTS frame (RQ Pair/sequence coalescing).

Description

An ABTS frame is dispatched to the node state machine. This function is used for both RQ Pair and sequence coalescing.

Parameters
nodeNode that originated the frame.
seqHeader/payload sequence buffers
Returns
Returns 0 if frame processed and RX buffers cleaned up appropriately, -1 if frame not handled and RX buffers need to be returned.

Definition at line 2342 of file ocs_node.c.

int32_t ocs_node_recv_bls_no_sit ( ocs_node_t *  node,
ocs_hal_sequence_t *  seq 
)

Stub handler for non-ABTS BLS frames.

Description

Log message and drop. Customer can plumb it to their back-end as needed

Parameters
nodeNode that originated the frame.
seqheader/payload sequence buffers
Returns
Returns 0

Definition at line 2549 of file ocs_node.c.

int32_t ocs_node_recv_ct_frame ( ocs_node_t *  node,
ocs_hal_sequence_t *  seq 
)

Dispatch a CT frame.

Description

A CT frame is dispatched to the node state machine. RQ Pair mode: this function is always called with a NULL hal io.

Parameters
nodeNode that originated the frame.
seqheader/payload sequence buffers
Returns
Returns 0 if frame processed and RX buffers cleaned up appropriately, -1 if frame not handled and RX buffers need to be returned.

Definition at line 2420 of file ocs_node.c.

int32_t ocs_node_recv_els_frame ( ocs_node_t *  node,
ocs_hal_sequence_t *  seq 
)

Dispatch a ELS frame.

Description

An ELS frame is dispatched to the node state machine. RQ Pair mode: this function is always called with a NULL hal io.

Parameters
nodeNode that originated the frame.
seqheader/payload sequence buffers
Returns
Returns 0 if frame processed and RX buffers cleaned up appropriately, -1 if frame not handled and RX buffers need to be returned.

Definition at line 2231 of file ocs_node.c.

int32_t ocs_node_recv_fcp_cmd ( ocs_node_t *  node,
ocs_hal_sequence_t *  seq 
)

Dispatch a FCP command frame when the node is not ready.

Description

A frame is dispatched to the node state machine.

Parameters
nodeNode that originated the frame.
seqheader/payload sequence buffers
Returns
Returns 0 if frame processed and RX buffers cleaned up appropriately, -1 if frame not handled.

Definition at line 2522 of file ocs_node.c.

void ocs_node_save_sparms ( ocs_node_t *  node,
void *  payload 
)

save node service parameters

Service parameters are copyed into the node structure

Parameters
nodepointer to node structure
payloadpointer to service paramters to save
Returns
none

Definition at line 1467 of file ocs_node.c.

int32_t ocs_node_suppress_resp ( ocs_remote_node_t *  rnode)
inline

Return node suppress_rsp state.

Returns
true if suppress response is enabled for the node, otherwise false

Definition at line 2584 of file ocs_node.c.

void ocs_node_transition ( ocs_node_t *  node,
ocs_sm_function_t  state,
void *  data 
)

transition state of a node

The node's state is transitioned to the requested state. Entry/Exit events are posted as needed.

Parameters
nodepointer to node
statestate to transition to
datatransition data
Returns
none

Definition at line 1547 of file ocs_node.c.

int32_t ocs_remote_node_cb ( void *  arg,
ocs_hal_remote_node_event_e  event,
void *  data 
)

Handle remote node events from HAL.

Handle remote node events from HAL. Essentially the HAL event is translated into a node state machine event that is posted to the affected node.

Parameters
argpointer to ocs
eventHAL event to proceoss
dataapplication specific data (pointer to the affected node)
Returns
returns 0 for success, a negative error code value for failure.

Definition at line 115 of file ocs_node.c.