#include "ocs.h"#include "ocs_device.h"#include "ocs_fabric.h"#include "ocs_els.h"#include "scsi_cmds.h"Go to the source code of this file.
Implement remote device state machine for target and initiator.
Definition in file ocs_device.c.
Functions | |
| static void * | __ocs_d_common (const char *funcname, ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Common device event handler. More... | |
| static void * | __ocs_d_wait_del_node (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| state: Wait for node resume event. More... | |
| static void * | __ocs_d_wait_del_ini_tgt (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| state: wait for node resume event More... | |
| static int32_t | ocs_process_abts (ocs_io_t *io, fc_header_t *hdr) |
| Process the ABTS. More... | |
| void | ocs_d_send_prli_rsp (ocs_io_t *io, uint16_t ox_id, uint8_t fc_type) |
| Send response to PRLI. More... | |
| void * | __ocs_d_initiate_shutdown (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Initiate node shutdown. More... | |
| void * | __ocs_d_wait_loop (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for a domain-attach completion in loop topology. More... | |
| void | ocs_send_ls_acc_after_attach (ocs_io_t *io, fc_header_t *hdr, ocs_node_send_ls_acc_e ls) |
| Save the OX_ID for sending LS_ACC sometime later. More... | |
| void | ocs_process_prli_payload (ocs_node_t *node, fc_prli_payload_t *prli) |
| Process the PRLI payload. More... | |
| void * | __ocs_d_wait_plogi_acc_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for the PLOGI accept to complete. More... | |
| void * | __ocs_d_wait_logo_rsp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for the LOGO response. More... | |
| void * | __ocs_d_wait_prlo_rsp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for the PRLO response. More... | |
| void | ocs_node_init_device (ocs_node_t *node, int send_plogi) |
| Initialize device node. More... | |
| void * | __ocs_d_init (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Initial node state for an initiator or a target. More... | |
| void * | __ocs_d_wait_plogi_rsp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait on a response for a sent PLOGI. More... | |
| void * | __ocs_d_wait_plogi_rsp_recvd_prli (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Waiting on a response for a sent PLOGI. More... | |
| void * | __ocs_d_wait_domain_attach (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for a domain attach. More... | |
| void * | __ocs_d_wait_topology_notify (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for topology notification. More... | |
| void * | __ocs_d_wait_node_attach (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for a node attach when found by a remote node. More... | |
| void * | __ocs_d_wait_attach_evt_shutdown (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for a node/domain attach then shutdown node. More... | |
| void * | __ocs_d_port_logged_in (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Port is logged in. More... | |
| void * | __ocs_d_wait_logo_acc_cmpl (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for a LOGO accept. More... | |
| void * | __ocs_d_device_ready (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Device is ready. More... | |
| void * | __ocs_d_device_gone (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Node is gone (absent from GID_PT). More... | |
| void * | __ocs_d_wait_adisc_rsp (ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg) |
| Device node state machine: Wait for the ADISC response. More... | |
| void ocs_node_init_device | ( | ocs_node_t * | node, |
| int | send_plogi | ||
| ) |
Initialize device node.
Initialize device node. If a node is an initiator, then send a PLOGI and transition to __ocs_d_wait_plogi_rsp, otherwise transition to __ocs_d_init.
| node | Pointer to the node object. |
| send_plogi | Boolean indicating to send PLOGI command or not. |
Definition at line 781 of file ocs_device.c.
|
static |
Process the ABTS.
Common code to process a received ABTS. If an active IO can be found that matches the OX_ID of the ABTS request, a call is made to the backend. Otherwise, a BA_ACC is returned to the initiator.
| io | Pointer to a SCSI IO object. |
| hdr | Pointer to the FC header. |
Definition at line 550 of file ocs_device.c.
| void ocs_process_prli_payload | ( | ocs_node_t * | node, |
| fc_prli_payload_t * | prli | ||
| ) |
Process the PRLI payload.
The PRLI payload is processed; the initiator/target capabilities of the remote node are extracted and saved in the node object.
| node | Pointer to the node object. |
| prli | Pointer to the PRLI payload. |
Definition at line 518 of file ocs_device.c.
| void ocs_send_ls_acc_after_attach | ( | ocs_io_t * | io, |
| fc_header_t * | hdr, | ||
| ocs_node_send_ls_acc_e | ls | ||
| ) |
Save the OX_ID for sending LS_ACC sometime later.
When deferring the response to an ELS request, the OX_ID of the request is saved using this function.
| io | Pointer to a SCSI IO object. |
| hdr | Pointer to the FC header. |
| ls | Defines the type of ELS to send: LS_ACC, LS_ACC for PLOGI; or LSS_ACC for PRLI. |
Definition at line 475 of file ocs_device.c.