emlxs_fcf.c revision 8f23e9fa8abcb5857661066b954e63400d589b65
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2004-2012 Emulex. All rights reserved.
* Use is subject to license terms.
*/
#include <emlxs.h>
/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */
/*
* STATE MACHINE RULES:
*
* - State change requests to an XXXX object when operating within
* an emlxs_XXXX state management function must be made
* using the emlxs_XXXX_state() call.
*
* - State change requests to an XXXX object when operating outside
* an emlxs_XXXX state management function must be made
* using the emlxs_XXXX_alloc(), emlxs_XXXX_free(), emlxs_XXXX_event()
* or emlxs_XXXX_..._notify() calls.
*
* - emlxs_XXXX_..._notify() calls are used by routines outside
* this fcf module to enter the state machine.
*
* - It is forbidden to make direct calls to emlxs_XXXX_...._action()
* functions. Only emlxs_XXXX_action() routines may make calls to
* emlxs_XXXX_...._action() functions.
*
* - Its is forbidden to make direct calls to emlxs_XXXX_action().
* Only emlxs_XXXX_state() and emlxs_XXXX_event() routines may make
* calls to emlxs_XXXX_action().
*
* - The EMLXS_FCF_LOCK must be held before calling:
* emlxs_XXXX_state(), emlxs_XXXX_event() and emlxs_XXXX_action().
*
* - All other calls touching fcftab, fcfi, vfi, vpi, rpi objects
* must hold the EMLXS_FCF_LOCK to protect these objects.
*/
/*
* DEBUG MESSAGE TERMINATION RULES:
*
* - A message should end in ">" if a thread operating outside the
* XXXX state machine enters the XXXX state machine with a call to
* emlxs_XXXX_event() or emlxs_XXXX_state(). This includes calls made
* from emlxs_..._notify(), emlxs_..._mbcmpl() and emlxs_..._timer()
* routines since they represent the beginnning of new threads.
*
* - A message should end in "<" if the thread is about exit
* an emlxs_XXXX_..._action() without previously calling the
* next emlxs_XXXX_state(). This includes the emlxs_XXXX_action()
* and emlxs_XXXX_state() routines themselves since errors
* in these routines represent the termination of state change
* thread.
*
* - A message should end in "." if none of the previous
* conditions apply.
*/
/* ************************************************************************** */
/* FCF Generic */
/* ************************************************************************** */
/*
* EVENT ARG1
* --------------------------------------------
* FCF_EVENT_STATE_ENTER None
*
* FCF_EVENT_LINKUP None
* FCF_EVENT_LINKDOWN None
* FCF_EVENT_CVL vpi
* FCF_EVENT_FCFTAB_FULL None
* FCF_EVENT_FCF_FOUND fcf_index
* FCF_EVENT_FCF_LOST fcf_index
* FCF_EVENT_FCF_CHANGED fcf_index
*
* FCF_EVENT_FCFI_ONLINE FCFIobj_t*
* FCF_EVENT_FCFI_OFFLINE FCFIobj_t*
* FCF_EVENT_FCFI_PAUSE FCFIobj_t*
*
* FCF_EVENT_VFI_ONLINE VFIobj_t*
* FCF_EVENT_VFI_OFFLINE VFIobj_t*
* FCF_EVENT_VFI_PAUSE VFIobj_t*
*
* FCF_EVENT_VPI_ONLINE VPIobj_t*
* FCF_EVENT_VPI_OFFLINE VPIobj_t*
* FCF_EVENT_VPI_PAUSE VPIobj_t*
*
* FCF_EVENT_RPI_ONLINE RPIobj_t*
* FCF_EVENT_RPI_OFFLINE RPIobj_t*
* FCF_EVENT_RPI_PAUSE RPIobj_t*
* FCF_EVENT_RPI_RESUME RPIobj_t*
* FCF_EVENT_RPI_TIMEOUT RPIobj_t*
*/
/* Order does not matter */
{
{FCF_EVENT_STATE_ENTER, "E_ENTER"},
{FCF_EVENT_SHUTDOWN, "E_SHUTDOWN"},
{FCF_EVENT_LINKUP, "E_LINKUP"},
{FCF_EVENT_LINKDOWN, "E_LINKDOWN"},
{FCF_EVENT_CVL, "E_CVL"},
{FCF_EVENT_FCFTAB_FULL, "E_TABLE_FULL"},
{FCF_EVENT_FCF_FOUND, "E_FCF_FOUND"},
{FCF_EVENT_FCF_LOST, "E_FCF_LOST"},
{FCF_EVENT_FCF_CHANGED, "E_FCF_CHANGED"},
{FCF_EVENT_FCFI_ONLINE, "E_FCFI_ONLINE"},
{FCF_EVENT_FCFI_OFFLINE, "E_FCFI_OFFLINE"},
{FCF_EVENT_FCFI_PAUSE, "E_FCFI_PAUSE"},
{FCF_EVENT_VFI_ONLINE, "E_VFI_ONLINE"},
{FCF_EVENT_VFI_OFFLINE, "E_VFI_OFFLINE"},
{FCF_EVENT_VFI_PAUSE, "E_VFI_PAUSE"},
{FCF_EVENT_VPI_ONLINE, "E_VPI_ONLINE"},
{FCF_EVENT_VPI_OFFLINE, "E_VPI_OFFLINE"},
{FCF_EVENT_VPI_PAUSE, "E_VPI_PAUSE"},
{FCF_EVENT_RPI_ONLINE, "E_RPI_ONLINE"},
{FCF_EVENT_RPI_OFFLINE, "E_RPI_OFFLINE"},
{FCF_EVENT_RPI_PAUSE, "E_RPI_PAUSE"},
{FCF_EVENT_RPI_RESUME, "E_RPI_RESUME"},
}; /* emlxs_fcf_event_table */
/* Order does not matter */
{
{FCF_REASON_NONE, "R_NONE"},
{FCF_REASON_REENTER, "R_REENTER"},
{FCF_REASON_EVENT, "R_EVENT"},
{FCF_REASON_REQUESTED, "R_REQUESTED"},
{FCF_REASON_NO_MBOX, "R_NO_MBOX"},
{FCF_REASON_NO_BUFFER, "R_NO_BUFFER"},
{FCF_REASON_SEND_FAILED, "R_SEND_FAILED"},
{FCF_REASON_MBOX_FAILED, "R_MBOX_FAILED"},
{FCF_REASON_MBOX_BUSY, "R_MBOX_BUSY"},
{FCF_REASON_NO_FCFI, "R_NO_FCFI"},
{FCF_REASON_NO_VFI, "R_NO_VFI"},
{FCF_REASON_ONLINE_FAILED, "R_ONLINE_FAILED"},
{FCF_REASON_OFFLINE_FAILED, "R_OFFLINE_FAILED"},
{FCF_REASON_OP_FAILED, "R_OP_FAILED"},
{FCF_REASON_NO_PKT, "R_NO_PKT"},
{FCF_REASON_NO_NODE, "R_NO_NODE"},
{FCF_REASON_NOT_ALLOWED, "R_NOT_ALLOWED"},
{FCF_REASON_UNUSED, "R_UNUSED"},
{FCF_REASON_INVALID, "R_INVALID"},
}; /* emlxs_fcf_reason_table */
/* ********************************************************************** */
/* FCFTAB Generic */
/* ********************************************************************** */
void *arg1);
/* ********************************************************************** */
/* FC FCFTAB */
/* ********************************************************************** */
/* Order does not matter */
{
{FC_FCFTAB_STATE_SHUTDOWN, "FCFTAB_SHUTDOWN"},
{FC_FCFTAB_STATE_OFFLINE, "FCFTAB_OFFLINE"},
{FC_FCFTAB_STATE_TOPO, "FCFTAB_TOPO"},
{FC_FCFTAB_STATE_TOPO_FAILED, "FCFTAB_TOPO_FAILED"},
{FC_FCFTAB_STATE_TOPO_CMPL, "FCFTAB_TOPO_CMPL"},
{FC_FCFTAB_STATE_CFGLINK, "FCFTAB_CFGLINK"},
{FC_FCFTAB_STATE_CFGLINK_FAILED, "FCFTAB_CFGLINK_FAILED"},
{FC_FCFTAB_STATE_CFGLINK_CMPL, "FCFTAB_CFGLINK_CMPL"},
{FC_FCFTAB_STATE_SPARM, "FCFTAB_SPARM"},
{FC_FCFTAB_STATE_SPARM_FAILED, "FCFTAB_SPARM_FAILED"},
{FC_FCFTAB_STATE_SPARM_CMPL, "FCFTAB_SPARM_CMPL"},
"FCFTAB_FCFI_OFFLINE_CMPL"},
{FC_FCFTAB_STATE_FCFI_OFFLINE, "FCFTAB_FCFI_OFFLINE"},
{FC_FCFTAB_STATE_FCFI_ONLINE, "FCFTAB_FCFI_ONLINE"},
{FC_FCFTAB_STATE_FCFI_ONLINE_CMPL, "FCFTAB_FCFI_ONLINE_CMPL"},
{FC_FCFTAB_STATE_ONLINE, "FCFTAB_ONLINE"},
}; /* emlxs_fc_fcftab_state_table */
/*
* - Online sequencing can start from FC_FCFTAB_STATE_OFFLINE state
*
* - Offline sequencing can interrupt the online sequencing at the
* entry of the next wait state.
*
* NORMAL ONLINE SEQ
* ---------------------------
* LINK_UP event <-- Adapter
* FC_FCFTAB_STATE_OFFLINE
* FC_FCFTAB_STATE_TOPO
* FC_FCFTAB_STATE_TOPO_CMPL
* FC_FCFTAB_STATE_CFGLINK
* FC_FCFTAB_STATE_CFGLINK_CMPL
* FC_FCFTAB_STATE_SPARM
* FC_FCFTAB_STATE_SPARM_CMPL
* FC_FCFTAB_STATE_FCFI_ONLINE
* FC_FCFTAB_STATE_FCFI_ONLINE_CMPL
* FC_FCFTAB_STATE_ONLINE
*
*
* NORMAL OFFLINE SEQ
* ---------------------------
* LINK_DOWN event <-- Adapter
* FC_FCFTAB_STATE_ONLINE
* FC_FCFTAB_STATE_FCFI_OFFLINE
* FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL
* FC_FCFTAB_STATE_OFFLINE
*
*/
/* Order does matter */
static void *emlxs_fc_fcftab_action_table[] =
{
/* Action routine Event */
/* FC_FCFTAB_STATE_SHUTDOWN 0 (Requires adapter reset) */
(void *) emlxs_fcftab_shutdown_action, /* STATE_ENTER */
(void *) NULL, /* SHUTDOWN */
(void *) NULL, /* LINK_UP */
(void *) NULL, /* LINK_DOWN */
(void *) NULL, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_OFFLINE 1 (Wait for LINK_UP event) */
(void *) emlxs_fc_fcftab_offline_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_TOPO 2 (Wait for topo mbcmpl) */
(void *) emlxs_fc_fcftab_topo_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_TOPO_FAILED 3 (Transitional) */
(void *) emlxs_fc_fcftab_topo_failed_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_TOPO_CMPL 4 (Transitional) */
(void *) emlxs_fc_fcftab_topo_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_CFGLINK 5 (Wait for cfglink mbcmpl) */
(void *) emlxs_fc_fcftab_cfglink_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_CFGLINK_FAILED 6 (Transitional) */
(void *) emlxs_fc_fcftab_cfglink_failed_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_CFGLINK_CMPL 7 (Transitional) */
(void *) emlxs_fc_fcftab_cfglink_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_SPARM 8 (Wait for sparm mbcmpl) */
(void *) emlxs_fc_fcftab_sparm_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_SPARM_FAILED 9 (Transitional) */
(void *) emlxs_fc_fcftab_sparm_failed_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_SPARM_CMPL 10 (Transitional) */
(void *) emlxs_fc_fcftab_sparm_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL 11 (Transitional) */
(void *) emlxs_fc_fcftab_fcfi_offline_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_FCFI_OFFLINE 12 (Wait for FCFI_OFFLINE event) */
(void *) emlxs_fc_fcftab_fcfi_offline_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_FCFI_ONLINE 13 (Wait for FCFI_ONLINE event) */
(void *) emlxs_fc_fcftab_fcfi_online_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_FCFI_ONLINE_CMPL 14 (Transitional) */
(void *) emlxs_fc_fcftab_fcfi_online_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FC_FCFTAB_STATE_ONLINE 15 (Wait for LINK_DOWN evt) */
(void *) emlxs_fc_fcftab_online_action, /* STATE_ENTER */
(void *) emlxs_fc_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fc_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fc_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fc_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fc_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
}; /* emlxs_fc_fcftab_action_table[] */
#define FC_FCFTAB_ACTION_EVENTS 6
#define FC_FCFTAB_ACTION_STATES \
(sizeof (emlxs_fc_fcftab_action_table)/ \
(FC_FCFTAB_ACTION_EVENTS * sizeof (void *)))
/* ********************************************************************** */
/* FCOE FCFTAB */
/* ********************************************************************** */
/* Order does not matter */
{
{FCOE_FCFTAB_STATE_SHUTDOWN, "FCFTAB_SHUTDOWN"},
{FCOE_FCFTAB_STATE_OFFLINE, "FCFTAB_OFFLINE"},
{FCOE_FCFTAB_STATE_SOLICIT, "FCFTAB_SOLICIT"},
{FCOE_FCFTAB_STATE_SOLICIT_FAILED, "FCFTAB_SOLICIT_FAILED"},
{FCOE_FCFTAB_STATE_SOLICIT_CMPL, "FCFTAB_SOLICIT_CMPL"},
{FCOE_FCFTAB_STATE_READ, "FCFTAB_READ"},
{FCOE_FCFTAB_STATE_READ_FAILED, "FCFTAB_READ_FAILED"},
{FCOE_FCFTAB_STATE_READ_CMPL, "FCFTAB_READ_CMPL"},
"FCFTAB_FCFI_OFFLINE_CMPL"},
{FCOE_FCFTAB_STATE_FCFI_OFFLINE, "FCFTAB_FCFI_OFFLINE"},
{FCOE_FCFTAB_STATE_FCFI_ONLINE, "FCFTAB_FCFI_ONLINE"},
"FCFTAB_FCFI_ONLINE_CMPL"},
{FCOE_FCFTAB_STATE_ONLINE, "FCFTAB_ONLINE"},
}; /* emlxs_fcoe_fcftab_state_table */
/*
* - Online sequencing can start from FCOE_FCFTAB_STATE_OFFLINE state
*
* - Offline sequencing can interrupt the online sequencing at the
* entry of the next wait state.
*
* NORMAL ONLINE SEQ
* ---------------------------
* LINK_UP event <-- Adapter
* FCOE_FCFTAB_STATE_OFFLINE
* FCOE_FCFTAB_STATE_SOLICIT
* FCOE_FCFTAB_STATE_SOLICIT_CMPL
* FCOE_FCFTAB_STATE_READ
* FCOE_FCFTAB_STATE_READ_CMPL
* FCOE_FCFTAB_STATE_FCFI_OFFLINE
* FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL
* FCOE_FCFTAB_STATE_FCFI_ONLINE
* FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL
* FCOE_FCFTAB_STATE_ONLINE
*
*
* NORMAL OFFLINE SEQ
* ---------------------------
* LINK_DOWN event <-- Adapter
* FCOE_FCFTAB_STATE_ONLINE
* FCOE_FCFTAB_STATE_FCFI_OFFLINE
* FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL
* FCOE_FCFTAB_STATE_OFFLINE
*
*/
/* Order does matter */
static void *emlxs_fcoe_fcftab_action_table[] =
{
/* Action routine Event */
/* FCOE_FCFTAB_STATE_SHUTDOWN 0 (Requires adapter reset) */
(void *) emlxs_fcftab_shutdown_action, /* STATE_ENTER */
(void *) NULL, /* SHUTDOWN */
(void *) NULL, /* LINK_UP */
(void *) NULL, /* LINK_DOWN */
(void *) NULL, /* CVL_RECD */
(void *) NULL, /* FCF_FOUND */
(void *) NULL, /* FCF_LOST */
(void *) NULL, /* FCF_CHANGED */
(void *) NULL, /* TABLE_FULL */
(void *) NULL, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_OFFLINE 1 (Wait for LINK_UP event) */
(void *) emlxs_fcoe_fcftab_offline_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_SOLICIT 2 (Wait on fcf_solicit cmpl) */
(void *) emlxs_fcoe_fcftab_sol_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_SOLICIT_FAILED 3 (Transitional) */
(void *) emlxs_fcoe_fcftab_sol_failed_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_SOLICIT_CMPL 4 (Wait on fcf timer cmpl) */
(void *) emlxs_fcoe_fcftab_sol_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_READ 5 (Wait on fcf_read cmpl) */
(void *) emlxs_fcoe_fcftab_read_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_READ_FAILED 6 (Transitional) */
(void *) emlxs_fcoe_fcftab_read_failed_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_READ_CMPL 7 (Transitional) */
(void *) emlxs_fcoe_fcftab_read_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL 8 (Transitional) */
(void *) emlxs_fcoe_fcftab_fcfi_offline_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_FCFI_OFFLINE 9 (Wait for FCFI_OFFLINE event) */
(void *) emlxs_fcoe_fcftab_fcfi_offline_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_FCFI_ONLINE 10 (Wait on FCFI_ONLINE event) */
(void *) emlxs_fcoe_fcftab_fcfi_online_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL 11 (Transitional) */
(void *) emlxs_fcoe_fcftab_fcfi_online_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCOE_FCFTAB_STATE_ONLINE 12 (Wait for LINK_DOWN event) */
(void *) emlxs_fcoe_fcftab_online_action, /* STATE_ENTER */
(void *) emlxs_fcoe_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcoe_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcoe_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcoe_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcoe_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcoe_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcoe_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcoe_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcoe_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcoe_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
}; /* emlxs_fcoe_fcftab_action_table[] */
#define FCOE_FCFTAB_ACTION_EVENTS 11
#define FCOE_FCFTAB_ACTION_STATES \
(sizeof (emlxs_fcoe_fcftab_action_table)/ \
(FCOE_FCFTAB_ACTION_EVENTS * sizeof (void *)))
/* ********************************************************************** */
/* FCFI */
/* ********************************************************************** */
/* Order does not matter */
{
{FCFI_STATE_FREE, "FCFI_FREE"},
{FCFI_STATE_OFFLINE, "FCFI_OFFLINE"},
{FCFI_STATE_UNREG_CMPL, "FCFI_UNREG_CMPL"},
{FCFI_STATE_UNREG_FAILED, "FCFI_UNREG_FAILED"},
{FCFI_STATE_UNREG, "FCFI_UNREG"},
{FCFI_STATE_REG, "FCFI_REG"},
{FCFI_STATE_REG_FAILED, "FCFI_REG_FAILED"},
{FCFI_STATE_REG_CMPL, "FCFI_REG_CMPL"},
{FCFI_STATE_VFI_OFFLINE_CMPL, "FCFI_VFI_OFFLINE_CMPL"},
{FCFI_STATE_VFI_OFFLINE, "FCFI_VFI_OFFLINE"},
{FCFI_STATE_VFI_ONLINE, "FCFI_VFI_ONLINE"},
{FCFI_STATE_VFI_ONLINE_CMPL, "FCFI_VFI_ONLINE_CMPL"},
{FCFI_STATE_PAUSED, "FCFI_PAUSED"},
{FCFI_STATE_ONLINE, "FCFI_ONLINE"},
}; /* emlxs_fcfi_state_table */
/*
* - Online sequencing can start from FCFI_STATE_OFFLINE state or
* the FCFI_STATE_VFI_OFFLINE state.
*
* - Offline sequencing can interrupt the online sequencing at the
* entry of the next wait state.
*
* NORMAL ONLINE SEQ
* ---------------------------
* FCFI_ONLINE event <-- FCFTAB
* FCFI_STATE_OFFLINE
* FCFI_STATE_REG
* FCFI_STATE_REG_CMPL
* FCFI_STATE_VFI_ONLINE
* FCFI_STATE_VFI_ONLINE_CMPL
* FCFI_STATE_ONLINE
* FCFI_ONLINE event-->FCFTAB
*
*
* NORMAL OFFLINE SEQ
* ---------------------------
* FCFI_OFFLINE event <-- FCFTAB
* FCFI_STATE_ONLINE
* FCFI_STATE_VFI_OFFLINE
* FCFI_STATE_VFI_OFFLINE_CMPL
* FCFI_STATE_UNREG
* FCFI_STATE_UNREG_CMPL
* FCFI_STATE_OFFLINE
* FCFI_OFFLINE event-->FCFTAB
*
*
* NORMAL PAUSE SEQ
* ---------------------------
* FCFI_PAUSE event <-- FCFTAB
* FCFI_STATE_ONLINE
* FCFI_STATE_PAUSED
*
*/
/* Order does matter */
static void *emlxs_fcfi_action_table[] =
{
/* Action routine Event */
/* FCFI_STATE_FREE 0 (Wait for allocation) */
(void *) emlxs_fcfi_free_action, /* STATE_ENTER */
(void *) NULL, /* FCFI_ONLINE */
(void *) NULL, /* FCFI_OFFLINE */
(void *) NULL, /* FCFI_PAUSE */
(void *) NULL, /* VFI_ONLINE */
(void *) NULL, /* VFI_OFFLINE */
/* FCFI_STATE_OFFLINE 1 (Wait for FCFI_ONLINE event) */
(void *) emlxs_fcfi_offline_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_UNREG_CMPL 2 (Transitional) */
(void *) emlxs_fcfi_unreg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_UNREG_FAILED 3 (Transitional) */
(void *) emlxs_fcfi_unreg_failed_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_UNREG 4 (Wait for unreg_fcfi cmpl) */
(void *) emlxs_fcfi_unreg_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_REG 5 (Wait for reg_fcfi cmpl) */
(void *) emlxs_fcfi_reg_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_REG_FAILED 6 (Transitional) */
(void *) emlxs_fcfi_reg_failed_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_REG_CMPL 7 (Transitional) */
(void *) emlxs_fcfi_reg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_VFI_OFFLINE_CMPL 8 (Transitional) */
(void *) emlxs_fcfi_vfi_offline_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_VFI_OFFLINE 9 (Wait for VFI_OFFLINE event) */
(void *) emlxs_fcfi_vfi_offline_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE * */
/* FCFI_STATE_VFI_ONLINE 10 (Wait for VFI_ONLINE event) */
(void *) emlxs_fcfi_vfi_online_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_VFI_ONLINE_CMPL 11 (Transitional) */
(void *) emlxs_fcfi_vfi_online_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_PAUSED 12 (Wait for FCFI_ONLINE event) */
(void *) emlxs_fcfi_paused_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
/* FCFI_STATE_ONLINE 13 (Wait for FCFI_OFFLINE event) */
(void *) emlxs_fcfi_online_action, /* STATE_ENTER */
(void *) emlxs_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcfi_offline_evt_action, /* FCFI_OFFLINE */
(void *) emlxs_fcfi_pause_evt_action, /* FCFI_PAUSE */
(void *) emlxs_fcfi_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_fcfi_vfi_offline_evt_action, /* VFI_OFFLINE */
}; /* emlxs_fcfi_action_table[] */
#define FCFI_ACTION_EVENTS 6
#define FCFI_ACTION_STATES \
(sizeof (emlxs_fcfi_action_table)/ \
(FCFI_ACTION_EVENTS * sizeof (void *)))
/* ********************************************************************** */
/* VFI */
/* ********************************************************************** */
/* Order does not matter */
{
{VFI_STATE_OFFLINE, "VFI_OFFLINE"},
{VFI_STATE_INIT, "VFI_INIT"},
{VFI_STATE_INIT_FAILED, "VFI_INIT_FAILED"},
{VFI_STATE_INIT_CMPL, "VFI_INIT_CMPL"},
{VFI_STATE_VPI_OFFLINE_CMPL, "VFI_VPI_OFFLINE_CMPL"},
{VFI_STATE_VPI_OFFLINE, "VFI_VPI_OFFLINE"},
{VFI_STATE_VPI_ONLINE, "VFI_VPI_ONLINE"},
{VFI_STATE_VPI_ONLINE_CMPL, "VFI_VPI_ONLINE_CMPL"},
{VFI_STATE_UNREG_CMPL, "VFI_UNREG_CMPL"},
{VFI_STATE_UNREG_FAILED, "VFI_UNREG_FAILED"},
{VFI_STATE_UNREG, "VFI_UNREG"},
{VFI_STATE_REG, "VFI_REG"},
{VFI_STATE_REG_FAILED, "VFI_REG_FAILED"},
{VFI_STATE_REG_CMPL, "VFI_REG_CMPL"},
{VFI_STATE_PAUSED, "VFI_PAUSED"},
{VFI_STATE_ONLINE, "VFI_ONLINE"},
}; /* emlxs_vfi_state_table */
/*
* - Online sequencing can start from VFI_STATE_OFFLINE state or
* the VFI_STATE_VPI_OFFLINE state.
*
* - Offline sequencing can interrupt the online sequencing at the
* entry of the next wait state.
*
* NORMAL ONLINE SEQ
* ---------------------------
* VFI_ONLINE event <-- FCFI
* VFI_STATE_OFFLINE
* VFI_STATE_INIT
* VFI_STATE_INIT_CMPL
* VFI_STATE_VPI_ONLINE
* VFI_STATE_VPI_ONLINE_CMPL
* VFI_STATE_REG
* VFI_STATE_REG_CMPL
* VFI_STATE_ONLINE
* VFI_ONLINE event-->FCFI
*
*
* NORMAL OFFLINE SEQ
* ---------------------------
* VFI_OFFLINE event <-- FCFI
* VFI_STATE_ONLINE
* VFI_STATE_VPI_OFFLINE
* VFI_STATE_VPI_OFFLINE_CMPL
* VFI_STATE_UNREG
* VFI_STATE_UNREG_CMPL
* VFI_STATE_OFFLINE
* VFI_OFFLINE event-->FCFI
*
*
* NORMAL PAUSE SEQ
* ---------------------------
* VFI_PAUSE event <-- FCFI
* VFI_STATE_ONLINE
* VFI_STATE_PAUSED
*
*/
/* Order does matter */
static void *emlxs_vfi_action_table[] =
{
/* Action routine Event */
/* VFI_STATE_OFFLINE 0 (Wait for VFI_ONLINE event) */
(void *) emlxs_vfi_offline_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_INIT 1 (Wait for init_vfi cmpl) */
(void *) emlxs_vfi_init_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_INIT_FAILED 2 (Transitional) */
(void *) emlxs_vfi_init_failed_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_INIT_CMPL 3 (Transitional) */
(void *) emlxs_vfi_init_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_VPI_OFFLINE_CMPL 4 (Wait for VPI_OFFLINE event) */
(void *) emlxs_vfi_vpi_offline_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_VPI_OFFLINE 5 (Wait for VPI_OFFLINE event) */
(void *) emlxs_vfi_vpi_offline_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_VPI_ONLINE 6 (Wait for VPI_ONLINE event) */
(void *) emlxs_vfi_vpi_online_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_VPI_ONLINE_CMPL 7 (Transitional) */
(void *) emlxs_vfi_vpi_online_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_UNREG_CMPL 8 (Transitional) */
(void *) emlxs_vfi_unreg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_UNREG_FAILED 9 (Transitional) */
(void *) emlxs_vfi_unreg_failed_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_UNREG 10 (Wait for unreg_vfi cmpl) */
(void *) emlxs_vfi_unreg_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_REG 11 (Wait for reg_vfi cmpl) */
(void *) emlxs_vfi_reg_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_REG_FAILED 12 (Transitional) */
(void *) emlxs_vfi_reg_failed_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_REG_CMPL 13 (Transitional) */
(void *) emlxs_vfi_reg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_PAUSED 14 (Wait for VFI_OFFLINE event) */
(void *) emlxs_vfi_paused_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
/* VFI_STATE_ONLINE 14 (Wait for VFI_OFFLINE event) */
(void *) emlxs_vfi_online_action, /* STATE_ENTER */
(void *) emlxs_vfi_online_evt_action, /* VFI_ONLINE */
(void *) emlxs_vfi_offline_evt_action, /* VFI_OFFLINE */
(void *) emlxs_vfi_pause_evt_action, /* VFI_PAUSE */
(void *) emlxs_vfi_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vfi_vpi_offline_evt_action, /* VPI_OFFLINE */
}; /* emlxs_vfi_action_table[] */
#define VFI_ACTION_EVENTS 6
#define VFI_ACTION_STATES \
(sizeof (emlxs_vfi_action_table)/ \
(VFI_ACTION_EVENTS * sizeof (void *)))
/* ********************************************************************** */
/* VPI */
/* ********************************************************************** */
/* Order does not matter */
{
{VPI_STATE_OFFLINE, "VPI_OFFLINE"},
{VPI_STATE_INIT, "VPI_INIT"},
{VPI_STATE_INIT_FAILED, "VPI_INIT_FAILED"},
{VPI_STATE_INIT_CMPL, "VPI_INIT_CMPL"},
{VPI_STATE_UNREG_CMPL, "VPI_UNREG_CMPL"},
{VPI_STATE_UNREG_FAILED, "VPI_UNREG_FAILED"},
{VPI_STATE_UNREG, "VPI_UNREG"},
{VPI_STATE_LOGO_CMPL, "VPI_LOGO_CMPL"},
{VPI_STATE_LOGO_FAILED, "VPI_LOGO_FAILED"},
{VPI_STATE_LOGO, "VPI_LOGO"},
{VPI_STATE_PORT_OFFLINE, "VPI_PORT_OFFLINE"},
{VPI_STATE_PORT_ONLINE, "VPI_PORT_ONLINE"},
{VPI_STATE_LOGI, "VPI_LOGI"},
{VPI_STATE_LOGI_FAILED, "VPI_LOGI_FAILED"},
{VPI_STATE_LOGI_CMPL, "VPI_LOGI_CMPL"},
{VPI_STATE_REG, "VPI_REG"},
{VPI_STATE_REG_FAILED, "VPI_REG_FAILED"},
{VPI_STATE_REG_CMPL, "VPI_REG_CMPL"},
{VPI_STATE_PAUSED, "VPI_PAUSED"},
{VPI_STATE_ONLINE, "VPI_ONLINE"},
}; /* emlxs_vpi_state_table */
/*
* - Online sequencing can only start from VPI_STATE_OFFLINE or
* VPI_STATE_PORT_OFFLINE state.
*
* - Offline sequencing can interrupt the online sequencing at the
* entry of the next wait state.
*
* NORMAL ONLINE SEQ
* ---------------------------
* VPI_ONLINE event <-- VFI
* VPI_STATE_OFFLINE
* VPI_STATE_INIT
* VPI_STATE_INIT_CMPL
* VPI_STATE_PORT_ONLINE
* VPI_STATE_LOGI
* VPI_STATE_LOGI_CMPL
* VPI_STATE_REG
* VPI_STATE_REG_CMPL
* VPI_STATE_ONLINE
* VPI_ONLINE event-->VFI
*
*
* NORMAL OFFLINE SEQ
* ---------------------------
* VPI_OFFLINE event <-- VFI
* VPI_STATE_ONLINE
* VPI_STATE_PORT_OFFLINE
* VPI_STATE_LOGO
* VPI_STATE_LOGO_CMPL
* VPI_STATE_UNREG
* VPI_STATE_UNREG_CMPL
* VPI_STATE_OFFLINE
* VPI_OFFLINE event-->VFI
*
*
* NORMAL PAUSE SEQ
* ---------------------------
* VPI_PAUSE event <-- VFI
* VPI_STATE_ONLINE
* VPI_STATE_PORT_OFFLINE
* VPI_STATE_PAUSED
*
*/
/* Order does matter */
static void *emlxs_vpi_action_table[] =
{
/* Action routine Event */
/* VPI_STATE_OFFLINE 0 (Wait for VPI_ONLINE event) */
(void *) emlxs_vpi_offline_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_INIT 1 (Wait for init_vpi cmpl) */
(void *) emlxs_vpi_init_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_INIT_FAILED 2 (Transitional) */
(void *) emlxs_vpi_init_failed_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_INIT_CMPL 3 (Transitional) */
(void *) emlxs_vpi_init_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_UNREG_CMPL 4 (Transitional) */
(void *) emlxs_vpi_unreg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_UNREG_FAILED 5 (Transitional) */
(void *) emlxs_vpi_unreg_failed_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_UNREG 6 (Wait for unreg_vpi cmpl) */
(void *) emlxs_vpi_unreg_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_LOGO_CMPL 7 (Transitional) */
(void *) emlxs_vpi_logo_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_LOGO_FAILED 8 (Transitional) */
(void *) emlxs_vpi_logo_failed_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_LOGO 9 (Transitional) */
(void *) emlxs_vpi_logo_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_PORT_OFFLINE 10 (Wait for RPI_OFFLINE or VPI_ONLINE) */
(void *) emlxs_vpi_port_offline_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_PORT_ONLINE 11 (Wait for emlxs_vpi_logi_notify() ) */
(void *) emlxs_vpi_port_online_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_LOGI 12 (Wait for emlxs_vpi_logi_cmpl_notify() ) */
(void *) emlxs_vpi_logi_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_LOGI_FAILED 13 (Transitional) */
(void *) emlxs_vpi_logi_failed_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_LOGI_CMPL 14 (Transitional) */
(void *) emlxs_vpi_logi_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_REG 15 (Wait for reg_vpi cmpl) */
(void *) emlxs_vpi_reg_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_REG_FAILED 16 (Transitional) */
(void *) emlxs_vpi_reg_failed_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_REG_CMPL 17 (Transitional) */
(void *) emlxs_vpi_reg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_PAUSED 18 (Wait for VPI_ONLINE() ) */
(void *) emlxs_vpi_paused_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
/* VPI_STATE_ONLINE 19 (Wait for VPI_OFFLINE event) */
(void *) emlxs_vpi_online_action, /* STATE_ENTER */
(void *) emlxs_vpi_online_evt_action, /* VPI_ONLINE */
(void *) emlxs_vpi_offline_evt_action, /* VPI_OFFLINE */
(void *) emlxs_vpi_pause_evt_action, /* VPI_PAUSE */
(void *) emlxs_vpi_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_vpi_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_vpi_rpi_pause_evt_action, /* RPI_PAUSE */
}; /* emlxs_vpi_action_table() */
#define VPI_ACTION_EVENTS 7
#define VPI_ACTION_STATES \
(sizeof (emlxs_vpi_action_table)/ \
(VPI_ACTION_EVENTS * sizeof (void *)))
/* ********************************************************************** */
/* RPI */
/* ********************************************************************** */
/* Order does not matter */
{
{RPI_STATE_FREE, "RPI_FREE"},
{RPI_STATE_RESERVED, "RPI_RESERVED"},
{RPI_STATE_OFFLINE, "RPI_OFFLINE"},
{RPI_STATE_UNREG_CMPL, "RPI_UNREG_CMPL"},
{RPI_STATE_UNREG_FAILED, "RPI_UNREG_FAILED"},
{RPI_STATE_UNREG, "RPI_UNREG"},
{RPI_STATE_REG, "RPI_REG"},
{RPI_STATE_REG_FAILED, "RPI_REG_FAILED"},
{RPI_STATE_REG_CMPL, "RPI_REG_CMPL"},
{RPI_STATE_PAUSED, "RPI_PAUSED"},
{RPI_STATE_RESUME, "RPI_RESUME"},
{RPI_STATE_RESUME_FAILED, "RPI_RESUME_FAILED"},
{RPI_STATE_RESUME_CMPL, "RPI_RESUME_CMPL"},
{RPI_STATE_ONLINE, "RPI_ONLINE"},
}; /* emlxs_rpi_state_table */
void *arg1);
/*
* - Online sequencing can start from RPI_STATE_RESERVED state or
* the RPI_STATE_PAUSED state.
*
* - Offline sequencing can interrupt the online sequencing at the
* entry of the next wait state.
*
* NORMAL ONLINE SEQ
* ---------------------------
* RPI_ONLINE event <-- VPI
* RPI_STATE_RESERVED
* RPI_STATE_REG
* RPI_STATE_REG_CMPL
* RPI_STATE_ONLINE
* RPI_ONLINE event-->VPI
*
*
* NORMAL OFFLINE SEQ
* ---------------------------
* RPI_OFFLINE event <-- VPI
* RPI_STATE_ONLINE
* RPI_STATE_UNREG
* RPI_STATE_UNREG_CMPL
* RPI_STATE_OFFLINE
* RPI_OFFLINE event-->VPI
*
*
* NORMAL PAUSE SEQ
* ---------------------------
* RPI_PAUSE event <-- VPI
* RPI_STATE_ONLINE
* RPI_STATE_PAUSED
*
*/
/* Order does matter */
static void *emlxs_rpi_action_table[] =
{
/* Action routine Event */
/* RPI_STATE_FREE 0 (Wait for allocation) */
(void *) emlxs_rpi_free_action, /* STATE_ENTER */
(void *) NULL, /* RPI_ONLINE */
(void *) NULL, /* RPI_OFFLINE */
(void *) NULL, /* RPI_PAUSE */
(void *) NULL, /* RPI_RESUME */
/* RPI_STATE_RESERVED 1 (Wait for RPI_ONLINE event) */
(void *) emlxs_rpi_reserved_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_OFFLINE 2 (Transitional) */
(void *) emlxs_rpi_offline_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_UNREG_CMPL 3 (Transitional) */
(void *) emlxs_rpi_unreg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_UNREG_FAILED 4 (Transitional) */
(void *) emlxs_rpi_unreg_failed_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_UNREG 5 (Wait for unreg_rpi cmpl) */
(void *) emlxs_rpi_unreg_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_REG 6 (Wait for reg_rpi cmpl) */
(void *) emlxs_rpi_reg_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_REG_FAILED 7 (Transitional) */
(void *) emlxs_rpi_reg_failed_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_REG_CMPL 8 (Transitional) */
(void *) emlxs_rpi_reg_cmpl_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_PAUSED 9 (Wait for RPI_ONLINE) */
(void *) emlxs_rpi_paused_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_RESUME 10 (Wait for resume_rpi mbcmpl) */
(void *) emlxs_rpi_resume_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_RESUME_FAILED 11 (Transitional) */
(void *) emlxs_rpi_resume_failed_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_RESUME_CMPL 12 (Transitional) */
(void *) emlxs_rpi_resume_cmpl_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
/* RPI_STATE_ONLINE 13 (Wait for RPI_OFFLINE event) */
(void *) emlxs_rpi_online_action, /* STATE_ENTER */
(void *) emlxs_rpi_online_evt_action, /* RPI_ONLINE */
(void *) emlxs_rpi_offline_evt_action, /* RPI_OFFLINE */
(void *) emlxs_rpi_pause_evt_action, /* RPI_PAUSE */
(void *) emlxs_rpi_resume_evt_action, /* RPI_RESUME */
}; /* emlxs_rpi_action_table[] */
#define RPI_ACTION_EVENTS 5
#define RPI_ACTION_STATES \
(sizeof (emlxs_rpi_action_table)/ \
(RPI_ACTION_EVENTS * sizeof (void *)))
/* ************************************************************************** */
/* FCF Generic */
/* ************************************************************************** */
static void
{
return;
}
return;
}
hba->discovery_timer = 0;
hba->linkup_timer = 0;
return;
} /* emlxs_fcf_linkdown() */
static void
{
return;
}
return;
}
/* Check for any mode changes */
return;
} /* emlxs_fcf_linkup() */
extern void
{
uint32_t i;
return;
}
"fcf_fini: %s flag=%x fcfi_online=%d.",
}
/* Free the FCF memory */
fcftab->table_count = 0;
/* Free the VFI memory */
/* Free the VPI Fabric RPI's */
for (i = 0; i < MAX_VPORTS; i++) {
continue;
}
}
/* Free the RPI memory */
continue;
}
}
/* Free the mutex */
return;
} /* emlxs_fcf_fini() */
extern void
{
uint16_t i;
return;
}
/* FCFTAB */
/* FCFI */
}
/* VFI */
}
/* VPI */
for (i = 0; i < MAX_VPORTS; i++) {
/* Init the Fabric RPI's */
}
/* RPI */
}
"fcf_init: %s flag=%x fcfi=%d vfi=%d vpi=%d rpi=%d.",
return;
} /* emlxs_fcf_init() */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_fcf_event_table[i].string);
}
}
return (buffer);
} /* emlxs_fcf_event_xlate() */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_fcf_reason_table[i].string);
}
}
return (buffer);
} /* emlxs_fcf_reason_xlate() */
extern void
{
return;
}
return;
}
if (SLI4_FCOE_MODE) {
} else {
}
return;
} /* emlxs_fcf_timer_notify() */
extern uint32_t
{
uint32_t i;
return (1);
}
return (1);
}
return (0);
}
"fcf_shutdown_notify: %s flag=%x "
"fcfi_online=%d. Shutting down FCFTAB. >",
/* Wait for shutdown flag */
i = 0;
BUSYWAIT_MS(1000);
}
"fcf_shutdown_notify: %s flag=%x "
"fcfi_online=%d. Shutdown timeout.",
rval = 1;
}
}
return (rval);
} /* emlxs_fcf_shutdown_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
"fcf_linkup_notify: %s flag=%x "
"fcfi_online=%d. FCFTAB Link up. >",
return (rval);
} /* emlxs_fcf_linkup_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
"fcf_linkdown_notify: %s flag=%x "
"fcfi_online=%d. FCFTAB Link down. >",
return (rval);
} /* emlxs_fcf_linkdown_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
"fcf_cvl_notify: %s flag=%x "
"fcfi_online=%d. FCFTAB FCF CVL. >",
(void *)((unsigned long)vpi));
return (rval);
} /* emlxs_fcf_cvl_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
"fcf_full_notify: %s flag=%x "
"fcfi_online=%d. FCFTAB FCF full. >",
return (rval);
} /* emlxs_fcf_full_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
"fcf_found_notify: %s flag=%x "
"fcfi_online=%d. FCFTAB FCF found. >",
(void *)((unsigned long)fcf_index));
return (rval);
} /* emlxs_fcf_found_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
"fcf_changes_notify: %s flag=%x "
"fcfi_online=%d. FCFTAB FCF changed. >",
(void *)((unsigned long)fcf_index));
return (rval);
} /* emlxs_fcf_changed_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
"fcf_lost_notify: %s flag=%x "
"fcfi_online=%d. FCFTAB FCF lost. >",
(void *)((unsigned long)fcf_index));
return (rval);
} /* emlxs_fcf_lost_notify() */
/* ************************************************************************** */
/* FCFTAB Generic */
/* ************************************************************************** */
static char *
{
if (SLI4_FCOE_MODE) {
return (emlxs_fcoe_fcftab_state_xlate(state));
} else {
return (emlxs_fc_fcftab_state_xlate(state));
}
} /* emlxs_fcftab_state_xlate() */
static uint32_t
{
if (SLI4_FCOE_MODE) {
} else {
}
} /* emlxs_fcftab_event() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"fcftab_shutdown_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
/* Offline all FCF's */
online = 0;
continue;
}
"fcftab_shutdown_action:%x fcfi_online=%d. "
"Offlining FCFI:%d. >",
fcfp);
online++;
}
if (!online) {
goto done;
}
return (0);
}
/* Check FCF states */
online = 0;
continue;
}
online++;
}
if (online) {
"fcftab_shutdown_action:%x %s:%s arg=%p. "
"fcfi_online=%d,%d <",
return (0);
}
done:
/* Free FCF table */
continue;
}
"fcftab_shutdown_action:%x. Freeing FCFI:%d. >",
}
/* Clean the selection table */
fcftab->fcfi_count = 0;
"fcftab_shutdown_action:%x %s:%s arg=%p flag=%x fcfi_online=%d. "
"Shutdown. <",
return (0);
} /* emlxs_fcftab_shutdown_action() */
/* ************************************************************************** */
/* FC FCFTAB */
/* ************************************************************************** */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_fc_fcftab_state_table[i].string);
}
}
return (buffer);
} /* emlxs_fc_fcftab_state_xlate() */
static uint32_t
void *arg1)
{
/* Convert event to action table index */
switch (evt) {
case FCF_EVENT_STATE_ENTER:
index = 0;
break;
case FCF_EVENT_SHUTDOWN:
index = 1;
break;
case FCF_EVENT_LINKUP:
index = 2;
break;
case FCF_EVENT_LINKDOWN:
index = 3;
break;
case FCF_EVENT_FCFI_ONLINE:
index = 4;
break;
case FCF_EVENT_FCFI_OFFLINE:
index = 5;
break;
default:
return (1);
}
if (!func) {
"fc_fcftab_action:%x %s:%s arg=%p. No action. <",
return (1);
}
return (rval);
} /* emlxs_fc_fcftab_action() */
static uint32_t
void *arg1)
{
/* Filter events */
switch (evt) {
case FCF_EVENT_SHUTDOWN:
case FCF_EVENT_LINKUP:
case FCF_EVENT_LINKDOWN:
case FCF_EVENT_FCFI_ONLINE:
case FCF_EVENT_FCFI_OFFLINE:
break;
default:
return (1);
}
"fc_fcftab_event:%x %s:%s arg=%p.",
return (rval);
} /* emlxs_fc_fcftab_event() */
/* EMLXS_FCF_LOCK must be held to enter */
/*ARGSUSED*/
static uint32_t
{
if (state >= FC_FCFTAB_ACTION_STATES) {
return (1);
}
(reason != FCF_REASON_REENTER)) {
"fcftab_state:%x %s:%s:0x%x arg=%p. "
"State not changed. <",
return (1);
}
if (!reason) {
"fcftab_state:%x %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"fcftab_state:%x %s-->%s:%s:%s arg=%p",
} else if (explain) {
"fcftab_state:%x %s-->%s:%s:0x%x arg=%p",
} else {
"fcftab_state:%x %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_fc_fcftab_state() */
static void
{
/* Check FCF timer */
if (!fcftab->online_timer ||
return;
}
fcftab->online_timer = 0;
case FC_FCFTAB_STATE_ONLINE:
fcftab->generation++;
"fc_fcftab_online_timer:%x %s gen=%x. Read topology. >",
fcftab->generation);
FCF_REASON_EVENT, 0, 0);
break;
default:
"fc_fcftab_online_timer:%x %s",
break;
}
return;
} /* emlxs_fc_fcftab_online_timer() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_offline_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_offline_action:%x %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
"fc_fcftab_offline_action:%x %s:%s arg=%p fcfi_online=%d. "
"Offline. <",
return (0);
} /* emlxs_fc_fcftab_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_online_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_online_action:%x flag=%x. "
"Handling requested.",
return (rval);
}
if (fcftab->fcfi_online == 0) {
"fc_fcftab_online_action:%x %s:%s "
"fcfi_online=0. Pport not bound. <",
} else {
"fc_fcftab_online_action:%x %s:%s "
"fcfi_online=0. Starting online timer. <",
/* Start the online timer */
}
return (0);
}
"fc_fcftab_online_action:%x flag=%x fcfi_online=%d. "
"Online. <",
return (0);
} /* emlxs_fc_fcftab_online_action() */
/*ARGSUSED*/
static uint32_t
{
uint32_t j;
"fc_fcftab_topo_mbcmpl:%x state=%s.",
TID,
return (0);
}
"fc_fcftab_topo_mbcmpl:%x %s. "
"Incorrect generation %x. Dropping.",
TID,
fcftab->generation);
return (0);
}
"fc_fcftab_topo_mbcmpl:%x failed. %s. >",
(void) emlxs_fc_fcftab_state(port,
} else {
(void) emlxs_fc_fcftab_state(port,
}
return (0);
}
"fc_fcftab_topo_mbcmpl:%x Linkdown attention. "
"Offline requested.",
(void) emlxs_fc_fcftab_req_handler(port, 0);
return (0);
}
"fc_fcftab_topo_mbcmpl:%x Event tag invalid. %x != %x",
}
"fc_fcftab_topo_mbcmpl:%x state=%s type=%s iotag=%d "
"alpa=%x. >",
/* Link is up */
/* Save the linkspeed & topology */
goto done;
}
/* TOPOLOGY_LOOP */
} else {
}
/* Save the granted_alpa and alpa_map */
/* Check number of devices in map */
if (alpa_map[0] > 127) {
alpa_map[0] = 127;
}
"alpa_map: %d device(s): "
"%02x %02x %02x %02x %02x %02x %02x %02x",
alpa_map[8]);
"alpa_map: "
"%02x %02x %02x %02x %02x %02x %02x %02x",
alpa_map[j],
alpa_map[j + 1],
alpa_map[j + 2],
alpa_map[j + 3],
alpa_map[j + 4],
alpa_map[j + 5],
alpa_map[j + 6],
alpa_map[j + 7]);
}
done:
0, 0, 0);
return (0);
} /* emlxs_fc_fcftab_topo_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_topo_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
"Handling request.",
return (rval);
}
}
"fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
"Fabric Topology. Skipping READ_TOPO.",
return (rval);
}
"fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
"Sending READ_TOPO. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
FCF_REASON_NO_BUFFER, 0, arg1);
return (rval);
}
return (rval);
}
return (0);
} /* emlxs_fc_fcftab_topo_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_topo_failed_action:%x %s:%s arg=%p "
"attempt=%d. Invalid state. <",
return (1);
}
"fc_fcftab_topo_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Giving up.",
} else {
"fc_fcftab_topo_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Retrying.",
}
return (rval);
} /* emlxs_fc_fcftab_topo_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_topo_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_topo_cmpl_action:%x attempts=%d. "
"Config link.",
return (rval);
} /* emlxs_fc_fcftab_topo_cmpl_action() */
/*ARGSUSED*/
static uint32_t
{
"fc_fcftab_cfglink_mbcmpl:%x state=%s.",
TID,
return (0);
}
"fc_fcftab_cfglink_mbcmpl:%x %s. "
"Incorrect generation %x. Dropping.",
TID,
fcftab->generation);
return (0);
}
"fc_fcftab_cfglink_mbcmpl:%x failed. %s. >",
(void) emlxs_fc_fcftab_state(port,
} else {
(void) emlxs_fc_fcftab_state(port,
}
return (0);
}
"fc_fcftab_cfglink_mbcmpl:%x. >",
0, 0, 0);
return (0);
} /* emlxs_fc_fcftab_cfglink_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_cfglink_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
"Handling request.",
return (rval);
}
}
"fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
"Fabric Topology. Skipping CONFIG_LINK.",
return (rval);
}
"fc_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
"Sending CONFIG_LINK. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
}
}
return (rval);
}
return (0);
} /* emlxs_fc_fcftab_cfglink_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_cfglink_failed_action:%x %s:%s arg=%p "
"attempt=%d. Invalid state. <",
return (1);
}
"fc_fcftab_cfglink_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Giving up.",
} else {
"fc_fcftab_cfglink_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Retrying.",
}
return (rval);
} /* emlxs_fc_fcftab_cfglink_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_cfglink_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_cfglink_cmpl_action:%x attempts=%d. "
"Read SPARM.",
return (rval);
} /* emlxs_fc_fcftab_cfglink_cmpl_action() */
/*ARGSUSED*/
static uint32_t
{
int32_t i;
"fc_fcftab_sparm_mbcmpl:%x state=%s.",
TID,
return (0);
}
"fc_fcftab_sparm_mbcmpl:%x %s. "
"Incorrect generation %x. Dropping.",
TID,
fcftab->generation);
return (0);
}
"fc_fcftab_sparm_mbcmpl:%x failed. %s. >",
(void) emlxs_fc_fcftab_state(port,
} else {
(void) emlxs_fc_fcftab_state(port,
}
return (0);
}
/* Save the parameters */
"fc_fcftab_sparm_mbcmpl:%x edtov=%x,%x bbc=%x. >",
/* Initialize the node name and port name only once */
} else {
}
/* Update all bound ports */
for (i = 0; i < MAX_VPORTS; i++) {
continue;
}
sizeof (SERV_PARM));
sizeof (NAME_TYPE));
sizeof (NAME_TYPE));
}
0, 0, 0);
return (0);
} /* emlxs_fc_fcftab_sparm_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_sparm_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"fc_fcftab_read_action:%x %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
}
"fc_fcftab_read_action:%x %s:%s arg=%p attempts=%d. "
"Reading SPARM. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
FCF_REASON_NO_BUFFER, 0, arg1);
return (rval);
}
return (rval);
}
return (0);
} /* emlxs_fc_fcftab_sparm_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_sparm_failed_action:%x %s:%s arg=%p "
"attempt=%d. Invalid state. <",
return (1);
}
"fc_fcftab_read_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Giving up.",
} else {
"fc_fcftab_read_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Retrying.",
}
return (rval);
} /* emlxs_fc_fcftab_sparm_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_sparm_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_sparm_cmpl_action:%x attempts=%d. "
"Bring FCFTAB online.",
return (rval);
} /* emlxs_fc_fcftab_sparm_cmpl_action() */
/*ARGSUSED*/
static void
{
uint16_t i;
/* Get the FCFI */
if (!fcfp) {
/* Allocate an fcfi */
}
if (!fcfp) {
fcftab->fcfi_count = 0;
"fc_fcftab_process:%x No FCF available.",
return;
}
"fc_fcftab_process:%x fcfi=%d %s. "
"FCF still selected.",
} else {
"fc_fcftab_process:%x fcfi=%d %s. "
"New FCF selected.",
}
/* Initalize an fcf_rec */
fcf_rec = &fcf_record;
fcf_rec->fka_adv_period = 0;
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
} else {
}
/* Update the FCFI */
/* Select the FCFI */
return;
} /* emlxs_fc_fcftab_process() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_fcfi_online_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_fcfi_online_action:%x flag=%x. "
"Handling request.",
return (rval);
}
if (!fcfp) {
"fc_fcftab_fcfi_online_action:%x. "
"No FCF available. Offlining.",
return (rval);
}
"fc_fcftab_fcfi_online_action:%x fcfi_count=%d. "
"Onlining FCFI:%d. >",
return (rval);
} /* emlxs_fc_fcftab_fcfi_online_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p "
"flag=%x. Handling request.",
return (rval);
}
"fc_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
"Going online.",
return (rval);
} /* emlxs_fc_fcftab_fcfi_online_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_fcftab_offline_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
if (fcftab->fcfi_online) {
"fc_fcftab_fcfi_offline_action:%d. "
"Offlining FCFI:%d. >",
return (rval);
}
"fc_fcftab_fcfi_offline_action:%x fcfi_online=%d. "
"Waiting on FCF. <",
return (0);
}
"fc_fcftab_fcfi_offline_action:%x %s:%s arg=%p.",
return (rval);
} /* emlxs_fc_fcftab_fcfi_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fc_fcftab_fcftab_offline_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fc_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
"Handling request.",
return (rval);
}
"fc_fcftab_fcftab_offline_cmpl_action:%x %s:%s arg=%p. "
"Returning FCF(s) online.",
return (rval);
} /* emlxs_fc_fcftab_fcfi_offline_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_LINKUP) {
"fc_fcftab_linkup_evt_action:%x %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"fc_fcftab_linkup_evt_action:%x %s:%s arg=%p gen=%x. Link up.",
fcftab->generation);
fcftab->generation++;
"fc_fcftab_linkup_evt_action:%x %s gen=%x. "
"Read topology.",
fcftab->generation);
case FC_FCFTAB_STATE_TOPO:
break;
default:
break;
}
return (rval);
} /* emlxs_fc_fcftab_linkup_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
if (evt != FCF_EVENT_LINKDOWN) {
"fc_fcftab_linkdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"fc_fcftab_linkdown_evt_action:%x %s:%s arg=%p flag=%x. Linkdown.",
/* Pause all active FCFI's */
for (i = 0; i < fcftab->fcfi_count; i++) {
break;
}
"fc_fcftab_linkdown_evt_action:%x. "
"Pausing FCFI:%d. >",
}
"fc_fcftab_linkdown_evt_action:%x "
"Going offline.",
case FC_FCFTAB_STATE_OFFLINE:
break;
default:
break;
}
return (rval);
} /* emlxs_fc_fcftab_linkdown_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_OFFLINE) {
"fc_fcftab_fcftab_offline_evt_action:%x %s:%s arg=%p "
"flag=%x. Invalid event type. <",
return (1);
}
case FC_FCFTAB_STATE_SHUTDOWN:
"fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
"Shutting down.",
/* This will trigger final shutdown */
break;
"fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d. Offlining.",
break;
"fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
"Retrying FCF.",
break;
case FC_FCFTAB_STATE_ONLINE:
"fc_fcftab_fcfi_offline_evt_action:%x fcfi:%d.",
break;
default:
"fc_fcftab_fcfi_offline_evt_action:%x %s fcfi:%d.",
break;
}
return (rval);
} /* emlxs_fc_fcftab_fcfi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_ONLINE) {
"fc_fcftab_fcftab_online_evt_action:%x %s:%s arg=%p "
"flag=%x. Invalid event type. <",
return (1);
}
"fc_fcftab_fcfi_online_evt_action:%d fcfi:%d. <",
return (rval);
} /* emlxs_fc_fcftab_fcfi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_SHUTDOWN) {
"fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Already shut down. <",
return (1);
}
"fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Already shutting down. <",
return (1);
}
"fc_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Shutting down.",
return (rval);
} /* emlxs_fc_fcftab_shutdown_evt_action() */
static uint32_t
{
return (1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
return (rval);
} /* emlxs_fc_fcftab_req_handler() */
/* ************************************************************************** */
/* FCOE FCFTAB */
/* ************************************************************************** */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_fcoe_fcftab_state_table[i].string);
}
}
return (buffer);
} /* emlxs_fcoe_fcftab_state_xlate() */
static uint32_t
void *arg1)
{
/* Convert event to action table index */
switch (evt) {
case FCF_EVENT_STATE_ENTER:
index = 0;
break;
case FCF_EVENT_SHUTDOWN:
index = 1;
break;
case FCF_EVENT_LINKUP:
index = 2;
break;
case FCF_EVENT_LINKDOWN:
index = 3;
break;
case FCF_EVENT_CVL:
index = 4;
break;
case FCF_EVENT_FCF_FOUND:
index = 5;
break;
case FCF_EVENT_FCF_LOST:
index = 6;
break;
case FCF_EVENT_FCF_CHANGED:
index = 7;
break;
case FCF_EVENT_FCFTAB_FULL:
index = 8;
break;
case FCF_EVENT_FCFI_ONLINE:
index = 9;
break;
case FCF_EVENT_FCFI_OFFLINE:
index = 10;
break;
default:
return (1);
}
if (!func) {
"fcoe_fcftab_action:%x %s:%s arg=%p. No action. <",
return (1);
}
return (rval);
} /* emlxs_fcoe_fcftab_action() */
static uint32_t
void *arg1)
{
/* Filter events */
switch (evt) {
case FCF_EVENT_SHUTDOWN:
case FCF_EVENT_LINKUP:
case FCF_EVENT_LINKDOWN:
case FCF_EVENT_CVL:
case FCF_EVENT_FCF_FOUND:
case FCF_EVENT_FCF_LOST:
case FCF_EVENT_FCF_CHANGED:
case FCF_EVENT_FCFTAB_FULL:
case FCF_EVENT_FCFI_OFFLINE:
case FCF_EVENT_FCFI_ONLINE:
break;
default:
return (1);
}
"fcoe_fcftab_event:%x %s:%s arg=%p.",
return (rval);
} /* emlxs_fcoe_fcftab_event() */
/* EMLXS_FCF_LOCK must be held to enter */
/*ARGSUSED*/
static uint32_t
{
if (state >= FCOE_FCFTAB_ACTION_STATES) {
return (1);
}
(reason != FCF_REASON_REENTER)) {
"fcftab_state:%x %s:%s:0x%x arg=%p. "
"State not changed. <",
return (1);
}
if (!reason) {
"fcftab_state:%x %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"fcftab_state:%x %s-->%s:%s:%s arg=%p",
} else if (explain) {
"fcftab_state:%x %s-->%s:%s:0x%x arg=%p",
} else {
"fcftab_state:%x %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_fcoe_fcftab_state() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_OFFLINE) {
"fcoe_fcftab_fcfi_offline_evt_action:%x %s:%s arg=%p "
"flag=%x. Invalid event type. <",
return (1);
}
"fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
"Shutting down.",
/* This will trigger final shutdown */
break;
"fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
"Offlining.",
break;
"fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d. "
"Attempting failover.",
break;
case FCOE_FCFTAB_STATE_ONLINE:
"fcoe_fcftab_fcfi_offline_evt_action:%x fcfi:%d.",
break;
default:
"fcoe_fcftab_fcfi_offline_evt_action:%x %s fcfi:%d.",
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_fcfi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_ONLINE) {
"fcoe_fcftab_fcfi_online_evt_action:%x %s:%s arg=%p "
"flag=%x. Invalid event type. <",
return (1);
}
"fcoe_fcftab_fcfi_online_evt_action:%x fcfi:%d. <",
return (rval);
} /* emlxs_fcoe_fcftab_fcfi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_CVL) {
"fcoe_fcftab_cvl_evt_action:%x %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
/* Pause VPI */
"fcoe_fcftab_cvl_evt_action:%x %s gen=%x. Pausing VPI:%d. >",
"fcoe_fcftab_cvl_evt_action:%x %s gen=%x. "
"Already soliciting. <",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcoe_fcftab_cvl_evt_action:%x %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_cvl_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_LINKUP) {
"fcoe_fcftab_linkup_evt_action:%x %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"fcoe_fcftab_linkup_evt_action:%x %s:%s arg=%p gen=%x. Link up.",
fcftab->generation);
"fcoe_fcftab_linkup_evt_action:%x %s gen=%x. "
"Already soliciting. <",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcoe_fcftab_linkup_evt_action:%x %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_linkup_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
if (evt != FCF_EVENT_LINKDOWN) {
"fcoe_fcftab_linkdown_evt_action:%x %s:%s arg=%p "
"flag=%x. Invalid event type. <",
return (1);
}
"fcoe_fcftab_linkdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Linkdown.",
/* Pause all active FCFI's */
for (i = 0; i < fcftab->fcfi_count; i++) {
break;
}
"fcoe_fcftab_linkdown_evt_action:%x Pausing FCFI:%d. >",
}
"fcoe_fcftab_linkdown_evt_action:%x "
"Going offline.",
break;
default:
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_linkdown_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_SHUTDOWN) {
"fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Already shut down. <",
return (1);
}
"fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Already shutting down. <",
return (1);
}
"fcoe_fcftab_shutdown_evt_action:%x %s:%s arg=%p flag=%x. "
"Shutting down.",
return (rval);
} /* emlxs_fcoe_fcftab_shutdown_evt_action() */
static uint32_t
{
return (1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
}
return (rval);
} /* emlxs_fcoe_fcftab_req_handler() */
static void
{
/* Check FCF timer */
if (!fcftab->read_timer ||
return;
}
fcftab->read_timer = 0;
"fcoe_fcftab_timer:%x %s >",
0, 0, FCFTAB_READ_ALL);
break;
default:
"fcoe_fcftab_timer:%x %s",
break;
}
return;
} /* emlxs_fcoe_fcftab_read_timer() */
static void
{
/* Check FCF timer */
return;
}
case FCOE_FCFTAB_STATE_ONLINE:
fcftab->generation++;
"fcoe_fcftab_sol_timer:%x %s gen=%x. Soliciting. >",
fcftab->generation);
FCF_REASON_EVENT, 0, 0);
break;
default:
"fcoe_fcftab_sol_timer:%x %s",
break;
}
return;
} /* emlxs_fcoe_fcftab_sol_timer() */
static void
{
uint32_t i;
for (i = 0; i < fcftab->fcfi_count; i++) {
/* Check offline timer */
if (!fcfp->offline_timer ||
continue;
}
fcfp->offline_timer = 0;
"fcoe_fcftab_offline_timer:%x. Offlining FCFI:%d. >",
}
return;
} /* emlxs_fcoe_fcftab_offline_timer() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_sol_failed_action:%x %s:%s arg=%p "
"attempt=%d. Invalid state. <",
return (1);
}
"fcoe_fcftab_sol_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Giving up.",
FCF_REASON_OP_FAILED, 0, arg1);
} else {
"fcoe_fcftab_sol_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Retrying.",
FCF_REASON_OP_FAILED, 0, arg1);
}
return (rval);
} /* emlxs_fcoe_fcftab_sol_failed_action() */
/*ARGSUSED*/
static uint32_t
{
fip_mode = 0;
}
"fcoe_fcftab_sol_mbcmpl:%x %s.",
TID,
return (0);
}
"fcoe_fcftab_sol_mbcmpl:%x %s. "
"Incorrect generation %x. Dropping.",
TID,
fcftab->generation);
return (0);
}
if (fip_mode) {
"fcoe_fcftab_sol_mbcmpl:%x failed. %s. >",
(void) emlxs_fcoe_fcftab_state(port,
return (0);
"fcoe_fcftab_sol_mbcmpl:%x failed. %s %x,%x. >",
(void) emlxs_fcoe_fcftab_state(port,
return (0);
}
}
"fcoe_fcftab_sol_mbcmpl:%x %s gen=%x. Solicit complete. >",
fcftab->generation);
0, 0, 0);
return (0);
} /* emlxs_fcoe_fcftab_sol_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_sol_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"fcoe_fcftab_sol_action:%x %s:%s arg=%p gen=%d flag=%x. "
"Handling request.",
return (rval);
}
}
"fcoe_fcftab_sol_action:%x %s:%s arg=%p gen=%x fip=%x. "
"Requesting solicit. <",
FCF_REASON_NO_MBOX, 0, 0);
return (rval);
}
sizeof (IOCTL_FCOE_REDISCOVER_FCF_TABLE) +
sizeof (IOCTL_FCOE_REDISCOVER_FCF_TABLE);
} else { /* Non-FIP */
/* Non-FIP uses a persistent FCF entry that */
/* we must add to the table */
uint16_t i;
FCF_REASON_NO_BUFFER, 0, arg1);
return (rval);
}
fcf_rec->fka_adv_period = 0;
#ifdef EMLXS_BIG_ENDIAN
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
#endif /* EMLXS_LITTLE_ENDIAN */
} else {
}
}
if (mp) {
}
FCF_REASON_SEND_FAILED, rval, 0);
return (rval);
}
return (0);
} /* emlxs_fcoe_fcftab_sol_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_sol_cmpl_action:%x %s:%s arg=%p "
"Invalid state. <",
return (1);
}
"fcoe_fcftab_sol_cmpl_action:%x %s:%s arg=%p gen=%d "
"flag=%x. Handling request.",
return (rval);
}
"fcoe_fcftab_sol_cmpl_action:%x %s:%s arg=%p gen=%d. "
"Starting timer (%d secs).",
/* Start the read timer */
return (0);
} /* emlxs_fcoe_fcftab_sol_cmpl_action() */
/*ARGSUSED*/
static uint32_t
{
"fcoe_fcftab_read_mbcmpl:%x index=%d %s.",
return (0);
}
"fcoe_fcftab_read_mbcmpl:%x index=%d %s. "
"Incorrect generation %x. Dropping.",
fcftab->generation);
return (0);
}
"fcoe_fcftab_read_mbcmpl:%x index=%d failed. %s %x,%x. >",
(void) emlxs_fcoe_fcftab_state(port,
(void*)((unsigned long)index));
return (0);
}
"fcoe_fcftab_read_mbcmpl:%x index=%d %s",
#ifdef EMLXS_BIG_ENDIAN
{
uint32_t i;
uint8_t j;
uint16_t s;
/* Fix up data in FCF record */
i = *iptr;
s = *sptr;
}
#endif /* EMLXS_BIG_ENDIAN */
/* Try to find existing fcfrec */
/* If not found, allocate a new one */
if (!fcfp) {
}
if (!fcfp) {
"fcoe_fcftab_read_mbcmpl:%x index=%d failed. "
"Unable to allocate fcfi. >",
(void) emlxs_fcoe_fcftab_state(port,
(void*)((unsigned long)index));
return (0);
}
/* Update the FCFI */
/* Check if another record needs to be acquired */
"fcoe_fcftab_read_mbcmpl:%x. Read next. >",
} else {
"fcoe_fcftab_read_mbcmpl:%x. Read complete. >",
(void) emlxs_fcoe_fcftab_state(port,
0, 0, (void*)((unsigned long)index));
}
return (0);
} /* emlxs_fcoe_fcftab_read_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_read_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"fcoe_fcftab_read_action:%x %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
}
"fcoe_fcftab_read_action:%x %s:%s arg=%p attempts=%d. "
"Reading FCF. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
FCF_REASON_NO_BUFFER, 0, arg1);
return (rval);
}
return (rval);
}
return (0);
} /* emlxs_fcoe_fcftab_read_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_read_failed_action:%x %s:%s arg=%p "
"attempt=%d. Invalid state. <",
return (1);
}
"fcoe_fcftab_read_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Giving up.",
} else {
"fcoe_fcftab_read_failed_action:%x %s:%s arg=%p "
"attempt=%d reason=%x. Retrying.",
}
return (rval);
} /* emlxs_fcoe_fcftab_read_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"fcoe_fcftab_read_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcoe_fcftab_read_cmpl_action:%x %s:%s arg=%p attempts=%d. "
"Cleaning table.",
/* Clean FCFI table */
continue;
}
/* Adjust the freshness flag */
} else {
}
/* Clear the failed bit */
/* Free all stale unselected entries now */
"fcoe_fcftab_read_cmpl_action:%x. FCF stale. "
"Freeing FCFI:%d. >",
continue;
}
}
return (rval);
} /* emlxs_fcoe_fcftab_read_cmpl_action() */
static FCFIobj_t *
{
uint32_t i;
uint32_t j;
/* Tag & count viable entries */
fcf_table_count = 0;
fcfp = 0;
continue;
}
continue;
}
if (fabric_wwn &&
continue;
}
}
if (fcf_table_count == 0) {
return (NULL);
}
if (fcf_table_count == 1) {
return (fcfp);
}
/* We found more than one viable entry */
/* Find the highest priority tagged entry(s) */
for (i = 0; i < fcf_table_count; i++) {
fcfp = 0;
continue;
}
if (!fcfp ||
}
}
if (fcf_table[0] &&
break;
}
}
/* If more than one entry has the highest priority, */
/* then randomly select one of the highest. */
if (i > 1) {
/* Pick a random number from 0 to (i-1) */
/* This algorithm uses the lower 16 bits of the nanosecond */
/* clock to determine the value */
gethrestime(&time);
} else {
}
/* Free the priority table */
return (fcfp);
} /* emlxs_fcoe_fcftab_fcfi_select() */
/*ARGSUSED*/
static void
{
uint32_t i;
uint32_t j;
/* Deselection process */
for (i = 0; i < FCFTAB_MAX_FCFI_COUNT; i++) {
if (!fcfp) {
continue;
}
/* Check if entry is viable */
if (fcfp->offline_timer) {
fcfp->offline_timer = 0;
"fcoe_fcftab_process:%x %d fcfi=%d %s. "
"FCF viable. Offline timer disabled.",
}
continue;
}
/* Previous entry is no longer viable */
/* If FCF is still online */
if (fcfp->offline_timer == 0) {
/* Set the offline timer */
"fcoe_fcftab_process:%x %d fcfi=%d %s. "
"No longer viable. "
"Offlining FCF (%d secs).",
}
continue;
}
/* Deselect it */
"fcoe_fcftab_process:%x %d. "
"No longer viable. Freeing FCFI:%d. >",
} else {
"fcoe_fcftab_process:%x %d fcfi=%d %s. "
"No longer viable. FCF deselected.",
}
}
/* Reselection process */
for (i = 0; i < FCFTAB_MAX_FCFI_COUNT; i++) {
/* If no previous selection, then make new one */
if (!prev_fcfp) {
/* Select an fcf on any fabric */
if (fcfp) {
"fcoe_fcftab_process:%x %d fcfi=%d %s. "
"New FCF selected.",
} else {
"fcoe_fcftab_process:%x %d. "
"No FCF available.",
i);
}
continue;
}
/* If previous entry is still selected, keep it */
"fcoe_fcftab_process:%x %d fcfi=%d %s. "
"FCF still selected.",
continue;
}
/* Previous entry is no longer selected */
/* Select a new fcf from same fabric */
if (fcfp) {
"fcoe_fcftab_process:%x %d fcfi=%d %s. "
"New FCF, same fabric selected.",
continue;
}
/* Select fcf from any fabric */
if (fcfp) {
"fcoe_fcftab_process:%x %d fcfi=%d %s. "
"New FCF, new fabric selected.",
continue;
}
"fcoe_fcftab_process:%x %d. No FCF available.",
i);
}
/* Pack entries */
count = 0;
for (i = 0; i < FCFTAB_MAX_FCFI_COUNT; i++) {
count++;
continue;
}
for (j = i+1; j < FCFTAB_MAX_FCFI_COUNT; j++) {
continue;
}
count++;
break;
}
if (j == FCFTAB_MAX_FCFI_COUNT) {
break;
}
}
return;
} /* emlxs_fcoe_fcftab_process() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
uint32_t offline_count = 0;
uint32_t online_count = 0;
"fcoe_fcftab_fcfi_online_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcoe_fcftab_fcfi_online_action:%x flag=%x. "
"Handling request.",
return (rval);
}
for (i = 0; i < fcftab->fcfi_count; i++) {
if (fcfp->offline_timer == 0) {
online_count++;
"fcoe_fcftab_fcfi_online_action:%x fcfi_count=%d. "
"Onlining FCFI:%d. >",
fcfp);
} else {
"fcoe_fcftab_fcfi_online_action:%x fcfi_count=%d. "
"Offlining fcfi:%d.",
}
}
if (offline_count) {
/* Wait for FCF's to go offline */
/* Service timer now */
return (rval);
}
if (!online_count) {
"fcoe_fcftab_fcfi_online_action:%x fcfi_count=%d.",
fcftab->fcfi_count);
}
return (rval);
} /* emlxs_fcoe_fcftab_fcfi_online_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcoe_fcftab_fcfi_online_cmpl_action:%x %s:%s "
"arg=%p flag=%x. Handling request.",
return (rval);
}
"fcoe_fcftab_fcfi_online_cmpl_action:%x %s:%s arg=%p. "
"Going online.",
return (rval);
} /* emlxs_fcoe_fcftab_fcfi_online_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
"fcoe_fcftab_fcfi_offline_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
/* Check for FCF's going offline */
fcfi_offline = 0;
for (i = 0; i < fcftab->fcfi_count; i++) {
continue;
}
if (fcfp->offline_timer ||
fcfi_offline++;
}
}
if (fcfi_offline) {
"fcoe_fcftab_fcfi_offline_action:%x %s:%s arg=%p "
"fcfi_offline=%d. <",
return (0);
}
"fcoe_fcftab_fcfi_offline_action:%x %s:%s arg=%p.",
return (rval);
} /* emlxs_fcoe_fcftab_fcfi_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcoe_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
"Handling request.",
return (rval);
}
"fcoe_fcftab_fcfi_offline_cmpl_action:%x %s:%s arg=%p. "
"Returning FCF(s) online.",
return (rval);
} /* emlxs_fcoe_fcftab_fcfi_offline_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCF_FOUND) {
"fcoe_fcftab_found_evt_action:%x %s:%s fcf_index=%d. "
"Invalid event type. <",
return (1);
}
case FCOE_FCFTAB_STATE_READ:
"fcoe_fcftab_found_evt_action:%x %s:%s "
"fcf_index=%d gen=%x. <",
break;
/* case FCOE_FCFTAB_STATE_FCFI_OFFLINE: */
default:
/* Scan for matching fcf index in table */
/* Trigger table read */
fcftab->generation++;
"fcoe_fcftab_found_evt_action:%x %s:%s "
"fcf_index=%d gen=%x. Read FCF table.",
break;
}
/* Check if we need more FCF's */
/* Trigger table read */
fcftab->generation++;
"fcoe_fcftab_found_evt_action:%x %s:%s "
"fcf_index=%d gen=%x fcfi_online=%d. "
"Read FCF table.",
break;
}
"fcoe_fcftab_found_evt_action:%x %s:%s fcfi=%d. "
"FCF not needed. <",
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_found_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
if (evt != FCF_EVENT_FCF_LOST) {
"fcoe_fcftab_lost_evt_action:%x %s:%s fcf_index=%d. "
"Invalid event type. <",
return (1);
}
/* Scan for matching fcf index in table */
if (!fcfp) {
"fcoe_fcftab_lost_evt_action:%x %s:%s fcf_index=%d. "
"FCF not found. <",
return (0);
}
"fcoe_fcftab_changed_evt_action:%x %s:%s fcf_index=%d. "
"FCF not selected. <",
return (0);
}
/* Offline VPI's of this FCFI */
continue;
}
/* Fabric logo is implied */
"fcoe_fcftab_lost_evt_action:%x %s:%s fcf_index=%d gen=%x. "
"Offlining VPI:%d. >",
}
"fcoe_fcftab_lost_evt_action:%x %s gen=%x. "
"Already soliciting. <",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcoe_fcftab_lost_evt_action:%x %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_lost_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCF_CHANGED) {
"fcoe_fcftab_changed_evt_action:%x %s:%s fcf_index=%d. "
"Invalid event type. <",
return (1);
}
case FCOE_FCFTAB_STATE_READ:
"fcoe_fcftab_changed_evt_action:%x %s:%s "
"fcf_index=%d gen=%x. <",
break;
/* case FCOE_FCFTAB_STATE_FCFI_OFFLINE: */
default:
/* Scan for matching fcf index in table */
/* Trigger table read */
fcftab->generation++;
"fcoe_fcftab_changed_evt_action:%x %s:%s "
"fcf_index=%d gen=%x. Read FCF table.",
break;
}
/* Check if we need more FCF's */
/* Trigger table read */
fcftab->generation++;
"fcoe_fcftab_changed_evt_action:%x %s:%s "
"fcf_index=%d gen=%x fcfi_online=%d. "
"Read FCF table.",
break;
}
"fcoe_fcftab_changed_evt_action:%x %s:%s fcfi=%d. "
"FCF not needed. <",
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_changed_evt_action() */
/*ARGSUSED*/
static uint32_t
{
"fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
"Out of range.",
return (1);
}
"fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
"Unable to allocate mailbox.",
return (1);
}
"fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
"Unable to allocate buffer.",
return (1);
}
"fcoe_fcftab_fcf_delete:%x fcfi:%d. <",
"fcoe_fcftab_fcf_delete:%x fcfi:%d failed. "
"Unable to send request.",
if (mp) {
}
return (1);
}
return (0);
} /* emlxs_fcoe_fcftab_fcf_delete() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
if (evt != FCF_EVENT_FCFTAB_FULL) {
"fcoe_fcftab_full_evt_action:%x %s:%s arg=%p. "
"Invalid event type. <",
return (1);
}
"fcoe_fcftab_full_evt_action:%x %s:%s arg=%p "
"fcfi_online=%d. <",
return (0);
}
"fcoe_fcftab_full_evt_action:%x %s:%s arg=%p fcfi_online=%d. "
"Cleaning table...",
count = 0;
continue;
}
continue;
}
continue;
}
"fcoe_fcftab_full_evt_action:%x. "
"Deleting FCFI:%d %x. >",
count++;
}
if (!count) {
"fcoe_fcftab_full_evt_action:%x %s:%s arg=%p. "
"All FCF's are viable. <",
return (0);
}
"fcoe_fcftab_full_evt_action:%x %s gen=%x. "
"Already soliciting. <",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcoe_fcftab_full_evt_action:%x %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcoe_fcftab_full_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"fcoe_fcftab_online_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcoe_fcftab_online_action:%x flag=%x. "
"Handling request.",
return (rval);
}
if (fcftab->fcfi_online == 0) {
/* Count viable FCF's in table */
count = 0;
continue;
}
count++;
}
}
if (count) {
"fcoe_fcftab_online_action:%x %s:%s "
"fcfi_online=0,%d,%d. Starting resolicit timer. <",
/* Start the solicit timer */
} else {
"fcoe_fcftab_online_action:%x %s:%s "
"fcfi_online=0,%d,0. Wait for FCF event. <",
fcftab->fcfi_count);
}
return (0);
}
"fcoe_fcftab_online_action:%x flag=%x fcfi_online=%d. "
"Online. <",
return (rval);
} /* emlxs_fcoe_fcftab_online_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcoe_fcftab_offline_action:%x %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcoe_fcftab_offline_action:%x %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
"fcoe_fcftab_offline_action:%x %s:%s arg=%p fcfi_online=%d. "
"Offline. <",
return (rval);
} /* emlxs_fcoe_fcftab_offline_action() */
/* ************************************************************************** */
/* FCFI */
/* ************************************************************************** */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_fcfi_state_table[i].string);
}
}
return (buffer);
} /* emlxs_fcfi_state_xlate() */
static uint32_t
void *arg1)
{
/* Convert event to action table index */
switch (evt) {
case FCF_EVENT_STATE_ENTER:
index = 0;
break;
case FCF_EVENT_FCFI_ONLINE:
index = 1;
break;
case FCF_EVENT_FCFI_OFFLINE:
index = 2;
break;
case FCF_EVENT_FCFI_PAUSE:
index = 3;
break;
case FCF_EVENT_VFI_ONLINE:
index = 4;
break;
case FCF_EVENT_VFI_OFFLINE:
index = 5;
break;
default:
return (1);
}
if (!func) {
"fcfi_action:%d %s:%s arg=%p. No action. <",
return (1);
}
return (rval);
} /* emlxs_fcfi_action() */
static uint32_t
void *arg1)
{
/* Filter events and acquire fcfi context */
switch (evt) {
case FCF_EVENT_VFI_ONLINE:
case FCF_EVENT_VFI_OFFLINE:
if (!vfip) {
"fcfi_event: %s arg=%p. Null VFI found. <",
return (1);
}
if (!fcfp) {
"fcfi_event: %s arg=%p. FCF not found. <",
return (1);
}
break;
case FCF_EVENT_FCFI_ONLINE:
case FCF_EVENT_FCFI_OFFLINE:
case FCF_EVENT_FCFI_PAUSE:
if (!fcfp) {
"fcfi_event: %s arg=%p. Null FCFI found. <",
return (1);
}
break;
default:
return (1);
}
"fcfi_event:%d %s:%s arg=%p",
return (rval);
} /* emlxs_fcfi_event() */
/* EMLXS_FCF_LOCK must be held to enter */
/*ARGSUSED*/
static uint32_t
{
if (state >= FCFI_ACTION_STATES) {
return (1);
}
(reason != FCF_REASON_REENTER)) {
"fcfi_state:%d %s:%s:0x%x arg=%p. "
"State not changed. <",
return (1);
}
if (!reason) {
"fcfi_state:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"fcfi_state:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"fcfi_state:%d %s-->%s:%s:0x%x arg=%p",
} else {
"fcfi_state:%d %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_fcfi_state() */
static FCFIobj_t *
{
uint16_t i;
"fcfi_alloc:%d. Allocating FCFI. >",
0, 0, 0);
return (fcfp);
}
}
"fcfi_alloc: Out of FCFI objects.",
return (NULL);
} /* emlxs_fcfi_alloc() */
static uint32_t
{
return (rval);
} /* emlxs_fcfi_free() */
static FCFIobj_t *
{
uint32_t i;
if (fcfrec) {
/* Check for a matching FCF index, fabric name, */
/* and mac address */
continue;
}
return (fcfp);
}
}
} else if (fcf_index) {
/* Check for a matching FCF index only */
continue;
}
return (fcfp);
}
}
}
return (NULL);
} /* emlxs_fcfi_find() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcfi_free_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
if (fcfp->vfi_online) {
"fcfi_free_action:%d flag=%x vfi_online=%d",
fcfp->vfi_online);
}
"fcfi_free_action:%d flag=%x. FCF freed. <",
return (0);
} /* emlxs_fcfi_free_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcfi_offline_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_offline_action:%d fcfi_online=%d. <",
return (0);
}
if (fcfp->vfi_online) {
"fcfi_offline_action:%d vfi_online=%d.",
fcfp->vfi_online);
}
if (fcftab->fcfi_online) {
fcftab->fcfi_online--;
}
}
/* Check if online was requested */
"fcfi_offline_action:%d fcfi_online=%d. "
"Online requested.",
FCF_REASON_REQUESTED, 0, arg1);
return (rval);
}
"fcfi_offline_action:%d fcfi_online=%d. "
"FCFI offline. Notifying fcftab. >",
/* Notify FCFTAB */
return (rval);
} /* emlxs_fcfi_offline_action() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_VFI_ONLINE) {
"fcfi_vfi_online_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
case FCFI_STATE_ONLINE:
"fcfi_vfi_online_evt_action:%d flag=%x vfi_online=%d. "
"Reentering online.",
fcfp->vfi_online);
break;
case FCFI_STATE_VFI_ONLINE:
"fcfi_vfi_online_evt_action:%d flag=%x vfi_online=%d. "
"Online cmpl.",
fcfp->vfi_online);
break;
default:
"fcfi_vfi_online_evt_action:%d flag=%x vfi_online=%d. <",
fcfp->vfi_online);
return (0);
}
return (rval);
} /* emlxs_fcfi_vfi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
{
return (0);
}
if (fcfp->vfi_online) {
FCF_REASON_REQUESTED, 0, arg1);
} else {
0, arg1);
}
FCF_REASON_REQUESTED, 0, arg1);
} else {
FCF_REASON_REQUESTED, 0, arg1);
}
return (rval);
} /* emlxs_fcfi_offline_handler() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_VFI_OFFLINE) {
"fcfi_vfi_offline_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
case FCFI_STATE_VFI_ONLINE:
case FCFI_STATE_ONLINE:
if (fcfp->vfi_online == 0) {
"fcfi_vfi_offline_evt_action:%d flag=%x "
"vfi_online=%d. Offlining.",
} else {
"fcfi_vfi_offline_evt_action:%d flag=%x "
"vfi_online=%d. <",
}
break;
case FCFI_STATE_PAUSED:
"fcfi_vfi_offline_evt_action:%d flag=%x vfi_online=%d. <",
break;
case FCFI_STATE_VFI_OFFLINE:
"fcfi_vfi_offline_evt_action:%d flag=%x. Offline cmpl.",
break;
"fcfi_vfi_offline_evt_action:%d flag=%x. Offline cmpl.",
break;
default:
if (fcfp->vfi_online == 0) {
"fcfi_vfi_offline_evt_action:%d flag=%x "
"vfi_online=%d. Offline requested. <",
} else {
"fcfi_vfi_offline_evt_action:%d flag = %x "
"vfi_online=%d. <",
}
return (0);
}
return (rval);
} /* emlxs_fcfi_vfi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_FCFI_ONLINE) {
"fcfi_online_evt_action:%d %s:%s arg=%p. "
"Invalid event type. <",
return (1);
}
"fcfi_online_evt_action:%d. "
"Online already requested. <",
return (1);
}
case FCFI_STATE_OFFLINE:
"fcfi_online_evt_action:%d flag=%x. Initiating online.",
break;
case FCFI_STATE_VFI_OFFLINE:
case FCFI_STATE_PAUSED:
"fcfi_online_evt_action:%d flag=%x. Initiating online.",
break;
case FCFI_STATE_ONLINE:
"fcfi_online_evt_action:%d flag=%x. Reentering online.",
break;
default:
"fcfi_online_evt_action:%d flag=%x. <",
break;
}
return (rval);
} /* emlxs_fcfi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
{
uint32_t i;
"fcfi_vfi_online_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_vfi_online_action:%d. Offline requested.",
return (rval);
}
if (fcfp->vfi_online > 0) {
/* Waking up out after being paused */
/* Find first VFI of this FCFI */
break;
}
}
} else {
/* Find first available VFI */
break;
}
}
}
"fcfi_vfi_online_action:%d vfi_online=%d. "
"No VFI found. Offlining.",
fcfp->vfi_online);
return (rval);
}
"fcfi_vfi_online_action:%d vfi_online=%d. Onlining VFI:%d. >",
/* Wait for FCF_EVENT_VFI_ONLINE in return */
return (rval);
} /* emlxs_fcfi_vfi_online_action() */
/*ARGSUSED*/
static uint32_t
{
"fcfi_vfi_online_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_vfi_online_cmpl_action:%d. Going online.",
return (rval);
} /* emlxs_fcfi_vfi_online_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
"fcfi_vfi_offline_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_vfi_offline_action:%d vfi_online=%d. Pausing.",
fcfp->vfi_online);
return (rval);
}
if (fcfp->vfi_online == 0) {
"fcfi_vfi_offline_action:%d. "
"VFI already offline. Skipping VFI offline.",
return (rval);
}
/* Offline VFI's of this FCFI */
continue;
}
"fcfi_vfi_offline_action:%d. Offlining VFI:%d >",
}
/* Wait for FCF_EVENT_VFI_OFFLINE in return */
return (0);
} /* emlxs_fcfi_vfi_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
"fcfi_paused_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
/* Pause all VFI's of this FCFI */
continue;
}
"fcfi_paused_action:%d vfi_online=%d. Pausing VFI:%d. >",
}
"fcfi_paused_action:%d vfi_online=%d. FCFI paused. <",
fcfp->vfi_online);
return (0);
} /* emlxs_fcfi_paused_action() */
/*ARGSUSED*/
static uint32_t
{
"fcfi_vfi_offline_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
if ((fcfp->vfi_online == 0) &&
"fcfi_vfi_offline_cmpl_action:%d vfi_online=%d. "
"Unregistering.",
fcfp->vfi_online);
} else {
"fcfi_vfi_offline_cmpl_action:%d vfi_online=%d. <",
fcfp->vfi_online);
}
return (rval);
} /* emlxs_fcfi_vfi_offline_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_OFFLINE) {
"fcfi_offline_evt_action:%d %s:%s arg=%p. "
"Invalid event type. <",
return (1);
}
"fcfi_offline_evt_action:%d. Offline already requested. <",
return (1);
}
case FCFI_STATE_OFFLINE:
"fcfi_offline_evt_action:%d flag=%x. Already offline. <",
break;
/* Wait states */
case FCFI_STATE_VFI_ONLINE:
case FCFI_STATE_VFI_OFFLINE:
case FCFI_STATE_REG:
case FCFI_STATE_ONLINE:
case FCFI_STATE_PAUSED:
"fcfi_offline_evt_action:%d flag=%x. Handling offline.",
/* Handle offline now */
break;
/* Transitional states */
default:
"fcfi_offline_evt_action:%d. "
"Invalid state. <",
break;
}
return (rval);
} /* emlxs_fcfi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_PAUSE) {
"fcfi_pause_evt_action:%d %s:%s arg=%p. "
"Invalid event type. <",
return (1);
}
"fcfi_pause_evt_action:%d. Pause already requested. <",
return (1);
}
"fcfi_pause_evt_action:%d. Offline already requested. <",
return (1);
}
case FCFI_STATE_OFFLINE:
"fcfi_pause_evt_action:%d flag=%x. Already offline. <",
break;
case FCFI_STATE_PAUSED:
"fcfi_pause_evt_action:%d flag=%x. Already paused. <",
break;
/* Wait states */
case FCFI_STATE_VFI_ONLINE:
case FCFI_STATE_VFI_OFFLINE:
case FCFI_STATE_REG:
case FCFI_STATE_ONLINE:
"fcfi_pause_evt_action:%d flag=%x. Handle pause request.",
/* Handle offline now */
break;
/* Transitional states */
default:
"fcfi_pause_evt_action:%d. "
"Invalid state. <",
break;
}
return (rval);
} /* emlxs_fcfi_pause_evt_action() */
/*ARGSUSED*/
static uint32_t
{
"fcfi_unreg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"fcfi_unreg_failed_action:%d attempt=%d reason=%x. "
"Unreg cmpl.",
} else {
"fcfi_unreg_failed_action:%d attempt=%d. Unregistering.",
}
return (rval);
} /* emlxs_fcfi_unreg_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcfi_reg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"fcfi_reg_failed_action:%d attempt=%d reason=%x. Reg cmpl.",
} else {
"fcfi_reg_failed_action:%d attempt=%d. Registering.",
}
return (rval);
} /* emlxs_fcfi_reg_failed_action() */
/*ARGSUSED*/
static uint32_t
{
"fcfi_reg_mbcmpl:%d state=%s.",
return (0);
}
"fcfi_reg_mbcmpl:%d failed. %s. >",
return (0);
}
"fcfi_reg_mbcmpl:%d FCFI=%d. Reg complete. >",
0, 0, 0);
return (0);
} /* emlxs_fcfi_reg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcfi_reg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
fcftab->fcfi_online++;
}
}
"fcfi_reg_action:%d attempts=%d. Offline requested.",
return (rval);
}
"fcfi_reg_action:%d. Already registered. "
"Skipping REG_FCFI update.",
return (rval);
}
"fcfi_reg_action:%d attempts=%d. Sending REG_FCFI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
}
/* Ignore the fcf record and force FPMA */
return (rval);
}
return (0);
} /* emlxs_fcfi_reg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcfi_reg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_reg_cmpl_action:%d. Offline requested.",
return (rval);
}
"fcfi_reg_cmpl_action:%d attempts=%d. Reg cmpl.",
return (rval);
} /* emlxs_fcfi_reg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
{
"fcfi_unreg_mbcmpl:%d state=%s.",
return (0);
}
"fcfi_unreg_mbcmpl:%d failed. %s. >",
return (0);
}
"fcfi_unreg_mbcmpl:%d. Unreg complete. >",
0, 0, 0);
return (0);
} /* emlxs_fcfi_unreg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcfi_unreg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_unreg_action:%d. Not registered. "
"Skipping UNREG_FCFI.",
return (rval);
}
}
"fcfi_unreg_action:%d attempts=%d. Sending UNREG_FCFI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
return (rval);
}
return (0);
} /* emlxs_fcfi_unreg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcfi_unreg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_unreg_cmpl_action:%d attempts=%d. Going offline.",
return (rval);
} /* emlxs_fcfi_unreg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"fcfi_online_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"fcfi_online_action:%d attempts=%d. Offline requested.",
return (rval);
}
/* Online remaining VFI's for this FCFI */
continue;
}
"fcfi_online_action:%d vfi_online=%d. Onlining VFI:%d. >",
}
/* Perform VSAN discovery check when first VFI goes online */
/* Perform VSAN Discovery (TBD) */
/* For now we only need 1 VFI */
"fcfi_online_action:%d vfi_online=%d. "
"VSAN discovery required.",
fcfp->vfi_online);
}
}
"fcfi_online_action:%d vfi_online=%d. "
"FCFI online. Notifying fcftab. >",
fcfp->vfi_online);
/* Notify FCFTAB */
return (rval);
} /* emlxs_fcfi_online_action() */
/*ARGSUSED*/
static int
{
int i;
uint32_t j;
uint32_t k;
/* Init the primary flag, we may set it later */
/* Nothing specified, so everything matches */
/* For nonFIP only use index 0 */
return (1); /* success */
}
return (0);
}
/* Just check FCMap for now */
return (1); /* success */
}
return (0);
}
/* For FIP mode, the FCF record must match Config Region 23 */
sizeof (tlv_fcfconnectentry_t);
valid_entry = 0;
match_found = 0;
for (i = 0; i < entry_count; i++) {
continue;
}
valid_entry = 1;
match_found = 0;
continue;
}
match_found = 1;
}
valid_entry = 1;
match_found = 0;
continue;
}
match_found = 1;
}
valid_entry = 1;
match_found = 0;
continue;
}
j = VLanId / 8;
if (!(fcfrec->vlan_bitmap[j] & k)) {
match_found = 0;
continue;
}
/* Assign requested vlan_id to this FCF */
match_found = 1;
}
/* If a match was found */
if (match_found) {
}
}
return (1);
}
}
/* If no valid entries found, then allow any fabric */
if (!valid_entry) {
return (1);
}
return (0);
} /* emlxs_fcf_configured() */
static void
{
uint16_t i;
/* Clear VLAN info */
/* Check if fcf is a member of a VLAN */
for (i = 0; i < 4096; i++) {
/* For now assign the VLAN id of the first VLAN found */
break;
}
}
if (fcf_rec->fcf_available) {
} else {
}
} else {
}
/* Check config region 23 */
/* Also sets BOOT and PRIMARY cfg bits as needed */
} else {
}
/* Set fcfp priority. Used by selection alogithm */
/* Combination of BOOT:PRIMARY:~fip_priority */
"fcfi:%d gen=%x iotag=%d flag=%x sol=%x avl=%x val=%x state=%x "
"map=%x pri=%x vid=%x",
"fcfi:%d mac=%02x:%02x:%02x:%02x:%02x:%02x "
"fabric=%02x%02x%02x%02x%02x%02x%02x%02x "
"switch=%02x%02x%02x%02x%02x%02x%02x%02x",
return;
} /* emlxs_fcfi_update() */
/* ************************************************************************** */
/* VFI */
/* ************************************************************************** */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_vfi_state_table[i].string);
}
}
return (buffer);
} /* emlxs_vfi_state_xlate() */
static uint32_t
void *arg1)
{
/* Convert event to action table index */
switch (evt) {
case FCF_EVENT_STATE_ENTER:
index = 0;
break;
case FCF_EVENT_VFI_ONLINE:
index = 1;
break;
case FCF_EVENT_VFI_OFFLINE:
index = 2;
break;
case FCF_EVENT_VFI_PAUSE:
index = 3;
break;
case FCF_EVENT_VPI_ONLINE:
index = 4;
break;
case FCF_EVENT_VPI_OFFLINE:
index = 5;
break;
default:
return (1);
}
if (!func) {
"vfi_action:%d %s:%s arg=%p. No action. <",
return (1);
}
return (rval);
} /* emlxs_vfi_action() */
static uint32_t
void *arg1)
{
/* Filter events and acquire fcfi context */
switch (evt) {
case FCF_EVENT_VPI_ONLINE:
case FCF_EVENT_VPI_OFFLINE:
if (!vpip) {
"vfi_event: %s arg=%p. Null VPI found. <",
return (1);
}
if (!vfip) {
"vfi_event: %s arg=%p. VFI not found. <",
return (1);
}
break;
case FCF_EVENT_VFI_ONLINE:
case FCF_EVENT_VFI_OFFLINE:
case FCF_EVENT_VFI_PAUSE:
if (!vfip) {
"vfi_event: %s arg=%p. VFI not found. <",
return (1);
}
break;
default:
return (1);
}
"vfi_event:%d %s:%s arg=%p",
return (rval);
} /* emlxs_vfi_event() */
/*ARGSUSED*/
static uint32_t
{
if (state >= VFI_ACTION_STATES) {
"vfi_state:%d %s. "
"Invalid state. <",
return (1);
}
(reason != FCF_REASON_REENTER)) {
"vfi_state:%d %s:%s:0x%x arg=%p. "
"State not changed. <",
return (1);
}
if (!reason) {
"vfi_state:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"vfi_state:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"vfi_state:%d %s-->%s:%s:0x%x arg=%p",
} else {
"vfi_state:%d %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_vfi_state() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_VPI_ONLINE) {
"vfi_vpi_online_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
case VFI_STATE_ONLINE:
"vfi_vpi_online_evt_action:%d flag=%x vpi_online=%d. "
"Reentering online.",
vfip->vpi_online);
break;
case VFI_STATE_VPI_ONLINE:
"vfi_vpi_online_evt_action:%d flag=%x vpi_online=%d. "
"Online cmpl.",
vfip->vpi_online);
break;
default:
"vfi_vpi_online_evt_action:%d flag=%x vpi_online=%d. <",
vfip->vpi_online);
return (1);
}
return (rval);
} /* emlxs_vfi_vpi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
{
return (0);
}
if (vfip->vpi_online) {
FCF_REASON_REQUESTED, 0, arg1);
} else {
0, arg1);
}
FCF_REASON_REQUESTED, 0, arg1);
FCF_REASON_REQUESTED, 0, arg1);
} else {
FCF_REASON_REQUESTED, 0, arg1);
}
return (rval);
} /* emlxs_vfi_offline_handler() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_VPI_OFFLINE) {
"vfi_vpi_offline_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
/* Disconnect VPI object from VFI */
case VFI_STATE_ONLINE:
case VFI_STATE_VPI_ONLINE:
if (vfip->vpi_online == 0) {
"vfi_vpi_offline_evt_action:%d flag=%x "
"vpi_online=%d. Offlining.",
} else {
"vfi_vpi_offline_evt_action:%d flag=%x "
"vpi_online=%d. <",
}
break;
case VFI_STATE_PAUSED:
"vfi_vpi_offline_evt_action:%d flag=%x vpi_online=%d. <",
break;
case VFI_STATE_VPI_OFFLINE:
"vfi_vpi_offline_evt_action:%d flag=%x. VPI offline cmpl.",
break;
"vfi_vpi_offline_evt_action:%d flag=%x. VPI offline cmpl.",
break;
default:
if (vfip->vpi_online == 0) {
"vfi_vpi_offline_evt_action:%d flag=%x "
"vpi_online=%d. Requesting offline. <",
} else {
"vfi_vpi_offline_evt_action:%d flag=%x "
"vpi_online=%d. <",
}
return (1);
}
return (rval);
} /* emlxs_vfi_vpi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
if (evt != FCF_EVENT_VFI_ONLINE) {
"vfi_online_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"vfi_online_evt_action:%d flag=%x. "
"Online already requested. <",
return (0);
}
case VFI_STATE_OFFLINE:
"vfi_online_evt_action:%d flag=%x. Initiating online.",
break;
case VFI_STATE_VPI_OFFLINE:
case VFI_STATE_PAUSED:
"vfi_online_evt_action:%d flag=%x. Initiating online.",
break;
case VFI_STATE_ONLINE:
/* Online all VPI's belonging to this vfi */
continue;
}
continue;
}
"vfi_online_evt_action:%d. Onlining VPI:%d >",
vpip);
}
break;
default:
"vfi_online_evt_action:%d flag=%x. <",
return (1);
}
return (rval);
} /* emlxs_vfi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_VFI_OFFLINE) {
"vfi_offline_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"vfi_offline_evt_action:%d flag=%x. "
"Offline already requested. <",
return (0);
}
case VFI_STATE_OFFLINE:
"vfi_offline_evt_action:%d flag=%x. "
"Already offline. <",
break;
/* Wait states */
case VFI_STATE_VPI_ONLINE:
case VFI_STATE_VPI_OFFLINE:
case VFI_STATE_INIT:
case VFI_STATE_REG:
case VFI_STATE_ONLINE:
case VFI_STATE_PAUSED:
"vfi_offline_evt_action:%d flag=%x. Handling offline.",
/* Handle offline now */
break;
default:
"vfi_offline_evt_action:%d flag=%x. <",
break;
}
return (rval);
} /* emlxs_vfi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_VFI_PAUSE) {
"vfi_pause_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"vfi_pause_evt_action:%d flag=%x. "
"Pause already requested. <",
return (0);
}
"vfi_pause_evt_action:%d flag=%x. "
"Offline already requested. <",
return (0);
}
case VFI_STATE_OFFLINE:
"vfi_pause_evt_action:%d flag=%x. "
"Already offline. <",
break;
case VFI_STATE_PAUSED:
"vfi_pause_evt_action:%d flag=%x. "
"Already paused. <",
break;
/* Wait states */
case VFI_STATE_VPI_ONLINE:
case VFI_STATE_INIT:
case VFI_STATE_REG:
case VFI_STATE_ONLINE:
"vfi_pause_evt_action:%d flag=%x. Handling offline.",
/* Handle offline now */
break;
default:
"vfi_pause_evt_action:%d flag=%x. <",
break;
}
return (rval);
} /* emlxs_vfi_pause_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_offline_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_offline_action:%d %s:%s arg=%p flag=%x. "
"Null fcfp found. <",
return (1);
}
"vfi_offline_action:%d vfi_online=%d. <",
return (0);
}
if (vfip->vpi_online) {
"vfi_offline_action:%d vpi_online=%d. VPI's still online.",
vfip->vpi_online);
}
}
}
/* Check if online was requested */
"vfi_offline_action:%d vfi_online=%d. Online requested.",
FCF_REASON_REQUESTED, 0, arg1);
return (rval);
}
"vfi_offline_action:%d vfi_online=%d. "
"VFI offline. Notifying FCFI:%d >",
/* Notify FCFI */
return (rval);
} /* emlxs_vfi_offline_action() */
/*ARGSUSED*/
static uint32_t
{
"vfi_init_mbcmpl:%d %s.",
return (0);
}
"vfi_init_mbcmpl:%d failed. %s. >",
return (0);
}
"vfi_init_mbcmpl:%d. Init complete. >",
return (0);
} /* emlxs_vfi_init_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_init_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
}
"vfi_init_action:%d attempts=%d. Offline requested.",
return (rval);
}
"vfi_init_action:%d flag=%x. "
"Already init'd. Skipping INIT_VFI.",
return (rval);
}
"vfi_init_action:%d. First VFI. Skipping INIT_VFI.",
return (rval);
}
"vfi_init_action:%d vfi_online=%d attempts=%d. Sending INIT_VFI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
/* ??? This function is untested and incomplete */
return (rval);
}
return (0);
} /* emlxs_vfi_init_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_init_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"vfi_init_action:%d attempt=%d reason=%x. Init cmpl.",
} else {
"vfi_init_action:%d attempt=%d. Initializing.",
}
return (rval);
} /* emlxs_vfi_init_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_init_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_init_cmpl_action:%d attempts=%d. Init cmpl.",
return (rval);
} /* emlxs_vfi_init_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"vfi_vpi_online_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_vpi_online_action:%d. Offline requested.",
return (rval);
}
if (vfip->logi_count) {
"vfi_vpi_online_action:%d vpi_online=%d logi_count=%d. "
"VPI already logged in.",
vfip->logi_count);
}
if (vfip->vpi_online) {
/* Waking up after being paused */
/* Find first VPI of this VFI */
continue;
}
break;
}
}
} else {
/* Find first available VPI */
continue;
}
break;
}
}
}
"vfi_vpi_online_action:%d vpi_online=%d logi_count=%d. "
"No VPI found. Offlining.",
vfip->logi_count);
return (rval);
}
"vfi_vpi_online_action:%d vpi_online=%d logi_count=%d. "
"Onlining VPI:%d >",
/* Wait for FCF_EVENT_VPI_ONLINE in return */
return (rval);
} /* emlxs_vfi_vpi_online_action() */
/*ARGSUSED*/
static uint32_t
{
"vfi_vpi_online_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_vpi_online_cmpl_action:%d flag=%x vpi_online=%d "
"logi_count=%d. flogi_vpi. Registering.",
vfip->logi_count);
} else {
/* Waking up after pause */
"vfi_vpi_online_cmpl_action:%d flag=%x vpi_online=%d "
"logi_count=%d. Going online.",
vfip->logi_count);
}
return (rval);
} /* emlxs_vfi_vpi_online_cmpl_action() */
/*ARGSUSED*/
static uint32_t
{
"vfi_vpi_offline_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
if ((vfip->vpi_online == 0) &&
"vfi_vpi_offline_cmpl_action:%d vpi_online=%d. "
"Unregistering.",
vfip->vpi_online);
} else {
"vfi_vpi_offline_cmpl_action:%d vpi_online=%d. <",
vfip->vpi_online);
}
return (rval);
} /* emlxs_vfi_vpi_offline_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
"vfi_vpi_offline_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_vpi_offline_action:%d vpi_online=%d. Pausing.",
vfip->vpi_online);
return (rval);
}
if (vfip->vpi_online == 0) {
"vfi_vpi_offline_action:%d vpi_online=%d. "
"VPI already offline. Skipping VPI offline.",
vfip->vpi_online);
return (rval);
}
/* Offline all VPI's of this VFI */
continue;
}
"vfi_vpi_offline_action:%d. Offlining VPI:%d. >",
}
/* Wait for FCF_EVENT_VPI_OFFLINE in return */
return (0);
} /* emlxs_vfi_vpi_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
"vfi_paused_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
/* Pause all VPI's of this VFI */
continue;
}
"vfi_paused_action:%d vpi_online=%d. Pausing VPI:%d. >",
}
"vfi_paused_action:%d vpi_online=%d. VFI paused. <",
vfip->vpi_online);
return (0);
} /* emlxs_vfi_paused_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_unreg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"vfi_unreg_failed_action:%d attempt=%d. Unreg cmpl.",
} else {
"vfi_unreg_failed_action:%d attempt=%d. Unregistering.",
}
return (rval);
} /* emlxs_vfi_unreg_failed_action() */
/*ARGSUSED*/
static uint32_t
{
"vfi_unreg_mbcmpl:%d state=%s.",
return (0);
}
"vfi_unreg_mbcmpl:%d failed. %s. >",
return (0);
}
"vfi_unreg_mbcmpl:%d. Unreg complete. >",
0, 0, 0);
return (0);
} /* emlxs_vfi_unreg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_unreg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_unreg_action:%d. Not registered. Skipping UNREG_VFI.",
return (rval);
}
}
"vfi_unreg_action:%d attempts=%d. Sending UNREG_VFI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
return (rval);
}
return (0);
} /* emlxs_vfi_unreg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_unreg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_unreg_cmpl_action:%d attempts=%d. Going offline.",
return (rval);
} /* emlxs_vfi_unreg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_reg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"vfi_reg_failed_action:%d attempt=%d reason=%x. Reg cmpl.",
} else {
"vfi_reg_failed_action:%d attempt=%d. Registering.",
}
return (rval);
} /* emlxs_vfi_reg_failed_action() */
/*ARGSUSED*/
static uint32_t
{
"vfi_reg_mbcmpl:%d state=%s.",
return (0);
}
"vfi_reg_mbcmpl:%d failed. %s. >",
return (0);
}
/* Archive a copy of the sparams in case we need them later */
sizeof (SERV_PARM));
if (vfip->flogi_vpip) {
}
}
"vfi_reg_mbcmpl:%d. Reg complete. >",
return (0);
} /* emlxs_vfi_reg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_reg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"vfi_reg_action:%d %attempts=%d. Offline requested.",
return (rval);
}
if (!vfip->flogi_vpip) {
"vfi_reg_action:%d %attempts=%d. No flogi_vpi found.",
return (rval);
}
"vfi_reg_action:%d flag=%x. "
"Already registered. Skipping REG_VFI update.",
return (rval);
}
/* Get the flogi_vpip's fabric_rpip's service parameters */
1000000;
} else {
}
"vfi_reg_action:%d attempts=%d edtov=%d ratov=%d. "
"Updating REG_VFI. <",
} else {
"vfi_reg_action:%d attempts=%d edtov=%d ratov=%d. "
"Sending REG_VFI. <",
}
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
FCF_REASON_NO_BUFFER, 0, arg1);
return (1);
}
/* If the flogi_vpip was not previously registered, */
/* perform the REG_VPI now */
}
wwpn++;
sizeof (SERV_PARM));
return (rval);
}
return (0);
} /* emlxs_vfi_reg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_reg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_reg_cmpl_action:%d attempts=%d. Offline requested.",
return (rval);
}
"vfi_reg_cmpl_action:%d attempts=%d. Going online.",
return (rval);
} /* emlxs_vfi_reg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"vfi_online_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vfi_online_action:%d attempts=%d. Offline requested.",
return (rval);
}
/* Take the port's Fabric RPI online now */
"vfi_online_action:%d. Onlining Fabric RPI. >",
vpip->fabric_rpip);
/* It is now safe to accept unsolicited requests */
/* Online remaining VPI's */
continue;
}
continue;
}
"vfi_online_action:%d vpi_online=%d logi_count=%d. "
"Onlining VPI:%d >",
}
"vfi_online_action:%d vpi_online=%d logi_count=%d. "
"VFI online. Notifying FCFI:%d. >",
/* Notify FCFI */
return (rval);
} /* emlxs_vfi_online_action() */
/* ************************************************************************** */
/* VPI */
/* ************************************************************************** */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_vpi_state_table[i].string);
}
}
return (buffer);
} /* emlxs_vpi_state_xlate() */
static uint32_t
void *arg1)
{
/* Convert event to action table index */
switch (evt) {
case FCF_EVENT_STATE_ENTER:
index = 0;
break;
case FCF_EVENT_VPI_ONLINE:
index = 1;
break;
case FCF_EVENT_VPI_OFFLINE:
index = 2;
break;
case FCF_EVENT_VPI_PAUSE:
index = 3;
break;
case FCF_EVENT_RPI_ONLINE:
index = 4;
break;
case FCF_EVENT_RPI_OFFLINE:
index = 5;
break;
case FCF_EVENT_RPI_PAUSE:
index = 6;
break;
default:
return (1);
}
if (!func) {
"vpi_action:%d %s:%s arg=%p. No action. <",
return (1);
}
return (rval);
} /* emlxs_vpi_action() */
static uint32_t
void *arg1)
{
/* Filter events and acquire fcfi context */
switch (evt) {
case FCF_EVENT_RPI_ONLINE:
case FCF_EVENT_RPI_OFFLINE:
case FCF_EVENT_RPI_PAUSE:
if (!rpip) {
"vpi_event: %s arg=%p. Null RPI found. <",
return (1);
}
break;
case FCF_EVENT_VPI_ONLINE:
case FCF_EVENT_VPI_PAUSE:
case FCF_EVENT_VPI_OFFLINE:
if (!vpip) {
"vpi_event: %s arg=%p. Null VPI found. <",
return (1);
}
break;
default:
return (1);
}
"vpi_event:%d %s:%s arg=%p",
return (rval);
} /* emlxs_vpi_event() */
/*ARGSUSED*/
static uint32_t
{
if (state >= VPI_ACTION_STATES) {
return (1);
}
(reason != FCF_REASON_REENTER)) {
"vpi_state:%d %s:%s:0x%x arg=%p. "
"State not changed. <",
return (1);
}
if (!reason) {
"vpi_state:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"vpi_state:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"vpi_state:%d %s-->%s:%s:0x%x arg=%p",
} else {
"vpi_state:%d %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_vpi_state() */
extern uint32_t
{
uint32_t i = 0;
return (1);
}
/* Wait for VPI to go online */
if (i++ > 30) {
break;
}
}
}
return (0);
}
goto done;
}
/* We need to select a VFI for this VPI */
/* First find a selected Fabric */
for (i = 0; i < fcftab->fcfi_count; i++) {
break;
}
}
if (!fcfp) {
"vpi_port_bind_notify:%d %s. "
"No FCF available yet.",
return (0);
}
/* Find first available VFI for this FCFI */
break;
}
}
if (!vfip) {
"vpi_port_bind_notify:%d %s fcfi:%d. "
"No VFI available yet.",
return (0);
}
done:
"vpi_port_bind_notify:%d %s fcfi:%d vfi:%d. Onlining VPI:%d >",
return (rval);
} /* emlxs_vpi_port_bind_notify() */
extern uint32_t
{
uint32_t i;
return (1);
}
return (0);
}
return (0);
}
/*
* Set flag to indicate that emlxs_vpi_port_unbind_notify
* has been called
*/
"vpi_port_unbind_notify:%d %s fcfi:%d vfi:%d. "
"Offlining VPI:%d,%d >",
/* Wait for VPI to go offline */
i = 0;
while (i++ < 120) {
break;
}
BUSYWAIT_MS(1000);
}
if (i >= 120) {
"vpi_port_unbind_notify:%d %s fcfi:%d vfi:%d "
"rpi_online=%d,%d. Offline timeout.",
}
}
return (rval);
} /* emlxs_vpi_port_unbind_notify() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_RPI_OFFLINE) {
"vpi_rpi_offline_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
case VPI_STATE_LOGO:
/* rpi_online will be checked when LOGO is complete */
"vpi_rpi_offline_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. Waiting for LOGO. <",
rval = 0;
break;
case VPI_STATE_PORT_OFFLINE:
"vpi_rpi_offline_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d.",
break;
case VPI_STATE_PAUSED:
"vpi_rpi_offline_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. VPI paused. <",
rval = 0;
break;
case VPI_STATE_ONLINE:
"vpi_rpi_offline_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. <",
rval = 0;
break;
default:
"vpi_rpi_offline_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. "
"Invalid state. <",
rval = 1;
break;
}
return (rval);
} /* emlxs_vpi_rpi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_RPI_PAUSE) {
"vpi_rpi_pause_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
case VPI_STATE_LOGO:
/* rpi_online will be checked when LOGO is complete */
"vpi_rpi_pause_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. Waiting for LOGO. <",
rval = 0;
break;
case VPI_STATE_PORT_OFFLINE:
"vpi_rpi_pause_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d.",
FCF_REASON_REENTER, 0, 0);
break;
case VPI_STATE_PAUSED:
"vpi_rpi_pause_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. VPI already paused. <",
rval = 0;
break;
default:
"vpi_rpi_pause_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. "
"Invalid state. <",
rval = 1;
break;
}
return (rval);
} /* emlxs_vpi_rpi_pause_evt_action() */
/*ARGSUSED*/
static uint32_t
{
if (evt != FCF_EVENT_RPI_ONLINE) {
"vpi_rpi_online_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"vpi_rpi_online_evt_action:%d rpi_online=%d,%d did=%x rpi=%d. <",
return (0);
} /* emlxs_vpi_rpi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_VPI_ONLINE) {
"vpi_online_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"vpi_online_evt_action:%d flag=%x. "
"Online already requested. <",
return (1);
}
case VPI_STATE_OFFLINE:
"vpi_online_evt_action:%d flag=%x. Initiating online.",
break;
case VPI_STATE_PORT_OFFLINE:
case VPI_STATE_PAUSED:
"vpi_online_evt_action:%d flag=%x. Initiating online.",
break;
default:
"vpi_online_evt_action:%d flag=%x. <",
return (1);
}
return (rval);
} /* emlxs_vpi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
{
return (0);
}
FCF_REASON_REQUESTED, 0, arg1);
FCF_REASON_REQUESTED, 0, arg1);
FCF_REASON_REQUESTED, 0, arg1);
FCF_REASON_REQUESTED, 0, arg1);
} else {
FCF_REASON_REQUESTED, 0, arg1);
}
return (rval);
} /* emlxs_vpi_offline_handler() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_VPI_OFFLINE) {
"vpi_offline_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"vpi_offline_evt_action:%d flag=%x. "
"Offline already requested. <",
return (1);
}
case VPI_STATE_PORT_OFFLINE:
"vpi_offline_evt_action:%d flag=%x. Clear nodes.",
arg1);
break;
}
"vpi_offline_evt_action:%d flag=%x. Handling offline.",
/* Handle offline now */
break;
case VPI_STATE_PAUSED:
if (vpip->rpi_paused) {
"vpi_offline_evt_action:%d flag=%x. Clear nodes.",
arg1);
break;
}
"vpi_offline_evt_action:%d flag=%x. Handling offline.",
/* Handle offline now */
break;
/* wait states */
case VPI_STATE_UNREG:
case VPI_STATE_PORT_ONLINE:
case VPI_STATE_LOGI:
case VPI_STATE_INIT:
case VPI_STATE_REG:
case VPI_STATE_ONLINE:
"vpi_offline_evt_action:%d flag=%x. Handling offline.",
/* Handle offline now */
break;
/* Transitional states */
default:
"vpi_offline_evt_action:%d flag=%x. <",
break;
}
return (rval);
} /* emlxs_vpi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_VPI_PAUSE) {
"vpi_pause_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
"vpi_pause_evt_action:%d flag=%x. "
"Pause already requested. <",
return (1);
}
"vpi_pause_evt_action:%d flag=%x. "
"Offline already requested. <",
return (1);
}
/* Fabric logo is implied */
}
case VPI_STATE_PORT_OFFLINE:
"vpi_pause_evt_action:%d flag=%x. "
"Already offline. <",
break;
case VPI_STATE_PAUSED:
"vpi_pause_evt_action:%d flag=%x. "
"Already paused. <",
break;
/* Wait states */
case VPI_STATE_UNREG:
case VPI_STATE_PORT_ONLINE:
case VPI_STATE_LOGI:
case VPI_STATE_INIT:
case VPI_STATE_REG:
case VPI_STATE_ONLINE:
"vpi_pause_evt_action:%d flag=%x. Handling offline.",
/* Handle offline now */
break;
/* Transitional states */
default:
"vpi_pause_evt_action:%d flag=%x. <",
break;
}
return (rval);
} /* emlxs_vpi_pause_evt_action() */
/* ARGSUSED */
static void
{
return;
} /* emlxs_deferred_cmpl_thread() */
/* ARGSUSED */
static void
{
return;
} /* emlxs_port_offline_thread() */
/* ARGSUSED */
static void
{
(void) emlxs_port_online(port);
return;
} /* emlxs_port_online_thread() */
/*ARGSUSED*/
static void
{
}
}
}
} /* emlxs_vpi_logo_handler() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_port_offline_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_port_offline_action:%d flag=%x. Offlining port...",
/* Pause FCP2 nodes */
} else {
}
return (rval);
}
}
"vpi_port_offline_action:%d rpi_online=%d,%d. "
"Pausing. Waiting for RPI's. <",
return (0);
}
/* Take the Fabric RPI offline now */
"vpi_port_offline_action:%d. "
"Offlining Fabric RPI. >",
vpip->fabric_rpip);
}
"vpi_port_offline_action:%d rpi_online=%d,%d. Pausing.",
return (rval);
}
if (vpip->rpi_online > 0) {
"vpi_port_offline_action:%d rpi_online=%d,%d. Offlining. "
"Waiting for RPI's. <",
return (0);
}
/* Take the Fabric RPI offline now */
"vpi_port_offline_action:%d. Offlining Fabric RPI. >",
vpip->fabric_rpip);
}
"vpi_port_offline_action:%d rpi_online=%d,%d. Offlining. "
"Unreg VPI.",
return (rval);
} /* emlxs_vpi_port_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_paused_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_paused_action:%d rpi_online=%d,%d. VPI paused. <",
return (0);
} /* emlxs_vpi_paused_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_offline_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_offline_action:%d %s:%s arg=%p flag=%x. "
"Null vfip found. <",
return (1);
}
/* Take the Fabric RPI offline, if still active */
"vpi_offline_action:%d. Offlining Fabric RPI. >",
vpip->fabric_rpip);
}
}
}
/* Check if online was requested */
"vpi_offline_action:%d vpi_online=%d. Online requested.",
FCF_REASON_REQUESTED, 0, arg1);
return (rval);
}
"vpi_offline_action:%d vpi_online=%d. "
"VPI offline. Notifying VFI:%d. >",
/* Notify VFI */
return (rval);
} /* emlxs_vpi_offline_action() */
/*ARGSUSED*/
static uint32_t
{
"vpi_init_mbcmpl:%d %s.",
return (0);
}
"vpi_init_mbcmpl:%d failed. %s. >",
return (0);
}
"vpi_init_mbcmpl:%d. Init complete. >",
0, 0, 0);
return (0);
} /* emlxs_vpi_init_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_init_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"vpi_init_action:%d attempts=%d. Offline requested.",
return (rval);
}
}
"vpi_init_action:%d. First VPI. Skipping INIT_VPI.",
return (rval);
}
"vpi_init_action:%d flag=%x. "
"Already init'd. Skipping INIT_VPI.",
return (rval);
}
"vpi_init_action:%d vpi_online=%d attempts=%d. Sending INIT_VPI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
return (rval);
}
return (0);
} /* emlxs_vpi_init_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_init_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"vpi_init_action:%d attempt=%d reason=%x. Init cmpl.",
} else {
"vpi_init_action:%d attempt=%d. Initializing.",
}
return (rval);
} /* emlxs_vpi_init_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_init_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_init_cmpl_action:%d attempts=%d. Onlining port.",
return (rval);
} /* emlxs_vpi_init_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_port_online_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_port_online_action:%d. Port already online.",
}
"vpi_port_online_action:%d. Offline requested.",
return (rval);
}
/* Initialize the Fabric RPI */
}
/* Notify ULP */
"vpi_port_online_action:%d. Loopback mode. "
"Registering VPI.",
}
sizeof (SERV_PARM));
/* Update the VPI Fabric RPI */
return (rval);
}
}
"vpi_port_online_action:%d vpi_online=%d. Onlining port... <",
} else {
}
/* Wait for emlxs_vpi_logi_notify() */
return (0);
} /* emlxs_vpi_port_online_action() */
extern uint32_t
{
return (1);
}
"vpi_logi_notify:%d %s.",
return (1);
}
"vpi_logi_notify:%d %s. "
"Invalid state.",
return (1);
}
"vpi_logi_notify:%d %s. "
"Logging in. >",
0, 0, sbp);
if (rval) {
"vpi_logi_notify:%d %s rval=%d.",
rval);
}
return (rval);
} /* emlxs_vpi_logi_notify() */
static uint32_t
{
/* EMLXS_FCF_LOCK must be held when calling this routine */
"vpi_logi_cmpl_notify:%d %s. "
"Invalid state.",
return (1);
}
"vpi_logi_cmpl_notify:%d %s. P2P mode. "
"Completing FLOGI.",
}
/* Wait for P2P PLOGI completion to continue */
return (0);
}
"vpi_logi_cmpl_notify:%d. Null sbp.",
return (1);
}
"vpi_logi_cmpl_notify:%d %s. Fabric mode. "
"Completing login. >",
0, 0, 0);
if (rval) {
"vpi_logi_cmpl_notify:%d %s rval=%d.",
rval);
}
return (rval);
}
"vpi_logi_cmpl_notify:%d %s did=0. P2P mode. "
"Wait for PLOGI compl.",
}
/* Wait for P2P PLOGI completion to continue */
return (0);
}
"vpi_logi_cmpl_notify:%d %s. P2P mode. "
"Completing login. >",
0, 0, 0);
if (rval) {
"vpi_logi_cmpl_notify:%d %s rval=%d.",
rval);
}
return (rval);
}
return (1);
} /* emlxs_vpi_logi_cmpl_notify() */
extern uint32_t
{
return (1);
}
"vpi_logi_failed_notify:%d %s. "
"Invalid state.",
/* Fabric logo is implied */
return (1);
}
"vpi_logi_failed_notify:%d %s. "
"Failing login. >",
/* For safety */
}
if (sbp) {
sizeof (emlxs_deferred_cmpl_t), KM_SLEEP);
}
FCF_REASON_OP_FAILED, 1, 0);
}
return (rval);
} /* emlxs_vpi_logi_failed_notify() */
extern uint32_t
{
return (1);
}
/* Fabric logo is complete */
/* Already offline. Do nothing */
return (0);
}
"vpi_logo_cmpl_notify:%d %s fcfi:%d vfi:%d. "
"Offlining VPI:%d,%d >",
return (rval);
} /* emlxs_vpi_logo_cmpl_notify() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_logi_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_logi_action:%d. Offline requested.",
return (rval);
}
"vpi_logi_action:%d flag=%x. LOGI already set.",
/* Fabric logo is implied */
}
/* Check if FC_PT_TO_PT is set */
"vpi_logi_action:%d logi_count=%d. FLOGI set. P2P. <",
}
return (0);
}
/* Set login command based on vfi logi_count */
"vpi_logi_action:%d logi_count=%d. FLOGI set. <",
} else {
"vpi_logi_action:%d logi_count=%d. FDISC set. <",
}
return (0);
} /* emlxs_vpi_logi_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_logi_failed_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
/* Fabric logo is implied */
"vpi_logi_failed_action:%d. Private loop. "
"Registering VPI.",
/* Update the VPI flogi_vpip pointer for loop */
/* because the vpi_logo_handler cleared it */
sizeof (SERV_PARM));
/* Update the VPI Fabric RPI */
return (rval);
}
"vpi_logi_failed_action:%d. Requesting offline.",
return (rval);
} /* emlxs_vpi_logi_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
char buffer1[64];
char buffer2[64];
uint32_t new_config = 0;
"vpi_logi_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
/* Check for new fabric */
if (SLI4_FCOE_MODE) {
/* Check for FCF change */
new_config = 1;
}
} else {
/* Check for topology change (0=loop 1=fabric) */
new_config = 1;
/* Check for any switch change */
new_config = 1;
}
}
}
if (new_config) {
"vpi_logi_cmpl_action:%d. "
"New config. Offlining port.",
"vpi_logi_cmpl_action: prev_wwpn=%s wwpn=%s prev_did=%x "
"did=%x.",
return (rval);
}
"vpi_logi_cmpl_action:%d. Registering.",
return (rval);
} /* emlxs_vpi_logi_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_logo_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"vpi_logo_failed_action:%d attempt=%d. Logo cmpl.",
"vpi_logo_failed_action:%d attempt=%d. Logo cmpl.",
} else {
"vpi_logo_failed_action:%d attempt=%d. Logging out.",
}
return (rval);
} /* emlxs_vpi_logo_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_logo_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_logo_action:%d. No login. Skipping LOGO.",
return (rval);
}
"vpi_logo_action:%d. HBA offline. Skipping LOGO.",
/* Fabric logo is implied */
return (rval);
}
if (SLI4_FC_MODE) {
"vpi_logo_action:%d. FC mode. Skipping LOGO.",
/* Fabric logo is implied */
return (rval);
}
}
did = FABRIC_DID;
"vpi_logo_action:%d attempts=%d sid=%x did=%x. Sending LOGO. <",
if (!pkt) {
FCF_REASON_NO_PKT, 0, arg1);
return (rval);
}
/* Build the fc header */
/* Build the command */
/* Send the pkt now */
if (rval != FC_SUCCESS) {
/* Free the pkt */
return (rval);
}
/* For now we will send and forget */
return (rval);
} /* emlxs_vpi_logo_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_logo_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
/* Fabric logo is complete */
"vpi_logo_cmpl_action:%d attempts=%d. Offline RPI's.",
return (rval);
} /* emlxs_vpi_logo_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_unreg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"vpi_unreg_failed_action:%d attempt=%d. Unreg cmpl.",
} else {
"vpi_unreg_failed_action:%d attempt=%d. Unregistering.",
}
return (rval);
} /* emlxs_vpi_unreg_failed_action() */
/*ARGSUSED*/
static uint32_t
{
"vpi_unreg_mbcmpl:%d state=%s.",
return (0);
}
"vpi_unreg_mbcmpl:%d failed. %s. >",
return (0);
}
"vpi_unreg_mbcmpl:%d. Unreg complete. >",
return (0);
} /* emlxs_vpi_unreg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_unreg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_unreg_action:%d rpi_online=%d,%d fstate=%x. "
return (rval);
}
"vpi_unreg_action:%d. Not registered. Skipping UNREG_VPI.",
return (rval);
}
"vpi_unreg_action:%d rpi_online=%d,%d. Pausing.",
return (rval);
}
}
"vpi_unreg_action:%d attempts=%d. Sending UNREG_VPI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
return (rval);
}
return (0);
} /* emlxs_vpi_unreg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_unreg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_unreg_cmpl_action:%d attempts=%d. Going offline.",
return (rval);
} /* emlxs_vpi_unreg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_reg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"vpi_reg_failed_action:%d attempt=%d reason=%x. Reg cmpl.",
} else {
"vpi_reg_failed_action:%d attempt=%d. Registering.",
}
return (rval);
} /* emlxs_vpi_reg_failed_action() */
/*ARGSUSED*/
static uint32_t
{
"vpi_reg_mbcmpl:%d state=%s.",
return (0);
}
"vpi_reg_mbcmpl:%d failed. %s. >",
}
return (0);
}
"vpi_reg_mbcmpl:%d. Reg complete. >",
0, 0, 0);
return (0);
} /* emlxs_vpi_reg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_reg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
"vpi_reg_action:%d attempts=%d. Offline requested.",
return (rval);
}
/* We can't register the VPI until our VFI is registered */
/* If this is the flogi_vpip, then we can skip the REG_VPI. */
/* REG_VPI will be performed later during REG_VFI */
"vpi_reg_action:%d. flogi_vpi. Skipping REG_VPI.",
return (rval);
}
"vpi_reg_action:%d attempts=%d. VFI not registered. "
"Offlining.",
return (rval);
}
"vpi_reg_action:%d attempts=%d. Updating REG_VPI. <",
} else {
"vpi_reg_action:%d attempts=%d. Sending REG_VPI. <",
}
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
wwpn++;
return (rval);
}
return (0);
} /* emlxs_vpi_reg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_reg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_reg_cmpl_action:%d attempts=%d. Offline requested.",
return (rval);
}
"vpi_reg_cmpl_action:%d attempts=%d. Going online.",
return (rval);
} /* emlxs_vpi_reg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_online_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"vpi_online_action:%d attempts=%d. Offline requested.",
return (rval);
}
"vpi_online_action:%d. VPI online. Notifying VFI:%d >",
/* Notify VFI */
return (rval);
} /* emlxs_vpi_online_action() */
/* ************************************************************************** */
/* RPI */
/* ************************************************************************** */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_rpi_state_table[i].string);
}
}
return (buffer);
} /* emlxs_rpi_state_xlate() */
static uint32_t
void *arg1)
{
/* Convert event to action table index */
switch (evt) {
case FCF_EVENT_STATE_ENTER:
index = 0;
break;
case FCF_EVENT_RPI_ONLINE:
index = 1;
break;
case FCF_EVENT_RPI_OFFLINE:
index = 2;
break;
case FCF_EVENT_RPI_PAUSE:
index = 3;
break;
case FCF_EVENT_RPI_RESUME:
index = 4;
break;
default:
return (1);
}
if (!func) {
"rpi_action:%d %s:%s arg=%p. No action. <",
return (1);
}
return (rval);
} /* emlxs_rpi_action() */
static uint32_t
void *arg1)
{
/* Filter events and acquire fcfi context */
switch (evt) {
case FCF_EVENT_RPI_ONLINE:
case FCF_EVENT_RPI_OFFLINE:
case FCF_EVENT_RPI_PAUSE:
case FCF_EVENT_RPI_RESUME:
if (!rpip) {
"rpi_event: %s arg=%p. Null RPI found. <",
return (1);
}
break;
default:
return (1);
}
"rpi_event:%d %s:%s arg=%p",
return (rval);
} /* emlxs_rpi_event() */
/*ARGSUSED*/
static uint32_t
{
if (state >= RPI_ACTION_STATES) {
return (1);
}
(reason != FCF_REASON_REENTER)) {
"rpi_state:%d %s:%s:0x%x arg=%p. State not changed. <",
return (1);
}
if (!reason) {
"rpi_state:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"rpi_state:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"rpi_state:%d %s-->%s:%s:0x%x arg=%p",
} else {
"rpi_state:%d %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_rpi_state() */
static void
{
return;
}
"rpi_deferred_cmpl:%d. status=%x ...",
status);
return;
} /* emlxs_rpi_deferred_cmpl() */
static void
{
uint32_t i;
/* This timer monitors for idle timeout of an RPI in a */
/* RESERVED state. */
/* This means that the RPI was reserved, but never registered. */
/* If the RPI sits for too long (~2 secs) in this state we free it */
continue;
}
/* If RPI is active, then clear timer. */
rpip->idle_timer = 0;
continue;
}
/* If an F-port RPI is found idle, then free it. */
/* Since an F-port RPI is never registered after the login */
/* completes, it is safe to free it immediately. */
goto free_it;
}
/* Start idle timer if not already active */
if (!rpip->idle_timer) {
}
/* Check for idle timeout */
continue;
}
rpip->idle_timer = 0;
FCF_REASON_UNUSED, 0, 0);
}
return;
} /* emlxs_rpi_idle_timer() */
static RPIobj_t *
{
uint16_t i;
/* To be consistent with SLI3, the RPI assignment */
/* starts with 1. ONLY one SLI4 HBA in the entire */
/* system will be sacrificed by one RPI and that */
/* is the one having RPI base equal 0. */
"rpi_alloc:%d. RPI allocated. >",
0, 0, 0);
return (rpip);
}
}
"rpi_alloc: Out of RPI objects.");
return (NULL);
} /* emlxs_rpi_alloc() */
/* Special routine for VPI object */
static void
{
"rpi_alloc_fabric_rpi: Fabric RPI active:%s.",
return;
}
"rpi_alloc_fabric_rpi: Allocating Fabric RPI. >");
0, 0, 0);
return;
} /* emlxs_rpi_alloc_fabric_rpi() */
static uint32_t
{
"rpi_free:%d did=%x. Freeing RPI. >",
return (rval);
} /* emlxs_rpi_free() */
extern RPIobj_t *
{
/* Special handling for Fabric RPI */
if (rpi == FABRIC_RPI) {
}
"rpi_find:%d. RPI Invalid.",
rpi);
return (NULL);
}
"rpi_find:%d RPI not active",
rpi);
return (NULL);
}
return (rpip);
} /* emlxs_rpi_find() */
static RPIobj_t *
{
uint32_t i;
continue;
}
break;
}
}
return (rpip1);
} /* emlxs_rpi_find_did() */
extern RPIobj_t *
{
/* xrip will be NULL for unsolicited BLS requests */
return (NULL);
}
if (!rpip) {
}
if (!rpip) {
"rpi_reserve_notify: Unable to reserve an rpi. "
"did=%x xri=%d.",
return (NULL);
}
/* Bind the XRI */
if (xrip) {
}
"rpi_reserve_notify:%d did=%x xri=%d.",
return (rpip);
} /* emlxs_rpi_reserve_notify() */
extern RPIobj_t *
{
return (NULL);
}
return (rpip);
} /* emlxs_rpi_alloc_notify() */
extern uint32_t
{
return (1);
}
if (!rpip) {
return (1);
}
/* Fabric RPI will be handled automatically */
return (1);
}
return (rval);
} /* emlxs_rpi_free_notify() */
extern uint32_t
{
return (1);
}
if (!rpip) {
"rpi_pause_notify: No RPI provided.");
return (1);
}
/* Fabric RPI will be handled automatically */
return (1);
}
"rpi_pause_notify:%d %s. Pausing RPI. >",
return (0);
} /* emlxs_rpi_pause_notify() */
extern uint32_t
{
return (1);
}
/* We never register our local port */
return (1);
}
/* We never online the Fabric DID other */
/* than the fabric_rpip */
}
if (!rpip) {
}
if (!rpip) {
allocated = 1;
}
if (!rpip) {
"rpi_online_notify: Unable to allocate an rpi. did=%x",
did);
return (1);
}
/* Initialize RPI node info */
sizeof (emlxs_deferred_cmpl_t), KM_SLEEP);
/* For safety */
}
}
"rpi_online_notify:%d %s. %s. Login cmpl.",
}
return (rval);
}
"rpi_online_notify:%d %s. %s. Onlining RPI. >",
"rpi_online_notify:%d %s. Deferred args not completed.",
return (1);
}
return (0);
} /* emlxs_rpi_online_notify() */
extern uint32_t
{
return (1);
}
if (!rpip) {
"rpi_offline_notify: No RPI provided.");
return (1);
}
/* Fabric RPI will be handled automatically */
return (1);
}
sizeof (emlxs_deferred_cmpl_t), KM_SLEEP);
}
"rpi_offline_notify:%d %s. Offlining RPI. >",
"rpi_offline_notify:%d %s. Deferred args not completed.",
return (1);
}
return (0);
} /* emlxs_rpi_offline_notify() */
extern uint32_t
{
return (1);
}
if (!rpip) {
"rpi_resume_notify: No RPI provided.");
return (1);
}
/* Fabric RPI will be handled automatically */
return (1);
}
return (1);
}
if (sbp) {
sizeof (emlxs_deferred_cmpl_t), KM_SLEEP);
}
"rpi_resume_notify:%d %s. Resuming RPI. >",
"rpi_resume_notify:%d %s. Deferred args not completed.",
return (1);
}
return (0);
} /* emlxs_rpi_resume_notify() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_free_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
}
}
}
/* Remove all XRIs under this RPI */
"rpi_free_action:%d xri_count=%d. "
"Removing XRI:%d iotag:%d.",
}
"rpi_free_action:%d xri_count=%d. "
"Removing XRI:%d iotag:%d.",
}
}
"rpi_free_action:%d. xri_count=%d",
}
"rpi_free_action:%d flag=%x. RPI freed. <",
return (0);
} /* emlxs_rpi_free_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_RPI_ONLINE) {
"rpi_online_evt_action:%d %s:%s arg=%p. "
"Invalid event type. <",
return (1);
}
case RPI_STATE_REG:
"rpi_online_evt_action:%d flag=%x. Registering.",
break;
default:
"rpi_online_evt_action:%d flag=%x. Registering.",
break;
}
return (rval);
} /* emlxs_rpi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_RPI_OFFLINE) {
"rpi_offline_evt_action:%d %s:%s arg=%p. "
"Invalid event type. <",
return (1);
}
case RPI_STATE_RESERVED:
"rpi_offline_evt_action:%d flag=%x. Freeing RPI.",
break;
case RPI_STATE_UNREG:
"rpi_offline_evt_action:%d flag=%x. "
"Already unregistering. <",
break;
default:
"rpi_offline_evt_action:%d flag=%x. Unregistering.",
break;
}
return (rval);
} /* emlxs_rpi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_RPI_PAUSE) {
"rpi_pause_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
case RPI_STATE_RESERVED:
"rpi_pause_evt_action:%d flag=%x. Freeing RPI.",
break;
case RPI_STATE_UNREG:
"rpi_pause_evt_action:%d flag=%x. Not online. <",
break;
case RPI_STATE_PAUSED:
"rpi_pause_evt_action:%d flag=%x. Already paused. <",
break;
case RPI_STATE_REG:
case RPI_STATE_ONLINE:
case RPI_STATE_RESUME:
"rpi_pause_evt_action:%d flag=%x. Pausing.",
/* Don't pause an RPI, if the VPI is not pausing too */
"rpi_pause_evt_action:%d rpi_online=%d,%d "
"xri_count=%d. VPI:%d pause not requested. "
break;
}
break;
default:
"rpi_pause_evt_action:%d flag=%x. <",
break;
}
return (rval);
} /* emlxs_rpi_pause_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_RPI_RESUME) {
"rpi_resume_evt_action:%d %s:%s arg=%p flag=%x. "
"Invalid event type. <",
return (1);
}
case RPI_STATE_PAUSED:
"rpi_resume_evt_action:%d flag=%x. Resuming.",
break;
default:
"rpi_resume_evt_action:%d flag=%x. Not paused. <",
break;
}
return (rval);
} /* emlxs_rpi_resume_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_reserved_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_reserved_action:%d %s:%s arg=%p. "
"Invalid previous state. %s <",
return (1);
}
"rpi_reserved_action:%d rpi_online=%d,%d. <",
return (0);
} /* emlxs_rpi_reserved_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_offline_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
if (vpip->rpi_paused) {
vpip->rpi_paused--;
}
}
if (vpip->rpi_online) {
vpip->rpi_online--;
}
/* Added protection */
}
}
"rpi_offline_action:%d rpi_online=%d,%d xri_count=%d. "
"Fabric RPI offline. Freeing.",
/* Free RPI */
return (rval);
}
if ((vpip->rpi_online == 0) ||
"rpi_offline_action:%d rpi_online=%d,%d xri_count=%d. "
"RPI offline. "
"Notifying VPI:%d >",
/* Notify VPI */
} else {
"rpi_offline_action:%d rpi_online=%d,%d xri_count=%d. "
"RPI offline. Freeing.",
}
/* Free RPI */
return (rval);
} /* emlxs_rpi_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_paused_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_paused_action:%d rpi_online=%d,%d xri_count=%d. "
"VPI:%d pause not requested. Unregistering.",
return (rval);
}
vpip->rpi_paused++;
}
/* Check if all RPI's have been paused for a VPI */
"rpi_paused_action:%d rpi_online=%d,%d xri_count=%d. "
"RPI paused. "
"Notifying VPI:%d >",
/* Notify VPI */
} else {
"rpi_paused_action:%d rpi_online=%d,%d xri_count=%d. "
"RPI paused. <",
}
return (0);
} /* emlxs_rpi_paused_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_unreg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"rpi_unreg_failed_action:%d reason=%x flag=%x. "
"Going offline.",
} else {
"rpi_unreg_failed_action:%d flag=%x. Going online.",
}
return (rval);
} /* emlxs_rpi_unreg_failed_action() */
static void
{
/* Special handling for Fabric RPI */
if (node) {
}
/* Clear all reserved XRIs under this RPI */
/* We don't need to worry about xrip->reserved_rpip */
/* here because the Fabric RPI can never be reserved */
/* by an xri. */
"rpi_unreg_action:%d xri_count=%d. "
"Unreserving XRI:%d iotag:%d.",
(void) emlxs_sli4_unreserve_xri(port,
}
}
}
if (vpip->rpi_paused) {
vpip->rpi_paused--;
}
}
if (vpip->rpi_online) {
vpip->rpi_online--;
}
/* Added protection */
}
}
if (node) {
}
if (node) {
}
return;
} /* emlxs_rpi_unreg_handler() */
/*ARGSUSED*/
static uint32_t
{
"rpi_unreg_mbcmpl:%d state=%s. "
"No longer in RPI_STATE_UNREG.",
return (0);
}
"rpi_unreg_mbcmpl:%d failed. %s. >",
return (0);
}
"rpi_unreg_mbcmpl:%d Unregistered. Unreg complete. >",
0, 0, 0);
return (0);
} /* emlxs_rpi_unreg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_unreg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_unreg_action:%d. Not registered. Going offline.",
return (rval);
}
}
"rpi_unreg_action:%d did=%x vpi=%d. Fabric RPI. "
"Going offline.",
/* Don't send UNREG_RPI, but process it as if we did */
return (rval);
}
"rpi_unreg_action:%d attempts=%d. Sending UNREG_RPI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
}
return (rval);
}
}
return (0);
} /* emlxs_rpi_unreg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_unreg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_unreg_cmpl_action:%d flag=%x. Going offline.",
return (rval);
} /* emlxs_rpi_unreg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_reg_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"rpi_reg_failed_action:%d reason=%x flag=%x. "
"Going offline.",
} else {
"rpi_reg_failed_action:%d flag=%x. Unregistering",
}
return (rval);
} /* emlxs_rpi_reg_failed_action() */
static uint32_t
{
if (vpip->rpi_paused) {
vpip->rpi_paused--;
}
}
vpip->rpi_online++;
}
/* If private loop and this is fabric RPI, then exit now */
return (0);
}
/* Create or update the node */
if (!node) {
"rpi_reg_handler:%d. Node create failed. Reg failed.",
return (FCF_REASON_NO_NODE);
}
return (0);
} /* emlxs_rpi_reg_handler() */
/*ARGSUSED*/
static uint32_t
{
"rpi_reg_mbcmpl:%d state=%s. No longer in RPI_STATE_REG.",
return (0);
}
"rpi_reg_mbcmpl:%d failed. %s. >",
return (0);
}
if (rval) {
"rpi_reg_mbcmpl:%d. Reg failed. >",
rval, 0, 0);
return (0);
}
"rpi_reg_mbcmpl:%d Registered. Reg complete. >",
/* Needed for FCT trigger in emlxs_mb_deferred_cmpl */
}
#ifdef DHCHAP_SUPPORT
/* Auth started - auth completion will */
/* handle sbp and ubp now */
}
}
#endif /* DHCHAP_SUPPORT */
return (0);
} /* emlxs_rpi_reg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_reg_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_reg_action:%d did=%x vpi=%d. Fabric RPI. "
"Going online.",
/* Don't send REG_RPI, but process it as if we did */
if (rval) {
rval, 0, 0);
return (rval);
}
return (rval);
}
}
"rpi_reg_action:%d attempts=%d. "
"Updating REG_RPI. <",
} else {
"rpi_reg_action:%d attempts=%d. "
"Sending REG_RPI. <",
}
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
FCF_REASON_NO_BUFFER, 0, arg1);
return (rval);
}
}
return (rval);
}
}
return (0);
} /* emlxs_rpi_reg_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_reg_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_reg_cmpl_action:%d flag=%x. Going online.",
} else {
"rpi_reg_cmpl_action:%d flag=%x. Going offline.",
}
return (rval);
} /* emlxs_rpi_reg_cmpl_action() */
/*ARGSUSED*/
static uint32_t
{
"rpi_resume_failed_action:%d %s:%s arg=%p attempt=%d. "
"Invalid state. <",
return (1);
}
"rpi_resume_failed_action:%d attempt=%d. Unregistering.",
return (rval);
} /* emlxs_rpi_resume_failed_action() */
/*ARGSUSED*/
static void
{
}
}
return;
} /* emlxs_rpi_resume_handler() */
/*ARGSUSED*/
static uint32_t
{
"rpi_resume_mbcmpl:%d state=%s. "
"No longer in RPI_STATE_RESUME.",
return (0);
}
"rpi_resume_mbcmpl:%d failed. %s. >",
return (0);
}
"rpi_resume_mbcmpl:%d Resumed. Resume complete. >",
return (0);
} /* emlxs_rpi_resume_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_resume_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_resume_action:%d flag=%x. Not Paused. Going online.",
return (rval);
}
"rpi_resume_action:%d. Fabric RPI. "
"Going online.",
/* Don't send RESUME_RPI, but process it as if we did */
return (rval);
}
}
"rpi_resume_action:%d attempts=%d. Sending RESUME_RPI. <",
FCF_REASON_NO_MBOX, 0, arg1);
return (rval);
}
}
return (rval);
}
}
return (0);
} /* emlxs_rpi_resume_action() */
static uint32_t
void *arg1)
{
"rpi_resume_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_reg_cmpl_action:%d flag=%x. Unregistering.",
} else {
"rpi_reg_cmpl_action:%d flag=%x. Going offline.",
}
} else {
"rpi_resume_cmpl_action:%d flag=%x. Going online.",
}
return (rval);
} /* emlxs_rpi_resume_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_online_action:%d %s:%s arg=%p. "
"Invalid state. <",
return (1);
}
"rpi_online_action:%d did=%x. Fabric RPI online. <",
/* Now register the p2p_rpip */
if (p2p_rpip) {
}
}
return (0);
}
"rpi_online_action:%d did=%x. RPI online. Notifying VPI:%d. >",
/* Notify VPI */
return (rval);
} /* emlxs_rpi_online_action() */