Go to the source code of this file.
OCS linux driver remote node callback declarations
Definition in file ocs_node.h.
Data Structures | |
| struct | ocs_node_cb_t |
| Node SM IO Context Callback structure. More... | |
Macros | |
| #define | node_sm_trace() |
| #define | node_printf(node, fmt,...) ocs_log_info(node->ocs, "[%s] " fmt, node->display_name, ##__VA_ARGS__) |
| #define | node_printf_test(node, fmt,...) ocs_log_test(node->ocs, "[%s] " fmt, node->display_name, ##__VA_ARGS__) |
| #define | node_printf_err(node, fmt,...) ocs_log_err(node->ocs, "[%s] " fmt, node->display_name, ##__VA_ARGS__) |
| #define | node_sm_prologue() |
| #define | std_node_state_decl(...) |
| #define | OCS_NODEDB_PAUSE_FABRIC_LOGIN (1U << 0) |
| #define | OCS_NODEDB_PAUSE_NAMESERVER (1U << 1) |
| #define | OCS_NODEDB_PAUSE_NEW_NODES (1U << 2) |
Typedefs | |
| typedef void *(* | ocs_node_common_func_t )(const char *funcname, ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
Functions | |
| static void | ocs_node_hold_frames (ocs_node_t *node) |
| hold frames in pending frame list More... | |
| static void | ocs_node_accept_frames (ocs_node_t *node) |
| accept frames More... | |
| int32_t | ocs_node_create_pool (ocs_t *ocs, uint32_t node_count) |
| allocate node object pool More... | |
| void | ocs_node_free_pool (ocs_t *ocs) |
| free node object pool More... | |
| ocs_node_t * | ocs_node_get_instance (ocs_t *ocs, uint32_t index) |
| return pointer to node object given instance index More... | |
| static void | ocs_node_lock_init (ocs_node_t *node) |
| static void | ocs_node_lock_free (ocs_node_t *node) |
| static int32_t | ocs_node_lock_try (ocs_node_t *node) |
| static void | ocs_node_lock (ocs_node_t *node) |
| static void | ocs_node_unlock (ocs_node_t *node) |
| static ocs_node_enable_e | ocs_node_get_enable (ocs_node_t *node) |
| int32_t | node_check_els_req (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg, uint8_t cmd, ocs_node_common_func_t node_common_func, const char *funcname) |
| check ELS request completion More... | |
| int32_t | node_check_ct_req (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg, uint32_t cmd, ocs_node_common_func_t node_common_func, const char *funcname) |
| check CT request completion More... | |
| int32_t | node_check_ct_resp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| 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... | |
| ocs_node_t * | ocs_node_find (ocs_sport_t *sport, uint32_t port_id) |
| Find an FC node structure given the FC port ID. More... | |
| ocs_node_t * | ocs_node_find_wwpn (ocs_sport_t *sport, uint64_t wwpn) |
| Find an FC node structure given the WWPN. More... | |
| ocs_node_t * | ocs_node_find_wwnn (ocs_sport_t *sport, uint64_t wwnn) |
| Find an FC node structure given the WWNN. More... | |
| void | ocs_node_dump (ocs_t *ocs) |
| ocs_node_t * | ocs_node_alloc (ocs_sport_t *sport, uint32_t port_id, uint8_t init, uint8_t targ) |
| Allocate an fc node structure and add to node list. More... | |
| int32_t | ocs_node_free (ocs_node_t *node) |
| free a node structure More... | |
| void | ocs_node_force_free (ocs_node_t *node) |
| free memory resources of a node object 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_update_display_name (ocs_node_t *node) |
| update the node's display name 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_node_free (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Node state machine: Wait for a HAL node free event to complete. 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_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_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_initiate_cleanup (ocs_node_t *node) |
| Initiate node IO cleanup. More... | |
| int | ocs_ddump_node (ocs_textbuf_t *textbuf, ocs_node_t *node) |
| Generate node ddump data. 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... | |
| void | ocs_node_abort_all_els (ocs_node_t *node) |
| Device node state machine wait for all ELS's to complete. More... | |
| void | ocs_node_pause (ocs_node_t *node, ocs_sm_function_t state) |
| Pause a node. More... | |
| int32_t | ocs_node_resume (ocs_node_t *node) |
| Resume a paused state. More... | |
| void * | __ocs_node_paused (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Paused node state. More... | |
| int | ocs_node_active_ios_empty (ocs_node_t *node) |
| Return TRUE if active ios list is empty. More... | |
| void | ocs_node_send_ls_io_cleanup (ocs_node_t *node) |
| cleans up an XRI for the pending link services accept by aborting the XRI if required. More... | |
| int32_t | ocs_node_recv_link_services_frame (ocs_node_t *node, ocs_hal_sequence_t *seq) |
| 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_els_frame (ocs_node_t *node, ocs_hal_sequence_t *seq) |
| Dispatch a ELS frame. 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_is_remote_node (ocs_remote_node_t *rnode) |
| int32_t | ocs_node_suppress_resp (ocs_remote_node_t *rnode) |
| Return node suppress_rsp state. More... | |
| #define node_printf | ( | node, | |
| fmt, | |||
| ... | |||
| ) | ocs_log_info(node->ocs, "[%s] " fmt, node->display_name, ##__VA_ARGS__) |
Definition at line 48 of file ocs_node.h.
| #define node_printf_err | ( | node, | |
| fmt, | |||
| ... | |||
| ) | ocs_log_err(node->ocs, "[%s] " fmt, node->display_name, ##__VA_ARGS__) |
Definition at line 50 of file ocs_node.h.
| #define node_printf_test | ( | node, | |
| fmt, | |||
| ... | |||
| ) | ocs_log_test(node->ocs, "[%s] " fmt, node->display_name, ##__VA_ARGS__) |
Definition at line 49 of file ocs_node.h.
| #define node_sm_prologue | ( | ) |
Definition at line 52 of file ocs_node.h.
| #define node_sm_trace | ( | ) |
Definition at line 42 of file ocs_node.h.
| #define OCS_NODEDB_PAUSE_FABRIC_LOGIN (1U << 0) |
Definition at line 71 of file ocs_node.h.
| #define OCS_NODEDB_PAUSE_NAMESERVER (1U << 1) |
Definition at line 72 of file ocs_node.h.
| #define OCS_NODEDB_PAUSE_NEW_NODES (1U << 2) |
Definition at line 73 of file ocs_node.h.
| #define std_node_state_decl | ( | ... | ) |
Definition at line 62 of file ocs_node.h.
| typedef void*(* ocs_node_common_func_t)(const char *funcname, ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
Definition at line 197 of file ocs_node.h.
| enum ocs_node_enable_e |
Node initiator/target enable defines.
All combinations of the SLI port (sport) initiator/target enable, and remote node initiator/target enable are enumerated.
Definition at line 167 of file ocs_node.h.
| void* __ocs_node_paused | ( | ocs_sm_ctx_t * | ctx, |
| ocs_sm_event_t | evt, | ||
| void * | arg | ||
| ) |
Paused node state.
This state is entered when a state is "paused". When resumed, the node is transitioned to a previously saved state (node->ndoedb_state)
| ctx | Remote node state machine context. |
| evt | Event to process. |
| arg | Per event optional argument. |
Definition at line 2160 of file ocs_node.c.
| void* __ocs_node_wait_node_free | ( | ocs_sm_ctx_t * | ctx, |
| ocs_sm_event_t | evt, | ||
| void * | arg | ||
| ) |
Node state machine: Wait for a HAL node free event to complete.
State waits for the node free event to be received from the HAL.
| ctx | Remote node state machine context. |
| evt | Event to process. |
| arg | Per event optional argument. |
Definition at line 1189 of file ocs_node.c.
| int32_t node_check_ct_req | ( | ocs_sm_ctx_t * | ctx, |
| ocs_sm_event_t | evt, | ||
| void * | arg, | ||
| uint32_t | cmd, | ||
| ocs_node_common_func_t | node_common_func, | ||
| const char * | funcname | ||
| ) |
check CT request completion
Check ELS CY request completion event to make sure it's for the nameserver request we expect. If not, invoke given common event handler and return an error.
| ctx | state machine context |
| evt | ELS request event |
| arg | event argument |
| cmd | nameserver command expected |
| node_common_func | common event handler to call if nameserver cmd doesn't match |
| funcname | function name that called this |
Definition at line 1788 of file ocs_node.c.
| int32_t node_check_ct_resp | ( | ocs_sm_ctx_t * | ctx, |
| ocs_sm_event_t | evt, | ||
| void * | arg | ||
| ) |
Definition at line 1821 of file ocs_node.c.
| int32_t node_check_els_req | ( | ocs_sm_ctx_t * | ctx, |
| ocs_sm_event_t | evt, | ||
| void * | arg, | ||
| uint8_t | cmd, | ||
| ocs_node_common_func_t | node_common_func, | ||
| const char * | funcname | ||
| ) |
check ELS request completion
Check ELS request completion event to make sure it's for the ELS request we expect. If not, invoke given common event handler and return an error.
| ctx | state machine context |
| evt | ELS request event |
| arg | event argument |
| cmd | ELS command expected |
| node_common_func | common event handler to call if ELS doesn't match |
| funcname | function name that called this |
Definition at line 1738 of file ocs_node.c.
| int ocs_ddump_node | ( | ocs_textbuf_t * | textbuf, |
| ocs_node_t * | node | ||
| ) |
Generate node ddump data.
Generates the node ddumpdata
| textbuf | pointer to text buffer |
| node | pointer to node context |
Definition at line 1636 of file ocs_node.c.
|
inlinestatic |
accept frames
Unsolicited recieve frames processed rather than being held on the node pending frame list.
| node | pointer to node structure |
Definition at line 120 of file ocs_node.h.
| int ocs_node_active_ios_empty | ( | ocs_node_t * | node | ) |
Return TRUE if active ios list is empty.
Test if node->active_ios list is empty while holding the node->active_ios_lock.
| node | pointer to node object |
Definition at line 2117 of file ocs_node.c.
| void ocs_node_dump | ( | ocs_t * | ocs | ) |
| void ocs_node_force_free | ( | ocs_node_t * | node | ) |
free memory resources of a node object
The node object's child objects are freed after which the node object is freed.
| node | pointer to a node object |
Definition at line 608 of file ocs_node.c.
|
inlinestatic |
Definition at line 186 of file ocs_node.h.
|
inlinestatic |
hold frames in pending frame list
Unsolicited recieve frames are held on the node pending frame list, rather than being processed.
| node | pointer to node structure |
Definition at line 102 of file ocs_node.h.
| void ocs_node_initiate_cleanup | ( | ocs_node_t * | node | ) |
Initiate node IO cleanup.
Note: this function must be called with a non-attached node or a node for which the node detach (ocs_hal_node_detach()) has already been initiated.
| node | Node for which shutdown is initiated |
Definition at line 1025 of file ocs_node.c.
| int32_t ocs_node_is_remote_node | ( | ocs_remote_node_t * | rnode | ) |
Definition at line 2564 of file ocs_node.c.
|
inlinestatic |
Definition at line 149 of file ocs_node.h.
|
inlinestatic |
Definition at line 137 of file ocs_node.h.
|
inlinestatic |
Definition at line 131 of file ocs_node.h.
|
inlinestatic |
Definition at line 143 of file ocs_node.h.
| void ocs_node_pause | ( | ocs_node_t * | node, |
| ocs_sm_function_t | state | ||
| ) |
Pause a node.
The node is placed in the __ocs_node_paused state after saving the state to return to
| node | Pointer to node object |
| state | State to resume to |
Definition at line 2140 of file ocs_node.c.
| int32_t ocs_node_recv_link_services_frame | ( | ocs_node_t * | node, |
| ocs_hal_sequence_t * | seq | ||
| ) |
| int32_t ocs_node_resume | ( | ocs_node_t * | node | ) |
Resume a paused state.
Posts a resume event to the paused node.
| node | Pointer to node object |
Definition at line 2204 of file ocs_node.c.
| void ocs_node_send_ls_io_cleanup | ( | ocs_node_t * | node | ) |
cleans up an XRI for the pending link services accept by aborting the XRI if required.
This function is called when the LS accept is not sent.
| node | Node for which should be cleaned up |
Definition at line 779 of file ocs_node.c.
|
inlinestatic |
Definition at line 154 of file ocs_node.h.
| void ocs_node_update_display_name | ( | ocs_node_t * | node | ) |
update the node's display name
The node's display name is updated, sometimes needed because the sport part is updated after the node is allocated.
| node | pointer to the node object |
Definition at line 755 of file ocs_node.c.