emlxs_fcf.c revision a9800beb32c1006bb21c8da39e0180ea440b7bad
/*
* 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 usr/src/OPENSOLARIS.LICENSE
* 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 2010 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 fctab, fcfi, vfi, vpi, rpi objects must hold
* the EMLXS_FCF_LOCK to protect these objects.
*/
/* ************************************************************************** */
/* 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*
*/
/* Order does not matter */
{
{FCF_EVENT_STATE_ENTER, "STATE_ENTER"},
{FCF_EVENT_SHUTDOWN, "SHUTDOWN"},
{FCF_EVENT_LINKUP, "LINK_UP"},
{FCF_EVENT_LINKDOWN, "LINK_DOWN"},
{FCF_EVENT_CVL, "CVL_RECD"},
{FCF_EVENT_FCFTAB_FULL, "TABLE_FULL"},
{FCF_EVENT_FCF_FOUND, "FCF_FOUND"},
{FCF_EVENT_FCF_LOST, "FCF_LOST"},
{FCF_EVENT_FCF_CHANGED, "FCF_CHANGED"},
{FCF_EVENT_FCFI_ONLINE, "FCFI_ONLINE"},
{FCF_EVENT_FCFI_OFFLINE, "FCFI_OFFLINE"},
{FCF_EVENT_FCFI_PAUSE, "FCFI_PAUSE"},
{FCF_EVENT_VFI_ONLINE, "VFI_ONLINE"},
{FCF_EVENT_VFI_OFFLINE, "VFI_OFFLINE"},
{FCF_EVENT_VFI_PAUSE, "VFI_PAUSE"},
{FCF_EVENT_VPI_ONLINE, "VPI_ONLINE"},
{FCF_EVENT_VPI_OFFLINE, "VPI_OFFLINE"},
{FCF_EVENT_VPI_PAUSE, "VPI_PAUSE"},
{FCF_EVENT_RPI_ONLINE, "RPI_ONLINE"},
{FCF_EVENT_RPI_OFFLINE, "RPI_OFFLINE"},
{FCF_EVENT_RPI_PAUSE, "RPI_PAUSE"},
{FCF_EVENT_RPI_RESUME, "RPI_RESUME"},
}; /* emlxs_fcf_event_table */
/* Order does not matter */
{
{FCF_REASON_NONE, "REASON_NONE"},
{FCF_REASON_REENTER, "REASON_REENTER"},
{FCF_REASON_EVENT, "REASON_EVENT"},
{FCF_REASON_REQUESTED, "REASON_REQUESTED"},
{FCF_REASON_NO_MBOX, "REASON_NO_MBOX"},
{FCF_REASON_NO_BUFFER, "REASON_NO_BUFFER"},
{FCF_REASON_SEND_FAILED, "REASON_SEND_FAILED"},
{FCF_REASON_MBOX_FAILED, "REASON_MBOX_FAILED"},
{FCF_REASON_NO_FCFI, "REASON_NO_FCFI"},
{FCF_REASON_NO_VFI, "REASON_NO_VFI"},
{FCF_REASON_ONLINE_FAILED, "REASON_ONLINE_FAILED"},
{FCF_REASON_OFFLINE_FAILED, "REASON_OFFLINE_FAILED"},
{FCF_REASON_OP_FAILED, "REASON_OP_FAILED"},
{FCF_REASON_NO_PKT, "FCF_REASON_NO_PKT"},
{FCF_REASON_NO_NODE, "FCF_REASON_NO_NODE"},
{FCF_REASON_NOT_ALLOWED, "FCF_REASON_NOT_ALLOWED"},
}; /* emlxs_fcf_reason_table */
/* ********************************************************************** */
/* FCFTAB */
/* ********************************************************************** */
/* Order does not matter */
{
{FCFTAB_STATE_SHUTDOWN, "FCFTAB_STATE_SHUTDOWN"},
{FCFTAB_STATE_OFFLINE, "FCFTAB_STATE_OFFLINE"},
{FCFTAB_STATE_SOLICIT, "FCFTAB_STATE_SOLICIT"},
{FCFTAB_STATE_SOLICIT_FAILED, "FCFTAB_STATE_SOLICIT_FAILED"},
{FCFTAB_STATE_SOLICIT_CMPL, "FCFTAB_STATE_SOLICIT_CMPL"},
{FCFTAB_STATE_READ, "FCFTAB_STATE_READ"},
{FCFTAB_STATE_READ_FAILED, "FCFTAB_STATE_READ_FAILED"},
{FCFTAB_STATE_READ_CMPL, "FCFTAB_STATE_READ_CMPL"},
{FCFTAB_STATE_FCFI_OFFLINE, "FCFTAB_STATE_FCFI_OFFLINE"},
{FCFTAB_STATE_FCFI_OFFLINE_CMPL, "FCFTAB_STATE_FCFI_OFFLINE_CMPL"},
{FCFTAB_STATE_FCFI_ONLINE, "FCFTAB_STATE_FCFI_ONLINE"},
{FCFTAB_STATE_FCFI_ONLINE_CMPL, "FCFTAB_STATE_FCFI_ONLINE_CMPL"},
{FCFTAB_STATE_ONLINE, "FCFTAB_STATE_ONLINE"},
}; /* emlxs_fcftab_state_table */
/*
* - Online sequencing can start from FCFI_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
* FCFTAB_STATE_OFFLINE
* FCFTAB_STATE_SOLICIT
* FCFTAB_STATE_SOLICIT_CMPL
* FCFTAB_STATE_READ
* FCFTAB_STATE_READ_CMPL
* FCFTAB_STATE_FCFI_OFFLINE
* FCFTAB_STATE_FCFI_OFFLINE_CMPL
* FCFTAB_STATE_FCFI_ONLINE
* FCFTAB_STATE_FCFI_ONLINE_CMPL
* FCFTAB_STATE_ONLINE
*
*
* NORMAL OFFLINE SEQ
* ---------------------------
* LINK_DOWN event <-- Adapter
* FCFTAB_STATE_ONLINE
* FCFTAB_STATE_FCFI_OFFLINE
* FCFTAB_STATE_FCFI_OFFLINE_CMPL
* FCFTAB_STATE_OFFLINE
*
*/
/* Order does matter */
static void *emlxs_fcftab_action_table[] =
{
/* Action routine Event */
/* 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_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_OFFLINE 1 (Wait for LINK_UP event) */
(void *) emlxs_fcftab_offline_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_SOLICIT 2 (Wait on fcf_solicit cmpl) */
(void *) emlxs_fcftab_sol_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_SOLICIT_FAILED 3 (Transitional) */
(void *) emlxs_fcftab_sol_failed_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_SOLICIT_CMPL 4 (Wait on fcf timer cmpl) */
(void *) emlxs_fcftab_sol_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_READ 5 (Wait on fcf_read cmpl) */
(void *) emlxs_fcftab_read_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_READ_FAILED 6 (Transitional) */
(void *) emlxs_fcftab_read_failed_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_READ_CMPL 7 (Transitional) */
(void *) emlxs_fcftab_read_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_FCFI_OFFLINE_CMPL 8 (Transitional) */
(void *) emlxs_fcftab_fcfi_offline_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_FCFI_OFFLINE 9 (Wait for FCFI_OFFLINE event) */
(void *) emlxs_fcftab_fcfi_offline_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_FCFI_ONLINE 10 (Wait on FCFI_ONLINE event) */
(void *) emlxs_fcftab_fcfi_online_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_FCFI_ONLINE_CMPL 11 (Transitional) */
(void *) emlxs_fcftab_fcfi_online_cmpl_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
/* FCFTAB_STATE_ONLINE 12 (Wait for LINK_DOWN event) */
(void *) emlxs_fcftab_online_action, /* STATE_ENTER */
(void *) emlxs_fcftab_shutdown_evt_action, /* SHUTDOWN */
(void *) emlxs_fcftab_linkup_evt_action, /* LINK_UP */
(void *) emlxs_fcftab_linkdown_evt_action, /* LINK_DOWN */
(void *) emlxs_fcftab_cvl_evt_action, /* CVL_RECD */
(void *) emlxs_fcftab_found_evt_action, /* FCF_FOUND */
(void *) emlxs_fcftab_lost_evt_action, /* FCF_LOST */
(void *) emlxs_fcftab_changed_evt_action, /* FCF_CHANGED */
(void *) emlxs_fcftab_full_evt_action, /* TABLE_FULL */
(void *) emlxs_fcftab_fcfi_online_evt_action, /* FCFI_ONLINE */
(void *) emlxs_fcftab_fcfi_offline_evt_action, /* FCFI_OFFLINE */
}; /* emlxs_fcftab_action_table[] */
#define FCFTAB_ACTION_EVENTS 11
#define FCFTAB_ACTION_STATES \
(sizeof (emlxs_fcftab_action_table)/ \
(FCFTAB_ACTION_EVENTS * sizeof (void *)))
/* ********************************************************************** */
/* VFTAB - This will be needed for multi-virtual fabric environments */
/* ********************************************************************** */
/* Order does not matter */
{
{VFTAB_STATE_DISABLED, "VFTAB_STATE_DISABLED"},
}; /* emlxs_vftab_state_table */
/* ********************************************************************** */
/* FCFI */
/* ********************************************************************** */
/* Order does not matter */
{
{FCFI_STATE_FREE, "FCFI_STATE_FREE"},
{FCFI_STATE_OFFLINE, "FCFI_STATE_OFFLINE"},
{FCFI_STATE_UNREG_CMPL, "FCFI_STATE_UNREG_CMPL"},
{FCFI_STATE_UNREG_FAILED, "FCFI_STATE_UNREG_FAILED"},
{FCFI_STATE_UNREG, "FCFI_STATE_UNREG"},
{FCFI_STATE_REG, "FCFI_STATE_REG"},
{FCFI_STATE_REG_FAILED, "FCFI_STATE_REG_FAILED"},
{FCFI_STATE_REG_CMPL, "FCFI_STATE_REG_CMPL"},
{FCFI_STATE_VFI_OFFLINE_CMPL, "FCFI_STATE_VFI_OFFLINE_CMPL"},
{FCFI_STATE_VFI_OFFLINE, "FCFI_STATE_VFI_OFFLINE"},
{FCFI_STATE_VFI_ONLINE, "FCFI_STATE_VFI_ONLINE"},
{FCFI_STATE_VFI_ONLINE_CMPL, "FCFI_STATE_VFI_ONLINE_CMPL"},
{FCFI_STATE_PAUSED, "FCFI_STATE_PAUSED"},
{FCFI_STATE_ONLINE, "FCFI_STATE_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_STATE_OFFLINE"},
{VFI_STATE_INIT, "VFI_STATE_INIT"},
{VFI_STATE_INIT_FAILED, "VFI_STATE_INIT_FAILED"},
{VFI_STATE_INIT_CMPL, "VFI_STATE_INIT_CMPL"},
{VFI_STATE_VPI_OFFLINE_CMPL, "VFI_STATE_VPI_OFFLINE_CMPL"},
{VFI_STATE_VPI_OFFLINE, "VFI_STATE_VPI_OFFLINE"},
{VFI_STATE_VPI_ONLINE, "VFI_STATE_VPI_ONLINE"},
{VFI_STATE_VPI_ONLINE_CMPL, "VFI_STATE_VPI_ONLINE_CMPL"},
{VFI_STATE_UNREG_CMPL, "VFI_STATE_UNREG_CMPL"},
{VFI_STATE_UNREG_FAILED, "VFI_STATE_UNREG_FAILED"},
{VFI_STATE_UNREG, "VFI_STATE_UNREG"},
{VFI_STATE_REG, "VFI_STATE_REG"},
{VFI_STATE_REG_FAILED, "VFI_STATE_REG_FAILED"},
{VFI_STATE_REG_CMPL, "VFI_STATE_REG_CMPL"},
{VFI_STATE_PAUSED, "VFI_STATE_PAUSED"},
{VFI_STATE_ONLINE, "VFI_STATE_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_STATE_OFFLINE"},
{VPI_STATE_INIT, "VPI_STATE_INIT"},
{VPI_STATE_INIT_FAILED, "VPI_STATE_INIT_FAILED"},
{VPI_STATE_INIT_CMPL, "VPI_STATE_INIT_CMPL"},
{VPI_STATE_UNREG_CMPL, "VPI_STATE_UNREG_CMPL"},
{VPI_STATE_UNREG_FAILED, "VPI_STATE_UNREG_FAILED"},
{VPI_STATE_UNREG, "VPI_STATE_UNREG"},
{VPI_STATE_LOGO_CMPL, "VPI_STATE_LOGO_CMPL"},
{VPI_STATE_LOGO_FAILED, "VPI_STATE_LOGO_FAILED"},
{VPI_STATE_LOGO, "VPI_STATE_LOGO"},
{VPI_STATE_PORT_OFFLINE, "VPI_STATE_PORT_OFFLINE"},
{VPI_STATE_PORT_ONLINE, "VPI_STATE_PORT_ONLINE"},
{VPI_STATE_LOGI, "VPI_STATE_LOGI"},
{VPI_STATE_LOGI_FAILED, "VPI_STATE_LOGI_FAILED"},
{VPI_STATE_LOGI_CMPL, "VPI_STATE_LOGI_CMPL"},
{VPI_STATE_REG, "VPI_STATE_REG"},
{VPI_STATE_REG_FAILED, "VPI_STATE_REG_FAILED"},
{VPI_STATE_REG_CMPL, "VPI_STATE_REG_CMPL"},
{VPI_STATE_PAUSED, "VPI_STATE_PAUSED"},
{VPI_STATE_ONLINE, "VPI_STATE_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_STATE_FREE"},
{RPI_STATE_OFFLINE, "RPI_STATE_OFFLINE"},
{RPI_STATE_UNREG_CMPL, "RPI_STATE_UNREG_CMPL"},
{RPI_STATE_UNREG_FAILED, "RPI_STATE_UNREG_FAILED"},
{RPI_STATE_UNREG, "RPI_STATE_UNREG"},
{RPI_STATE_REG, "RPI_STATE_REG"},
{RPI_STATE_REG_FAILED, "RPI_STATE_REG_FAILED"},
{RPI_STATE_REG_CMPL, "RPI_STATE_REG_CMPL"},
{RPI_STATE_PAUSED, "RPI_STATE_PAUSED"},
{RPI_STATE_RESUME, "RPI_STATE_RESUME"},
{RPI_STATE_RESUME_FAILED, "RPI_STATE_RESUME_FAILED"},
{RPI_STATE_RESUME_CMPL, "RPI_STATE_RESUME_CMPL"},
{RPI_STATE_ONLINE, "RPI_STATE_ONLINE"},
}; /* emlxs_rpi_state_table */
/*
* - Online sequencing can start from RPI_STATE_OFFLINE 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_OFFLINE
* 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_OFFLINE 1 (Wait for RPI_ONLINE event) */
(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 2 (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 3 (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 4 (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 5 (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 6 (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 7 (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 8 (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 9 (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 10 (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 11 (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 12 (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 */
/* ************************************************************************** */
extern void
{
uint32_t i;
return;
}
"emlxs_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;
char buf[64];
return;
}
/* FCFTAB */
/* FCFI */
}
/* VFI */
}
/* VPI */
for (i = 0; i < MAX_VPORTS; i++) {
/* Init the Fabric RPI's */
}
/* RPI */
}
"emlxs_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;
}
return;
} /* emlxs_fcf_timer_notify() */
extern uint32_t
{
uint32_t i;
return (1);
}
return (1);
}
/* Wait for FCF table to shutdown */
i = 0;
while (i++ < 120) {
break;
}
DELAYMS(1000);
}
if (i >= 120) {
"fcf_shutdown_notify: %s flag=%x fcfi_online=%d. "
"Shutdown timeout.",
}
}
return (rval);
} /* emlxs_fcf_shutdown_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
return (rval);
} /* emlxs_fcf_linkup_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
return (rval);
} /* emlxs_fcf_linkdown_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
return (rval);
} /* emlxs_fcf_cvl_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
return (rval);
} /* emlxs_fcf_full_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
return (rval);
} /* emlxs_fcf_found_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
return (rval);
} /* emlxs_fcf_changed_notify() */
extern uint32_t
{
return (1);
}
return (1);
}
return (rval);
} /* emlxs_fcf_lost_notify() */
/* ************************************************************************** */
/* FCFTAB */
/* ************************************************************************** */
static char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_fcftab_state_table[i].string);
}
}
return (buffer);
} /* emlxs_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) {
"fcftab: %s:%s arg=%p. No action. Terminated.",
return (1);
}
return (rval);
} /* emlxs_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);
}
"fcftab: %s:%s arg=%p.",
return (rval);
} /* emlxs_fcftab_event() */
/* EMLXS_FCF_LOCK must be held to enter */
/*ARGSUSED*/
static uint32_t
{
if (state >= FCFTAB_ACTION_STATES) {
return (1);
}
(reason != FCF_REASON_REENTER)) {
"fcftab_state: %s:%s:0x%x arg=%p. "
"State not changed. Terminated.",
return (1);
}
if (!reason) {
"fcftab:%s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"fcftab:%s-->%s:%s:%s arg=%p",
} else if (explain) {
"fcftab:%s-->%s:%s:0x%x arg=%p",
} else {
"fcftab:%s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_fcftab_state() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_OFFLINE) {
"fcftab_fcfi_offline_evt_action: %s:%s arg=%p flag=%x. "
"Invalid event type. Terminated.",
return (1);
}
case FCFTAB_STATE_SHUTDOWN:
"fcftab_fcfi_offline_evt_action:%d. Shutting down.",
break;
"fcftab_fcfi_offline_evt_action:%d. Offlining.",
break;
case FCFTAB_STATE_FCFI_ONLINE:
"fcftab_fcfi_offline_evt_action:%d. Attempting failover.",
break;
case FCFTAB_STATE_ONLINE:
"fcftab_fcfi_offline_evt_action:%d.",
break;
default:
"fcftab_fcfi_offline_evt_action:%d %s. Terminated.",
break;
}
return (rval);
} /* emlxs_fcftab_fcfi_offline_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCFI_ONLINE) {
"fcftab_fcfi_online_evt_action: %s:%s arg=%p flag=%x. "
"Invalid event type. Terminated.",
return (1);
}
"fcftab_fcfi_online_evt_action:%d. Terminated.",
return (rval);
} /* emlxs_fcftab_fcfi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_CVL) {
"fcftab_cvl_evt_action: %s:%s arg=%p flag=%x. "
"Invalid event type. Terminated.",
return (1);
}
/* Pause VPI */
"fcftab_cvl_evt_action: %s gen=%x. Pausing VPI:%d.",
case FCFTAB_STATE_SOLICIT:
"fcftab_cvl_evt_action: %s gen=%x. "
"Already soliciting. Terminated.",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcftab_cvl_evt_action: %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcftab_cvl_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_LINKUP) {
"fcftab_linkup_evt_action: %s:%s arg=%p flag=%x. "
"Invalid event type. Terminated.",
return (1);
}
"fcftab_linkup_evt_action: %s:%s arg=%p gen=%x. Link up.",
fcftab->generation);
}
case FCFTAB_STATE_SOLICIT:
"fcftab_linkup_evt_action: %s gen=%x. "
"Already soliciting. Terminated.",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcftab_linkup_evt_action: %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcftab_linkup_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
if (evt != FCF_EVENT_LINKDOWN) {
"fcftab_linkdown_evt_action: %s:%s arg=%p flag=%x. "
"Invalid event type. Terminated.",
return (1);
}
"fcftab_linkdown_evt_action: %s:%s arg=%p flag=%x. Linkdown.",
}
hba->discovery_timer = 0;
/* Pause all active FCFI's */
for (i = 0; i < fcftab->fcfi_count; i++) {
break;
}
"fcftab_linkdown_evt_action: Pausing FCFI:%d.",
}
"fcftab_linkdown_evt_action: Going offline.");
case FCFTAB_STATE_OFFLINE:
break;
default:
break;
}
return (rval);
} /* emlxs_fcftab_linkdown_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_SHUTDOWN) {
"fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
"Invalid event type. Terminated.",
return (1);
}
"fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
"Already shut down. Terminated.",
return (1);
}
"fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
"Already shutting down. Terminated.",
return (1);
}
"fcftab_shutdown_evt_action: %s:%s arg=%p flag=%x. "
"Shutting down.",
}
hba->discovery_timer = 0;
}
return (rval);
} /* emlxs_fcftab_shutdown_evt_action() */
static uint32_t
{
return (1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
FCF_REASON_REQUESTED, 0, arg1);
}
}
return (rval);
} /* emlxs_fcftab_req_handler() */
static void
{
/* Check FCF timer */
if (!fcftab->read_timer ||
return;
}
fcftab->read_timer = 0;
"fcftab_timer: %s",
break;
default:
"fcftab_timer: %s Terminated.",
break;
}
return;
} /* emlxs_fcftab_read_timer() */
static void
{
/* Check FCF timer */
return;
}
case FCFTAB_STATE_ONLINE:
fcftab->generation++;
"fcftab_sol_timer: %s gen=%x. Soliciting.",
fcftab->generation);
FCF_REASON_EVENT, 0, 0);
break;
default:
"fcftab_sol_timer: %s Terminated.",
break;
}
return;
} /* emlxs_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;
"fcftab_offline_timer:%d %s. Offlining.",
}
return;
} /* emlxs_fcftab_offline_timer() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_sol_failed_action: %s:%s arg=%p attempt=%d. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_sol_failed_action: %s:%s arg=%p attempt=%d reason=%x",
FCF_REASON_OP_FAILED, 0, arg1);
} else {
FCF_REASON_OP_FAILED, 0, arg1);
}
return (rval);
} /* emlxs_fcftab_sol_failed_action() */
/*ARGSUSED*/
static uint32_t
{
fip_mode = 0;
}
"fcftab_sol_mbcmpl: %s. Terminated.",
return (0);
}
"fcftab_sol_mbcmpl: %s gen=%x,%x. "
"Incorrect generation. Terminated.",
return (0);
}
if (fip_mode) {
"fcftab_sol_mbcmpl:failed. status=%x",
(void) emlxs_fcftab_state(port,
return (0);
"fcftab_sol_mbcmpl:failed. status=%x,%x,%x",
xstatus);
(void) emlxs_fcftab_state(port,
return (0);
}
}
"fcftab_sol_mbcmpl: %s gen=%x",
fcftab->generation);
0, 0, 0);
return (0);
} /* emlxs_fcftab_sol_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_sol_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
}
"fcftab_sol_action: %s:%s arg=%p gen=%d flag=%x. "
"Handling request.",
return (rval);
}
"fcftab_sol_action: %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_fcftab_sol_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_sol_cmpl_action: %s:%s arg=%p "
"Invalid state. Terminated.",
return (1);
}
/* Increment the generation counter */
fcftab->generation++;
"fcftab_sol_cmpl_action: %s:%s arg=%p gen=%d flag=%x. "
"Handling request.",
return (rval);
}
"fcftab_sol_cmpl_action: %s:%s arg=%p gen=%d. "
"Starting timer (%d secs).",
/* Start the read timer */
return (0);
} /* emlxs_fcftab_sol_cmpl_action() */
/*ARGSUSED*/
static uint32_t
{
"fcftab_read_mbcmpl: state=%s. Terminated.",
return (0);
}
"fcftab_read_mbcmpl:%d failed. status=%x,%x,%x",
return (0);
}
"fcftab_read_mbcmpl: state=%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) {
"fcftab_read_mbcmpl:%d failed. Unable to allocate fcfi.",
index);
FCF_REASON_NO_FCFI, 0, 0);
return (0);
}
/* Update the FCFI */
/* Check if another record needs to be acquired */
} else {
0, 0, 0);
}
return (0);
} /* emlxs_fcftab_read_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_read_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
}
"fcftab_read_action: %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
"fcftab_read_action: %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_fcftab_read_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_read_failed_action: %s:%s arg=%p attempt=%d. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_read_failed_action: %s:%s arg=%p attempt=%d reason=%x",
} else {
}
return (rval);
} /* emlxs_fcftab_read_failed_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"fcftab_read_cmpl_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_read_cmpl_action: %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 */
"fcftab_read_cmpl_action:%d %s. "
"FCF stale. Freeing FCF.",
continue;
}
}
return (rval);
} /* emlxs_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_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;
"fcftab_process:%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 */
"fcftab_process:%d fcfi=%d %s. "
"No longer viable. "
"Offlining FCF (%d secs).",
}
continue;
}
/* Deselect it */
"fcftab_process:%d fcfi=%d %s. "
"No longer viable. Freeing FCF.",
} else {
"fcftab_process:%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) {
"fcftab_process:%d fcfi=%d %s. "
"New FCF selected.",
} else {
"fcftab_process:%d. No FCF available.",
i);
}
continue;
}
/* If previous entry is still selected, keep it */
"fcftab_process:%d fcfi=%d %s. "
"FCF still selected.",
continue;
}
/* Previous entry is no longer selected */
/* Select a new fcf from same fabric */
if (fcfp) {
"fcftab_process:%d fcfi=%d %s. "
"New FCF, same fabric selected.",
continue;
}
/* Select fcf from any fabric */
if (fcfp) {
"fcftab_process:%d fcfi=%d %s. "
"New FCF, new fabric selected.",
continue;
}
"fcftab_process:%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_fcftab_process() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
uint32_t offline_count = 0;
uint32_t online_count = 0;
"fcftab_fcfi_online_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_fcfi_online_action: %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
for (i = 0; i < fcftab->fcfi_count; i++) {
if (fcfp->offline_timer == 0) {
online_count++;
"fcftab_fcfi_online_action: fcfi_count=%d. "
"Onlining FCF:%d.",
fcfp);
} else {
"fcftab_fcfi_online_action: fcfi_count=%d. "
"Offlining FCF:%d.",
}
}
if (offline_count) {
/* Wait for FCF's to go offline */
/* Service timer now */
return (rval);
}
if (!online_count) {
"fcftab_fcfi_online_action: fcfi_count=%d.",
fcftab->fcfi_count);
}
return (rval);
} /* emlxs_fcftab_fcfi_online_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_fcfi_online_cmpl_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_fcfi_online_cmpl_action: %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
"fcftab_fcfi_online_cmpl_action: %s:%s arg=%p",
return (rval);
} /* emlxs_fcftab_fcfi_online_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
int32_t i;
"fcftab_fcfi_offline_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
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) {
"fcftab_fcfi_offline_action: %s:%s arg=%p "
"fcfi_offline=%d. Terminated.",
return (0);
}
"fcftab_fcfi_offline_action: %s:%s arg=%p.",
return (rval);
} /* emlxs_fcftab_fcfi_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_fcfi_offline_cmpl_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_fcfi_offline_cmpl_action: %s:%s arg=%p. "
"Handling request.",
return (rval);
}
"fcftab_fcfi_offline_cmpl_action: %s:%s arg=%p.",
return (rval);
} /* emlxs_fcftab_fcfi_offline_cmpl_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCF_FOUND) {
"fcftab_found_evt_action: %s:%s fcf_index=%d. "
"Invalid event type. Terminated.",
return (1);
}
case FCFTAB_STATE_SOLICIT:
case FCFTAB_STATE_READ:
"fcftab_found_evt_action: %s:%s fcf_index=%d gen=%x. "
"Terminated.",
break;
/* case FCFTAB_STATE_FCFI_OFFLINE: */
default:
/* Scan for matching fcf index in table */
/* Trigger table read */
fcftab->generation++;
"fcftab_found_evt_action: %s:%s fcf_index=%d "
"gen=%x. Read FCF table.",
break;
}
/* Check if we need more FCF's */
/* Trigger table read */
fcftab->generation++;
"fcftab_found_evt_action: %s:%s fcf_index=%d "
"gen=%x fcfi_online=%d. Read FCF table.",
break;
}
"fcftab_found_evt_action: %s:%s fcfi=%d. "
"FCF not needed. Terminated.",
break;
}
return (rval);
} /* emlxs_fcftab_found_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
if (evt != FCF_EVENT_FCF_LOST) {
"fcftab_lost_evt_action: %s:%s fcf_index=%d. "
"Invalid event type. Terminated",
return (1);
}
/* Scan for matching fcf index in table */
if (!fcfp) {
"fcftab_lost_evt_action: %s:%s fcf_index=%d. "
"FCF not found. Terminated.",
return (0);
}
"fcftab_changed_evt_action: %s:%s fcf_index=%d. "
"FCF not selected. Terminated.",
return (0);
}
/* Offline VPI's of this FCFI */
continue;
}
/* Fabric logo is implied */
}
}
"fcftab_lost_evt_action: %s:%s fcf_index=%d gen=%x. "
"Offlining VPI:%d.",
}
case FCFTAB_STATE_SOLICIT:
"fcftab_lost_evt_action: %s gen=%x. "
"Already soliciting. Terminated.",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcftab_lost_evt_action: %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcftab_lost_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
if (evt != FCF_EVENT_FCF_CHANGED) {
"fcftab_changed_evt_action: %s:%s fcf_index=%d. "
"Invalid event type. Terminated",
return (1);
}
/* Scan for matching fcf index in table */
if (!fcfp) {
"fcftab_changed_evt_action: %s:%s fcf_index=%d. "
"FCFI not found. Terminated.",
return (1);
}
"fcftab_changed_evt_action: %s:%s fcf_index=%d. "
"FCFI not selected. Terminated.",
return (1);
}
case FCFTAB_STATE_SOLICIT:
"fcftab_changed_evt_action: %s gen=%x. "
"Already soliciting. Terminated.",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcftab_changed_evt_action: %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcftab_changed_evt_action() */
/*ARGSUSED*/
static uint32_t
{
"fcftab_fcf_delete:%d failed. Out of range.",
return (1);
}
"fcftab_fcf_delete:%d failed. Unable to allocate mailbox.",
return (1);
}
"fcftab_fcf_delete:%d failed. Unable to allocate buffer.",
return (1);
}
"fcftab_fcf_delete:%d.",
"fcftab_fcf_delete:%d failed. Unable to send request.",
if (mp) {
}
return (1);
}
return (0);
} /* emlxs_fcftab_fcf_delete() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
if (evt != FCF_EVENT_FCFTAB_FULL) {
"fcftab_full_evt_action: %s:%s arg=%p. "
"Invalid event type. Terminated",
return (1);
}
"fcftab_full_evt_action: %s:%s arg=%p fcfi_online=%d. "
"Terminated.",
return (0);
}
"fcftab_full_evt_action: %s:%s arg=%p fcfi_online=%d. "
"Cleaning table...",
count = 0;
continue;
}
continue;
}
continue;
}
"fcftab_full_evt_action: fcfi=%d %s flag=%x. "
"Deleting FCF.",
count++;
}
if (!count) {
"fcftab_full_evt_action: %s:%s arg=%p. "
"All FCF's are viable. Terminated.",
return (0);
}
case FCFTAB_STATE_SOLICIT:
"fcftab_full_evt_action: %s gen=%x. "
"Already soliciting. Terminated.",
fcftab->generation);
break;
default:
fcftab->generation++;
"fcftab_full_evt_action: %s gen=%x. Soliciting.",
fcftab->generation);
break;
}
return (rval);
} /* emlxs_fcftab_full_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"fcftab_online_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_online_action: %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
if (fcftab->fcfi_online == 0) {
/* Count viable FCF's in table */
count = 0;
continue;
}
count++;
}
}
if (count) {
"fcftab_online_action: %s:%s "
"fcfi_online=0,%d,%d. Starting solicit timer.",
/* Start the solicit timer */
} else {
"fcftab_online_action: %s:%s "
"fcfi_online=0,%d,0. Wait for FCF event.",
fcftab->fcfi_count);
}
}
hba->discovery_timer = 0;
}
return (0);
}
}
}
"fcftab_online_action: %s:%s arg=%p fcfi_online=%d. Terminated.",
return (0);
} /* emlxs_fcftab_online_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"fcftab_offline_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"fcftab_offline_action: %s:%s arg=%p flag=%x. "
"Handling request.",
return (rval);
}
"fcftab_offline_action: %s:%s arg=%p fcfi_online=%d. Terminated.",
return (0);
} /* emlxs_fcftab_offline_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
uint32_t i;
"fcftab_shutdown_action: %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
/* Offline all FCF's */
continue;
}
"fcftab_shutdown_action: fcfi=%d %s "
"fcfi_online=%d. Offlining FCF.",
fcfp);
}
return (0);
}
/* Check FCF state */
online = 0;
continue;
}
online++;
}
if (online) {
"fcftab_shutdown_action: %s:%s arg=%p. "
"fcfi_online=%d,%d Terminated.",
return (0);
}
/* Free FCF table */
continue;
}
}
/* Clean the selection table */
fcftab->fcfi_count = 0;
"fcftab_shutdown_action: %s:%s arg=%p flag=%x fcfi_online=%d. "
"Shutdown.",
return (0);
} /* emlxs_fcftab_shutdown_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:%d %s:%s arg=%p. No action. Terminated.",
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: %s arg=%p. Null VFI found. Terminated.",
return (1);
}
if (!fcfp) {
"fcfi: %s arg=%p. FCF not found. Terminated.",
return (1);
}
break;
case FCF_EVENT_FCFI_ONLINE:
case FCF_EVENT_FCFI_OFFLINE:
case FCF_EVENT_FCFI_PAUSE:
if (!fcfp) {
"fcfi: %s arg=%p. Null FCFI found. Terminated.",
return (1);
}
break;
default:
return (1);
}
"fcfi:%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. Terminated.",
return (1);
}
if (!reason) {
"fcfi:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"fcfi:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"fcfi:%d %s-->%s:%s:0x%x arg=%p",
} else {
"fcfi:%d %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_fcfi_state() */
static FCFIobj_t *
{
uint16_t i;
0, 0, 0);
return (fcfp);
}
}
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. Terminated.",
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. Terminated.",
return (1);
}
"fcfi_offline_action:%d fcfi_online=%d. Terminated.",
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. Terminated.",
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. "
"Terminated.",
fcfp->vfi_online);
return (0);
}
return (rval);
} /* emlxs_fcfi_vfi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
{
return (0);
}
if (fcfp->vfi_online != 0) {
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. Terminated.",
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. Terminated.",
}
break;
case FCFI_STATE_PAUSED:
"fcfi_vfi_offline_evt_action:%d flag=%x vfi_online=%d. "
"Terminated.",
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. Terminated.",
}
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. Terminated.",
return (1);
}
"fcfi_online_evt_action:%d. "
"Online already requested. Terminated.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
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. "
"Terminated.",
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. Terminated.",
return (1);
}
"fcfi_offline_evt_action:%d. Offline already requested. "
"Terminated.",
return (1);
}
case FCFI_STATE_OFFLINE:
"fcfi_offline_evt_action:%d flag=%x. Already offline. "
"Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"fcfi_pause_evt_action:%d. Pause already requested. "
"Terminated.",
return (1);
}
"fcfi_pause_evt_action:%d. Offline already requested. "
"Terminated.",
return (1);
}
case FCFI_STATE_OFFLINE:
"fcfi_pause_evt_action:%d flag=%x. Already offline. "
"Terminated.",
break;
case FCFI_STATE_PAUSED:
"fcfi_pause_evt_action:%d flag=%x. Already paused. "
"Terminated.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
return (0);
}
"fcfi_reg_mbcmpl:%d failed. status=%x",
return (0);
}
"fcfi_reg_mbcmpl:%d Registered. FCFI=%d",
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. Terminated.",
return (1);
}
fcftab->fcfi_online++;
}
}
"fcfi_reg_action:%d attempts=%d. Offline requested.",
return (rval);
}
"fcfi_reg_action:%d. Already registered. Skipping reg.",
return (rval);
}
"fcfi_reg_action:%d attempts=%d. Sending FCFI_REG.",
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. Terminated.",
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. Terminated.",
return (0);
}
"fcfi_unreg_mbcmpl:%d failed. status=%x",
return (0);
}
"fcfi_unreg_mbcmpl:%d Unregistered.",
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. Terminated.",
return (1);
}
"fcfi_unreg_action:%d. Not registered. Skipping unreg.",
return (rval);
}
}
"fcfi_unreg_action:%d attempts=%d. Sending FCFI_UNREG.",
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. Terminated.",
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. Terminated.",
return (1);
}
"fcfi_online_action:%d attempts=%d. Offline requested.",
return (1);
}
/* 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 tag=%x flag=%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:%d %s:%s arg=%p. No action. Terminated.",
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: %s arg=%p. Null VPI found. Terminated.",
return (1);
}
if (!vfip) {
"vfi: %s arg=%p. VFI not found. Terminated.",
return (1);
}
break;
case FCF_EVENT_VFI_ONLINE:
case FCF_EVENT_VFI_OFFLINE:
case FCF_EVENT_VFI_PAUSE:
if (!vfip) {
"vfi: %s arg=%p. VFI not found. Terminated.",
return (1);
}
break;
default:
return (1);
}
"vfi:%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. Terminated.",
return (1);
}
(reason != FCF_REASON_REENTER)) {
"vfi_state:%d %s:%s:0x%x arg=%p. "
"State not changed. Terminated.",
return (1);
}
if (!reason) {
"vfi:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"vfi:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"vfi:%d %s-->%s:%s:0x%x arg=%p",
} else {
"vfi:%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. Terminated.",
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. "
"Terminated.",
vfip->vpi_online);
return (1);
}
return (rval);
} /* emlxs_vfi_vpi_online_evt_action() */
/*ARGSUSED*/
static uint32_t
{
return (0);
}
if (vfip->vpi_online > 0) {
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. Terminated.",
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. Terminated.",
}
break;
case VFI_STATE_PAUSED:
"vfi_vpi_offline_evt_action:%d flag=%x vpi_online=%d. "
"Terminated.",
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. Terminated.",
}
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. Terminated.",
return (1);
}
"vfi_online_evt_action:%d flag=%x. "
"Online already requested. Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"vfi_offline_evt_action:%d flag=%x. "
"Offline already requested. Terminated.",
return (0);
}
case VFI_STATE_OFFLINE:
"vfi_offline_evt_action:%d flag=%x. "
"Already offline. Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"vfi_pause_evt_action:%d flag=%x. "
"Pause already requested. Terminated.",
return (0);
}
"vfi_pause_evt_action:%d flag=%x. "
"Offline already requested. Terminated.",
return (0);
}
case VFI_STATE_OFFLINE:
"vfi_pause_evt_action:%d flag=%x. "
"Already offline. Terminated.",
break;
case VFI_STATE_PAUSED:
"vfi_pause_evt_action:%d flag=%x. "
"Already paused. Terminated.",
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. Terminated.",
break;
}
return (rval);
} /* emlxs_vfi_pause_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_offline_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"vfi_offline_action:%d %s:%s arg=%p flag=%x. "
"Null fcfp found. Terminated.",
return (1);
}
"vfi_offline_action:%d vfi_online=%d. Terminated.",
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. Terminated.",
return (0);
}
"vfi_init_mbcmpl:%d failed. status=%x",
return (0);
}
"vfi_init_mbcmpl:%d Initialized.",
return (0);
} /* emlxs_vfi_init_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_init_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
}
}
"vfi_init_action:%d attempts=%d. Offline requested.",
return (rval);
}
"vfi_init_action:%d flag=%x. "
"Already init'd. Skipping init.",
return (rval);
}
"vfi_init_action:%d vfi_online=%d. Skipping init.",
return (rval);
}
"vfi_init_action:%d vfi_online=%d attempts=%d",
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. Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"vfi_vpi_online_action:%d. Offline requested.",
return (rval);
}
if (vfip->logi_count > 0) {
"vfi_vpi_online_action:%d vpi_online=%d logi_count=%d. "
"VPI already logged in.",
vfip->logi_count);
}
if (vfip->vpi_online > 0) {
/* Waking up out 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. Terminated.",
return (1);
}
/* Waking up after pause */
"vfi_vpi_online_cmpl_action:%d flag=%x vpi_online=%d "
"logi_count=%d. Going online.",
vfip->logi_count);
} else {
"vfi_vpi_online_cmpl_action:%d flag=%x vpi_online=%d "
"logi_count=%d. Registering.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
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 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. Terminated.",
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. Terminated.",
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. Terminated.",
return (0);
}
"vfi_unreg_mbcmpl:%d failed. status=%x",
return (0);
}
"vfi_unreg_mbcmpl:%d Unregistered.",
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. Terminated.",
return (1);
}
"vfi_unreg_action:%d. Not registered. Skipping unreg.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
return (0);
}
"vfi_reg_mbcmpl:%d failed. status=%x",
return (0);
}
"vfi_reg_mbcmpl:%d Registered.",
}
return (0);
} /* emlxs_vfi_reg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vfi_reg_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
}
"vfi_reg_action:%d %attempts=%d. Offline requested.",
return (rval);
}
"vfi_reg_action:%d flag=%x. "
"Already registered. Skipping reg.",
return (rval);
}
1000000;
} 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);
}
}
/* Convert to seconds */
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. Terminated.",
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. Terminated.",
return (1);
}
"vfi_online_action:%d attempts=%d. Offline requested.",
return (rval);
}
/* Take Fabric RPI online now */
}
/* 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:%d %s:%s arg=%p. No action. Terminated.",
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) {
"rpi: %s arg=%p. Null RPI found. Terminated.",
return (1);
}
break;
case FCF_EVENT_VPI_ONLINE:
case FCF_EVENT_VPI_PAUSE:
case FCF_EVENT_VPI_OFFLINE:
if (!vpip) {
"vpi: %s arg=%p. Null VPI found. Terminated.",
return (1);
}
break;
default:
return (1);
}
"vpi:%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. Terminated.",
return (1);
}
if (!reason) {
"vpi:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"vpi:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"vpi:%d %s-->%s:%s:0x%x arg=%p",
} else {
"vpi:%d %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_vpi_state() */
extern uint32_t
{
uint32_t i;
return (1);
}
}
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. Terminated.",
return (0);
}
/* Find first available VFI for this FCFI */
break;
}
}
if (!vfip) {
"vpi_port_bind_notify:%d %s fcfi:%d. "
"No VFI available yet. Terminated.",
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);
}
"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;
}
DELAYMS(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. Terminated.",
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. Terminated.",
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. Terminated.",
rval = 0;
break;
case VPI_STATE_ONLINE:
"vpi_rpi_offline_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. Terminated.",
rval = 0;
break;
default:
"vpi_rpi_offline_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. "
"Invalid state. Terminated.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
rval = 0;
break;
default:
"vpi_rpi_pause_evt_action:%d rpi_online=%d,%d did=%x "
"rpi=%d. "
"Invalid state. Terminated.",
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. Terminated.",
return (1);
}
"vpi_rpi_online_evt_action:%d rpi_online=%d,%d did=%x rpi=%d. "
"Terminated.",
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. Terminated.",
return (1);
}
"vpi_online_evt_action:%d flag=%x. "
"Online already requested. Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"vpi_offline_evt_action:%d flag=%x. "
"Offline already requested. Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"vpi_pause_evt_action:%d flag=%x. "
"Pause already requested. Terminated.",
return (1);
}
"vpi_pause_evt_action:%d flag=%x. "
"Offline already requested. Terminated.",
return (1);
}
/* Fabric logo is implied */
}
}
}
case VPI_STATE_PORT_OFFLINE:
"vpi_pause_evt_action:%d flag=%x. "
"Already offline. Terminated.",
break;
case VPI_STATE_PAUSED:
"vpi_pause_evt_action:%d flag=%x. "
"Already paused. Terminated.",
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. Terminated.",
break;
}
return (rval);
} /* emlxs_vpi_pause_evt_action() */
/* ARGSUSED */
static void
{
return;
} /* emlxs_pkt_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 uint32_t
void *arg1)
{
"vpi_port_offline_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"vpi_port_offline_action:%d flag=%x. Offline 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 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 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. Terminated.",
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. Terminated.",
return (1);
}
"vpi_offline_action:%d %s:%s arg=%p flag=%x. "
"Null vfip found. Terminated.",
return (1);
}
/* Take the Fabric RPI offline, if still active */
}
}
}
/* 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. Terminated.",
return (0);
}
"vpi_init_mbcmpl:%d failed. status=%x",
return (0);
}
"vpi_init_mbcmpl:%d Initialized.",
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. Terminated.",
return (1);
}
}
"vpi_init_action:%d attempts=%d. Offline requested.",
return (rval);
}
}
"vpi_init_action:%d vpi_online=%d. Skipping init.",
return (rval);
}
"vpi_init_action:%d flag=%x. "
"Already init'd. Skipping init.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"vpi_port_online_action:%d. Port already online.",
}
"vpi_port_online_action:%d. Offline requested.",
return (rval);
}
/* Initialize the Fabric RPI */
}
"vpi_port_online_action:%d vpi_online=%d. Onlining port.",
/* Notify ULP */
/* Wait for emlxs_vpi_logi_notify() */
return (0);
} /* emlxs_vpi_port_online_action() */
extern uint32_t
{
return (1);
}
"port_logi_notify:%d %s. Terminated.",
return (1);
}
"port_logi_notify:%d %s. "
"Invalid state. Terminated.",
return (1);
}
0, 0, sbp);
if (rval) {
"port_logi_notify:%d %s rval=%d.",
rval);
}
return (rval);
} /* emlxs_vpi_logi_notify() */
extern uint32_t
{
IOERR_NO_RESOURCES, 1);
return (1);
}
"port_logi_cmpl_notify:%d %s. "
"Invalid state. Terminated.",
return (1);
}
0, 0, sbp);
if (rval) {
"port_logi_cmpl_notify:%d %s rval=%d.",
rval);
}
return (rval);
} /* emlxs_vpi_logi_cmpl_notify() */
extern uint32_t
{
return (1);
}
"port_logi_failed_notify:%d %s. "
"Invalid state. Terminated.",
return (1);
}
FCF_REASON_OP_FAILED, 1, 0);
if (rval) {
"port_logi_failed_notify:%d %s rval=%d.",
rval);
}
return (rval);
} /* emlxs_vpi_logi_failed_notify() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_logi_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"vpi_logi_action:%d. Offline requested.",
return (rval);
}
"vpi_logi_action:%d flag=%x. LOGI already set.",
}
}
}
/* 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. Terminated.",
return (1);
}
}
}
"vpi_logi_failed_action:%d. Requesting offline.",
return (rval);
} /* emlxs_vpi_logi_failed_action() */
static void
{
if (!sbp) {
return;
}
"vpi_flogi_cmpl:%d. status=%x",
status);
if (status) {
IOERR_NO_RESOURCES, 1);
} else {
}
return;
} /* emlxs_vpi_flogi_cmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
char buffer1[64];
char buffer2[64];
"vpi_logi_cmpl_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
if (!sbp) {
"vpi_logi_cmpl_action:%d. Null sbp. Terminated.",
return (1);
}
/* Check login parameters */
/* For safety */
}
/* Update the Fabric RPI */
sizeof (SERV_PARM));
}
"vpi_logi_cmpl_action:%d. "
"New fabric. 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. Terminated.",
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. Terminated.",
return (1);
}
"vpi_logo_action:%d. No login. Skipping logo.",
return (rval);
}
"vpi_logo_action:%d. HBA offline. Skipping logo.",
return (rval);
}
}
"vpi_logo_action:%d. Sending logo. Sending LOGO.",
if (!pkt) {
FCF_REASON_NO_PKT, 0, arg1);
return (rval);
}
/* Build the fc header */
did = FABRIC_DID;
/* Build the command */
"vpi_logo_action:%d LOGO:sid=%x did=%x.",
/* 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. Terminated.",
return (1);
}
}
}
"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. Terminated.",
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. Terminated.",
return (0);
}
"vpi_unreg_mbcmpl:%d failed. status=%x",
return (0);
}
"vpi_unreg_mbcmpl:%d Unregistered.",
return (0);
} /* emlxs_vpi_unreg_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"vpi_unreg_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
if ((vpip->rpi_online > 0) ||
"vpi_unreg_action:%d rpi_online=%d,%d. Waiting for RPI's.",
return (rval);
}
"vpi_unreg_action:%d. Not registered. Skipping unreg.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
return (0);
}
"vpi_reg_mbcmpl:%d failed. status=%x",
return (0);
}
"vpi_reg_mbcmpl:%d. Registered.",
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. Terminated.",
return (1);
}
}
"vpi_reg_action:%d attempts=%d. Offline requested.",
return (rval);
}
"vpi_reg_action:%d. First vpi. Skipping reg.",
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. Terminated.",
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. Terminated.",
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:%d %s:%s arg=%p. No action. Terminated.",
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: %s arg=%p. Null RPI found. Terminated.",
return (1);
}
break;
default:
return (1);
}
"rpi:%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. "
"Terminated.",
return (1);
}
if (!reason) {
"rpi:%d %s-->%s arg=%p",
} else if (reason == FCF_REASON_EVENT) {
"rpi:%d %s-->%s:%s:%s arg=%p",
} else if (explain) {
"rpi:%d %s-->%s:%s:0x%x arg=%p",
} else {
"rpi:%d %s-->%s:%s arg=%p",
}
return (rval);
} /* emlxs_rpi_state() */
static RPIobj_t *
{
uint16_t i;
/* Special handling for Fabric RPI */
if (did == FABRIC_DID) {
/* Use the reserved RPI in the port */
0, 0, 0);
return (rpip);
}
/* 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. */
0, 0, 0);
return (rpip);
}
}
return (NULL);
} /* emlxs_rpi_alloc() */
static uint32_t
{
return (rval);
} /* emlxs_fcfi_free() */
extern RPIobj_t *
{
/* Special handling for Fabric RPI */
if (rpi == 0xffff) {
}
"rpi_find:%d. RPI out of range (%d,%d).",
rpi,
return (NULL);
}
"rpi_find:%d RPI not active",
rpi);
return (NULL);
}
return (rpip);
} /* emlxs_rpi_find() */
static RPIobj_t *
{
uint32_t i;
/* Special handling for Fabric RPI */
if (did == FABRIC_DID) {
}
continue;
}
break;
}
}
return (rpip1);
} /* emlxs_rpi_find_did() */
extern RPIobj_t *
{
return (NULL);
}
/* Fabric RPI will be handled automatically */
if (did == FABRIC_DID) {
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.",
return (0);
} /* emlxs_rpi_pause_notify() */
extern uint32_t
{
return (1);
}
/* Fabric RPI will be handled automatically */
if (did == FABRIC_DID) {
return (1);
}
"rpi_online_notify: vpi=%d. Port disabled.",
return (1);
}
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);
}
"rpi_online_notify:%d %s. %s. Onlining.",
"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_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_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. Terminated.",
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",
}
"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. Terminated.",
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. Terminated.",
return (1);
}
case RPI_STATE_OFFLINE:
"rpi_offline_evt_action:%d flag=%x. Offlining RPI.",
break;
case RPI_STATE_UNREG:
"rpi_offline_evt_action:%d flag=%x. Already unregistering. "
"Terminated.",
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. Terminated.",
return (1);
}
case RPI_STATE_OFFLINE:
"rpi_pause_evt_action:%d flag=%x. Offlining RPI.",
break;
case RPI_STATE_UNREG:
"rpi_pause_evt_action:%d flag=%x. Not online. "
"Terminated.",
break;
case RPI_STATE_PAUSED:
"rpi_pause_evt_action:%d flag=%x. Already paused. "
"Terminated.",
break;
case RPI_STATE_REG:
case RPI_STATE_ONLINE:
case RPI_STATE_RESUME:
"rpi_pause_evt_action:%d flag=%x. Pausing.",
break;
default:
"rpi_pause_evt_action:%d flag=%x. Terminated.",
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. Terminated.",
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. Terminated.",
break;
}
return (rval);
} /* emlxs_rpi_resume_evt_action() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_offline_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
return (1);
}
"rpi_offline_action:%d rpi_online=%d,%d. Terminated.",
return (0);
}
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. Terminated.",
return (1);
}
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. Terminated.",
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 */
"rpi_unreg_action:%d xri_count=%d. "
"Unreserving XRI:%d iotag:%d.",
(void) emlxs_sli4_unreserve_xri(hba,
}
}
}
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. Terminated.",
return (0);
}
"rpi_unreg_mbcmpl:%d failed. status=%x",
return (0);
}
"rpi_unreg_mbcmpl:%d Unregistered. Unreg cmpl.",
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. Terminated.",
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. Terminated.",
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. Terminated.",
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++;
}
/* 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. "
"Terminated.",
return (0);
}
"rpi_reg_mbcmpl:%d failed. status=%x",
return (0);
}
if (rval) {
rval, 0, 0);
return (0);
}
"rpi_reg_mbcmpl:%d Registered. Reg cmpl.",
/* 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. Terminated.",
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 did=%x. vpi=%d. Port disabled. "
"Offlining RPI.",
return (rval);
}
}
"rpi_reg_action:%d flag=%x. Already registered. "
"Updating registration.",
}
"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. Terminated.",
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. Terminated.",
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. Terminated.",
return (0);
}
"rpi_resume_mbcmpl:%d failed. status=%x",
return (0);
}
"rpi_resume_mbcmpl:%d Resumed. Resume cmpl.",
return (0);
} /* emlxs_rpi_resume_mbcmpl() */
/*ARGSUSED*/
static uint32_t
void *arg1)
{
"rpi_resume_action:%d %s:%s arg=%p. "
"Invalid state. Terminated.",
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. Terminated.",
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. Terminated.",
return (1);
}
"rpi_online_action:%d did=%x. Fabric RPI online. "
"Terminated.",
}
return (0);
}
"rpi_online_action:%d did=%x. vpi=%d. Port disabled. "
"Offlining RPI.",
return (rval);
}
"rpi_online_action:%d did=%x. RPI online. Notifying VPI:%d.",
/* Notify VPI */
return (rval);
} /* emlxs_rpi_online_action() */