a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore/*
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * CDDL HEADER START
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore *
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * The contents of this file are subject to the terms of the
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * Common Development and Distribution License (the "License").
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * You may not use this file except in compliance with the License.
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore *
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld * You can obtain a copy of the license at
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld * http://www.opensource.org/licenses/cddl1.txt.
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * See the License for the specific language governing permissions
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * and limitations under the License.
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore *
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore *
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * CDDL HEADER END
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore/*
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld * Copyright (c) 2004-2012 Emulex. All rights reserved.
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore * Use is subject to license terms.
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#ifndef _EMLXS_FCF_H
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define _EMLXS_FCF_H
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#ifdef __cplusplus
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoreextern "C" {
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#endif
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFTAB_MAX_FCFI_COUNT 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_MAX_VFI_COUNT 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore/* Internal generic events */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_STATE_ENTER 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore/* External async fabric events */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_SHUTDOWN 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_LINKUP 2
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_LINKDOWN 3
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_CVL 4
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_FCFTAB_FULL 5
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_FCF_FOUND 6
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_FCF_LOST 7
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_EVENT_FCF_CHANGED 8
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore/* Internal async events */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_FCFTAB_ONLINE 9
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_FCFTAB_OFFLINE 10
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_FCFI_ONLINE 11
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_FCFI_OFFLINE 12
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_FCFI_PAUSE 13
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_VFI_ONLINE 14
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_VFI_OFFLINE 15
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_VFI_PAUSE 16
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_VPI_ONLINE 17
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_VPI_OFFLINE 18
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_VPI_PAUSE 19
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_RPI_ONLINE 20
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_RPI_OFFLINE 21
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_RPI_PAUSE 22
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_EVENT_RPI_RESUME 23
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore/* State change reason codes */ /* explan */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_NONE 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_REENTER 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_EVENT 2 /* evt */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_REQUESTED 3
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_NO_MBOX 4
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_NO_BUFFER 5
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_SEND_FAILED 6 /* status */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCF_REASON_MBOX_FAILED 7 /* status */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_MBOX_BUSY 8 /* status */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_NO_FCFI 9
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_NO_VFI 10
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_ONLINE_FAILED 11
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_OFFLINE_FAILED 12
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_OP_FAILED 13 /* attempts */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_NO_PKT 14
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_NO_NODE 15
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_NOT_ALLOWED 16
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_UNUSED 17
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCF_REASON_INVALID 18
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct XRIobj
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct XRIobj *_f;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct XRIobj *_b;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t XRI;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define XRI_STATE_FREE 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define XRI_STATE_ALLOCATED 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t sge_count;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t iotag;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore MBUF_INFO SGList;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct RPIobj *rpip;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld struct RPIobj *reserved_rpip;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore emlxs_buf_t *sbp;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t rx_id; /* Used for unsol exchanges */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t flag;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_XRI_RESERVED 0x00000001
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_XRI_PENDING_IO 0x00000002
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_BUSY 0x00000004
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint32_t type;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_SOL_FCP_TYPE 1
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_UNSOL_FCP_TYPE 2
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_SOL_CT_TYPE 3
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_UNSOL_CT_TYPE 4
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_SOL_ELS_TYPE 5
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_UNSOL_ELS_TYPE 6
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_XRI_SOL_BLS_TYPE 7
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} XRIobj_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct emlxs_deferred_cmpl
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct emlxs_port *port;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct emlxs_node *node;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore void *arg1;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore void *arg2;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore void *arg3;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} emlxs_deferred_cmpl_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FABRIC_RPI 0xffff
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct RPIobj
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t index;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t RPI;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define RPI_STATE_FREE 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_RESERVED 1
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_OFFLINE 2
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_UNREG_CMPL 3
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_UNREG_FAILED 4
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_UNREG 5
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_REG 6
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_REG_FAILED 7
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_REG_CMPL 8
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_PAUSED 9
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_RESUME 10
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_RESUME_FAILED 11
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_RESUME_CMPL 12
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define RPI_STATE_ONLINE 13
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t flag;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_RPI_VPI 0x00000010 /* rpi_online set */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_RPI_PAUSED 0x00000020 /* rpi_paused set */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_RPI_REG 0x00000040
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_RPI_FIRST 0x80000000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t attempts;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t xri_count; /* Managed by XRIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint32_t idle_timer;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct VPIobj *vpip;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore /* Node info */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct emlxs_node *node;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t did;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore SERV_PARM sparam;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore emlxs_deferred_cmpl_t *cmpl;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} RPIobj_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct VPIobj
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t index;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t VPI;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_OFFLINE 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_INIT 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_INIT_FAILED 2
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_INIT_CMPL 3
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_UNREG_CMPL 4
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_UNREG_FAILED 5
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_UNREG 6
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_LOGO_CMPL 7
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_LOGO_FAILED 8
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_LOGO 9
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_PORT_OFFLINE 10
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_PORT_ONLINE 11
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_LOGI 12
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_LOGI_FAILED 13
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_LOGI_CMPL 14
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_REG 15
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_REG_FAILED 16
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_REG_CMPL 17
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_PAUSED 18
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VPI_STATE_ONLINE 19
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t flag;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_ONLINE_REQ 0x00000001
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_OFFLINE_REQ 0x00000002
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_PAUSE_REQ 0x00000004
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_REQ_MASK 0x0000000F
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_VFI 0x00000010 /* vpi_online set */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_VFI_LOGI 0x00000020 /* logi_count set */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_INIT 0x00000040
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_REG 0x00000080
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_PORT_ONLINE 0x00000100
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_LOGI 0x00000200
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_VPI_PORT_UNBIND 0x40000000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VPI_PORT_ENABLED 0x80000000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t attempts;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld RPIobj_t fabric_rpi; /* Reserved Fabric RPI object */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld RPIobj_t *fabric_rpip; /* Fabric RPI pointer (&fabric_rpi) */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld RPIobj_t *p2p_rpip;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct emlxs_port *port;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore struct VFIobj *vfip; /* Managed by VFIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t rpi_online; /* Managed by RPIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t rpi_paused; /* Managed by RPIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} VPIobj_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct VFIobj
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t index;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t VFI;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_OFFLINE 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_INIT 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_INIT_FAILED 2
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_INIT_CMPL 3
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_VPI_OFFLINE_CMPL 4
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_VPI_OFFLINE 5
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_VPI_ONLINE 6
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_VPI_ONLINE_CMPL 7
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_UNREG_CMPL 8
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_UNREG_FAILED 9
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_UNREG 10
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_REG 11
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_REG_FAILED 12
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_REG_CMPL 13
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_PAUSED 14
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFI_STATE_ONLINE 15
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t flag;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VFI_ONLINE_REQ 0x00000001
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VFI_OFFLINE_REQ 0x00000002
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VFI_PAUSE_REQ 0x00000004
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VFI_REQ_MASK 0x0000000F
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VFI_FCFI 0x00000010 /* vfi_online set */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VFI_INIT 0x00000020
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_VFI_REG 0x00000040
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld SERV_PARM sparam; /* Last registered sparams */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t attempts;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld struct FCFIobj *fcfp; /* Managed by FCFIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint32_t vpi_online; /* Managed by VPIobj_t */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint32_t logi_count; /* Managed by VPIobj_t */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld struct VPIobj *flogi_vpip; /* Managed by VPIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} VFIobj_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct FCFIobj
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t index;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t FCFI;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t fcf_index;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t vlan_id;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_FREE 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_OFFLINE 1
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_UNREG_CMPL 2
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_UNREG_FAILED 3
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_UNREG 4
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_REG 5
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_REG_FAILED 6
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_REG_CMPL 7
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_VFI_OFFLINE_CMPL 8
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_VFI_OFFLINE 9
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_VFI_ONLINE 10
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_VFI_ONLINE_CMPL 11
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_PAUSED 12
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFI_STATE_ONLINE 13
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint16_t pad;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint16_t generation;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t offline_timer;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t attempts;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t event_tag;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t flag;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_ONLINE_REQ 0x00000001
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_OFFLINE_REQ 0x00000002
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_PAUSE_REQ 0x00000004
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_REQ_MASK 0x0000000F
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_FCFTAB 0x00000010 /* fcfi_online set */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_REG 0x00000020
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_VALID 0x00000100
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_AVAILABLE 0x00000200
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_CONFIGURED 0x00000400
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_FRESH 0x00000800
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_FAILED 0x00001000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_SELECTED 0x00002000 /* in use */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_VLAN_ID 0x00010000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_BOOT 0x00020000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_PRIMARY 0x00040000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define EMLXS_FCFI_TAGGED 0x80000000
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore /* struct VFTable vftab */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore FCF_RECORD_t fcf_rec;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t priority;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t vfi_online; /* Managed by VFIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} FCFIobj_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct VFTable
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define VFTAB_STATE_DISABLED 0
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t vfi_active;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t vfi_count;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore VFIobj_t *table;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} VFTable_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amoretypedef struct FCFTable
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore{
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t prev_state;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t reason;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t state;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld/* Common states */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCFTAB_STATE_SHUTDOWN 0
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCFTAB_STATE_OFFLINE 1
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld/* FCOE states */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_SHUTDOWN FCFTAB_STATE_SHUTDOWN
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_OFFLINE FCFTAB_STATE_OFFLINE
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_SOLICIT 2
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_SOLICIT_FAILED 3
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_SOLICIT_CMPL 4
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_READ 5
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_READ_FAILED 6
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_READ_CMPL 7
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_FCFI_OFFLINE_CMPL 8
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_FCFI_OFFLINE 9
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_FCFI_ONLINE 10
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_FCFI_ONLINE_CMPL 11
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FCOE_FCFTAB_STATE_ONLINE 12
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld/* FC states */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_SHUTDOWN FCFTAB_STATE_SHUTDOWN
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_OFFLINE FCFTAB_STATE_OFFLINE
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_TOPO 2
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_TOPO_FAILED 3
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_TOPO_CMPL 4
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_CFGLINK 5
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_CFGLINK_FAILED 6
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_CFGLINK_CMPL 7
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_SPARM 8
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_SPARM_FAILED 9
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_SPARM_CMPL 10
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_FCFI_OFFLINE_CMPL 11
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_FCFI_OFFLINE 12
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_FCFI_ONLINE 13
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_FCFI_ONLINE_CMPL 14
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define FC_FCFTAB_STATE_ONLINE 15
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint16_t TID;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint16_t generation;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t flag;
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld/* Common flags */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FCFTAB_REQ_MASK 0x0000000F
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FCFTAB_SHUTDOWN 0x80000000
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld/* FCOE flags */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FCOE_FCFTAB_SOL_REQ 0x00000001
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FCOE_FCFTAB_READ_REQ 0x00000002
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FCOE_FCFTAB_OFFLINE_REQ 0x00000004
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld/* FC flags */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FC_FCFTAB_TOPO_REQ 0x00000001
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FC_FCFTAB_CFGLINK_REQ 0x00000002
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FC_FCFTAB_SPARM_REQ 0x00000004
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld#define EMLXS_FC_FCFTAB_OFFLINE_REQ 0x00000008
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t attempts;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t fcfi_online; /* Managed by FCFIobj_t */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore FCFIobj_t *fcfi[FCFTAB_MAX_FCFI_COUNT];
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint32_t fcfi_count;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore FCFIobj_t *table;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore uint16_t table_count;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint32_t online_timer; /* FC */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint32_t sol_timer; /* FCOE */
8f23e9fa8abcb5857661066b954e63400d589b65Hans Rosenfeld uint32_t read_timer; /* FCOE */
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore} FCFTable_t;
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#define FCFTAB_READ_ALL (void*)0xffff
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#ifdef __cplusplus
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore}
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#endif
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore
a9800beb32c1006bb21c8da39e0180ea440b7badGarrett D'Amore#endif /* _EMLXS_FCF_H */