fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
c946faca5d4627284fb79c6b04e652b471034495allan * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _FCT_IMPL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _FCT_IMPL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RSCN_OPTION_VERIFY 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum fct_li_state {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_FLOGI = 0, /* FLOGI handled by FCA */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_FINI_TOPOLOGY, /* Finalize topology */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_N2N_PLOGI, /* In case of a N2N connection */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_FCLOGIN, /* Login into 0xFFFFFD */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_SCR, /* State change registration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_NSLOGIN, /* Login into 0xFFFFFC */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_RNN, /* Register node name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_RCS, /* Register classes of service */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_RFT, /* Register FC-4 types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_RSPN, /* Register symbolic port name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_DO_RSNN, /* Register symbolic node name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LI_STATE_MAX /* Not a real state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fct_li_state_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LI_STATE_START 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LI_STATE_MASK 0x3F
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Next state depends on the return value */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LI_STATE_FLAG_CMD_RETCHECK 0x40
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Link init cmd is still outstanding */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LI_STATE_FLAG_CMD_WAITING 0x80
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Flag to indicate that link info is not available yet */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LI_STATE_FLAG_NO_LI_YET 0x100
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_MAX_CACHED_CMDS 256
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define USEC_ELS_TIMEOUT (10 * 1000 * 1000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define USEC_SOL_TIMEOUT (10 * 1000 * 1000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define USEC_DEREG_RP_TIMEOUT (25 * 1000 * 1000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define USEC_DEREG_RP_INTERVAL (2 * 1000 * 1000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct fct_i_cmd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef void (* fct_icmd_cb_t)(struct fct_i_cmd *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fct_i_cmd {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_cmd_t *icmd_cmd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t icmd_alloc_size;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_struct_id_t icmd_struct_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t icmd_flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte clock_t icmd_start_time;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_cmd *icmd_next; /* iport_abort_queue and irp */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_cmd *icmd_solcmd_next; /* iport_solcmd_queue */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_icmd_cb_t icmd_cb;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *icmd_cb_private;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fct_i_cmd_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * icmd_flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_SESSION_AFFECTING 0x0002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_IN_IRP_QUEUE 0x0004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_BEING_ABORTED 0x0008
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_KNOWN_TO_FCA 0x0020
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_FCA_ABORT_CALLED 0x0040
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_CMD_COMPLETE 0x0080
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_IN_TRANSITION 0x0100
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_ABTS_RECEIVED 0x0200
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_IMPLICIT 0x0400
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_IMPLICIT_CMD_HAS_RESOURCE 0x0800
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* High order are debug flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_ELS_PROCESSING_STARTED 0x80000000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * For solicited commands, there's only 3 states:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 1) it's new. We need send it to FCA. ICMD_SOLCMD_NEW is set
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2) it's running. We are waiting for completion.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 3) it's completed. We need free it. ICMD_CMD_COMPLETE is set
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ICMD_SOLCMD_NEW and ICMD_CMD_COMPLETE should not be set in the same time
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_IN_SOLCMD_QUEUE 0x010000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_SOLCMD_NEW 0x020000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fct_i_remote_port {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_remote_port_t *irp_rp;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_alloc_size;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_struct_id_t irp_struct_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte krwlock_t irp_lock;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* For queueing to local port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_remote_port *irp_next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* For queueing to handle elses */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_remote_port *irp_discovery_next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_cmd_t *irp_els_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sa stands for session affecting, nsa is non session affecting.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The els counts only represent elses under progress not the ones
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * that are terminated. active_xchg_count covers everything including
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the ones waiting to be terminated.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t irp_sa_elses_count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t irp_nsa_elses_count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t irp_fcp_xchg_count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t irp_nonfcp_xchg_count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte clock_t irp_deregister_timer;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_dereg_count;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_portid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t irp_id[24];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_rcvd_prli_params;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_sent_prli_params;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Most HBAs will only register symbolic node name instead of port name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * so we use SNN as session alias.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_scsi_session_t *irp_session;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char *irp_snn;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* items will be filled in ns cmd */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t irp_fc4types[32]; /* FC-4 types */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char *irp_spn; /* port symbolic name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_cos; /* class of service */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t irp_rscn_counter;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fct_i_remote_port_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
c946faca5d4627284fb79c6b04e652b471034495allan/*
c946faca5d4627284fb79c6b04e652b471034495allan * structure used for fct_rls_cb() callback private data
c946faca5d4627284fb79c6b04e652b471034495allan */
c946faca5d4627284fb79c6b04e652b471034495allantypedef struct fct_rls_cb_data {
c946faca5d4627284fb79c6b04e652b471034495allan struct fct_port_link_status *fct_link_status;
c946faca5d4627284fb79c6b04e652b471034495allan fct_status_t fct_els_res;
c946faca5d4627284fb79c6b04e652b471034495allan} fct_rls_cb_data_t;
c946faca5d4627284fb79c6b04e652b471034495allan
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * irp flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_PLOGI_DONE 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_PRLI_DONE 0x0002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_IN_DISCOVERY_QUEUE 0x0004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_FCP_CLEANUP 0x0008
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_SESSION_CLEANUP (IRP_FCP_CLEANUP | 0x0010)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_HANDLE_OPENED 0x0020
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_SCSI_SESSION_STARTED 0x0040
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_RSCN_QUEUED 0x0080
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IRP_SOL_PLOGI_IN_PROGRESS 0x0100
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fct_cmd_slot {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_cmd_t *slot_cmd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t slot_no;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t slot_next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t slot_uniq_cntr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fct_cmd_slot_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_SLOT_EOL 0xffff
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_HASH_TABLE_SIZE 256
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_LOOP_HASH(portid) (portid & 0xff)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_FABRIC_HASH(portid) (((portid & 0x1f00) | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((portid & 0x70000)>>3)) >> 8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_PORTID_HASH_FUNC(portid) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((portid & 0xFFFF00)?FCT_FABRIC_HASH(portid):FCT_LOOP_HASH(portid))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fct_i_local_port {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_local_port_t *iport_port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_alloc_size;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_struct_id_t iport_struct_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_local_port *iport_next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_local_port *iport_prev;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char *iport_alias;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char iport_alias_mem[16];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t iport_id[24]; /* scsi_devid_desc_t */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte krwlock_t iport_lock;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t iport_link_state;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t iport_state:7,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iport_state_not_acked:1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t iport_offline_prstate;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_link_info iport_link_info;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_remote_port_t **iport_rp_slots;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_remote_port_t **iport_rp_tb;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_nrps_login; /* currently logged in */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_nrps; /* items in hash table */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t iport_last_change;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * These variables are used to manage fct_cmd_t cache for SCSI traffic
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Total # of cmds allocated by the driver. Some of which are free
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and sitting on iport_cached_cmdlist. And some are executing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_total_alloced_ncmds;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Max active cmds in last interval (10 or 30 seconds)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_max_active_ncmds;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * # of free cmds sitting on the iport_cached_cmdlist
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_cached_ncmds;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_cmd *iport_cached_cmdlist;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t iport_cached_cmd_lock;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * To release free cmds periodically
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte clock_t iport_cmdcheck_clock;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t iport_task_green_limit;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t iport_task_yellow_limit;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t iport_task_red_limit;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* cmd slots */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t iport_nslots_free;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* upper 16 bits is just a counter to avoid ABA issues */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iport_next_free_slot;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t iport_login_retry; /* for flogi and N2N plogi */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t iport_link_old_topology;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t iport_link_cleanup_retry;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte clock_t iport_li_cmd_timeout; /* for li state m/c */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_cmd_slot_t *iport_cmd_slots;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* worker thread data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ddi_taskq_t *iport_worker_taskq;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t iport_worker_lock;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kcondvar_t iport_worker_cv;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_event *iport_event_head;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_event *iport_event_tail;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_cmd *iport_abort_queue;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_cmd **iport_ppicmd_term;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* link initialization */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_status_t iport_li_comp_status;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte enum fct_li_state iport_li_state;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* solicited cmd link */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_cmd *iport_solcmd_queue;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* rpwe = remote port with pending els(es) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_remote_port_t *iport_rpwe_head;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_remote_port_t *iport_rpwe_tail;
c946faca5d4627284fb79c6b04e652b471034495allan kstat_t *iport_kstat_portstat;
c946faca5d4627284fb79c6b04e652b471034495allan ksema_t iport_rls_sema;
c946faca5d4627284fb79c6b04e652b471034495allan fct_rls_cb_data_t iport_rls_cb_data;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fct_i_local_port_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_FLOGI_DONE(iport) PORT_FLOGI_DONE(&(iport)->iport_link_info)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * iport flags
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_WORKER_RUNNING 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_TERMINATE_WORKER 0x0002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_WORKER_DOING_TIMEDWAIT 0x0004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_WORKER_DOING_WAIT 0x0008
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_FLAG_PORT_OFFLINED 0x0010
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_ALLOW_UNSOL_FLOGI 0x0020
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_WORKER_SLEEPING(iport) ((iport)->iport_flags & \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (IPORT_WORKER_DOING_TIMEDWAIT | IPORT_WORKER_DOING_WAIT))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Limits for scsi task load of local port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_TASK_GREEN_LIMIT 80
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_TASK_YELLOW_LIMIT 90
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_TASK_RED_LIMIT 95
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fct_i_event {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fct_i_event *event_next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int event_type;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fct_i_event_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum { /* Seggested action values for discovery thread */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DISC_ACTION_NO_WORK = 0,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DISC_ACTION_RESCAN = 1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DISC_ACTION_DELAY_RESCAN = 2,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DISC_ACTION_USE_SHORT_DELAY = 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} disc_action_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Local port state definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NOTE that every time there is a state change, the newly set bit suggests
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the action. So far there are 3 actions S_PORT_CLEANUP, S_ADAPTER_FATAL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and S_INIT_LINK.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define S_RCVD_LINK_DOWN 0x01
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define S_RCVD_LINK_UP 0x02
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define S_LINK_ONLINE 0x04
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define S_INIT_LINK 0x08
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define S_PORT_CLEANUP 0x10
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_STATE_LINK_DOWN 0x00
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_STATE_LINK_INIT_START (S_RCVD_LINK_UP | S_LINK_ONLINE |\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte S_INIT_LINK)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_STATE_LINK_INIT_DONE (S_LINK_ONLINE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_STATE_LINK_UP_CLEANING (S_RCVD_LINK_UP | S_PORT_CLEANUP)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_STATE_LINK_DOWN_CLEANING (S_RCVD_LINK_DOWN | S_PORT_CLEANUP)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Internal events
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_I_EVENT_LINK_INIT_DONE 0x80
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_I_EVENT_CLEANUP_POLL 0x81
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Offline processing states, used by worker thread.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_OPR_DONE 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_OPR_START 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_OPR_CMD_CLEANUP_WAIT 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_OPR_INT_CLEANUP_WAIT 3
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Check time
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_CMDLIST_CHECK_SECONDS 10
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Define frequently used macros
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_TO_CT(x_icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((fct_sol_ct_t *)(x_icmd)->icmd_cmd->cmd_specific)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_TO_ELS(x_icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((fct_els_t *)(x_icmd)->icmd_cmd->cmd_specific)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_TO_IPORT(x_icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((fct_i_local_port_t *)(x_icmd)->icmd_cmd->cmd_port->port_fct_private)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_TO_PORT(x_icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((x_icmd)->icmd_cmd->cmd_port)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ICMD_TO_IRP(x_icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((fct_i_remote_port_t *)(x_icmd)->icmd_cmd->cmd_rp->rp_fct_private)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CMD_TO_ICMD(x_cmd) ((fct_i_cmd_t *)(x_cmd)->cmd_fct_private)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define RP_TO_IRP(x_rp) ((fct_i_remote_port_t *)(x_rp)->rp_fct_private)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_TO_IPORT(x_port) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((fct_i_local_port_t *)(x_port)->port_fct_private)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_IS_ELS_ACC(x_icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (((x_icmd)->icmd_cmd->cmd_comp_status == FCT_SUCCESS) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (ICMD_TO_ELS(x_icmd)->els_resp_payload[0] == ELS_OP_ACC))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCT_IS_CT_ACC(x_icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (((x_icmd)->icmd_cmd->cmd_comp_status == FCT_SUCCESS) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (ICMD_TO_CT(x_icmd)->ct_resp_payload[8] == 0x80) &&\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (ICMD_TO_CT(x_icmd)->ct_resp_payload[9] == 0x02))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IPORT_IN_NS_TOPO(x_iport) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((x_iport)->iport_link_info.port_topology & PORT_TOPOLOGY_FABRIC_BIT)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_LOGO_ELS(icmd) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (ICMD_TO_ELS(icmd)->els_req_payload[0] == ELS_OP_LOGO)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestmf_status_t fct_xfer_scsi_data(scsi_task_t *task,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stmf_data_buf_t *dbuf, uint32_t ioflags);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestmf_status_t fct_send_scsi_status(scsi_task_t *task, uint32_t ioflags);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefct_i_remote_port_t *fct_portid_to_portptr(fct_i_local_port_t *iport,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t portid);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefct_i_remote_port_t *fct_lookup_irp_by_nodewwn(fct_i_local_port_t *iport,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t *nodewwn);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefct_i_remote_port_t *fct_lookup_irp_by_portwwn(fct_i_local_port_t *iport,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t *portwwn);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_queue_rp(fct_i_local_port_t *iport, fct_i_remote_port_t *irp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_deque_rp(fct_i_local_port_t *iport, fct_i_remote_port_t *irp);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint fct_implicitly_logo_all(fct_i_local_port_t *iport, int force_implicit);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_post_implicit_logo(fct_cmd_t *cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_rehash(fct_i_local_port_t *iport);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint8_t fct_local_port_cleanup_done(fct_i_local_port_t *iport);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_handle_rcvd_abts(fct_cmd_t *cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_fill_abts_acc(fct_cmd_t *cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_q_for_termination_lock_held(fct_i_local_port_t *iport,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_cmd_t *icmd, fct_status_t s);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisc_action_t fct_handle_port_offline(fct_i_local_port_t *iport);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisc_action_t fct_cmd_terminator(fct_i_local_port_t *iport);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_cmd_free(fct_cmd_t *cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_scsi_task_free(scsi_task_t *task);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestmf_status_t fct_scsi_abort(stmf_local_port_t *lport, int abort_cmd,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *arg, uint32_t flags);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestmf_status_t fct_info(uint32_t cmd, stmf_local_port_t *lport,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *arg, uint8_t *buf, uint32_t *bufsizep);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_event_handler(stmf_local_port_t *lport, int eventid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *arg, uint32_t flags);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint16_t fct_alloc_cmd_slot(fct_i_local_port_t *iport, fct_cmd_t *cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_post_to_discovery_queue(fct_i_local_port_t *iport,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fct_i_remote_port_t *irp, fct_i_cmd_t *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefct_cmd_t *fct_create_solct(fct_local_port_t *port, fct_remote_port_t *rp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ctop, fct_icmd_cb_t icmdcb);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefct_cmd_t *fct_create_solels(fct_local_port_t *port, fct_remote_port_t *rp,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int implicit, uchar_t elsop, uint32_t wkdid, fct_icmd_cb_t icmdcb);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_handle_solct(fct_cmd_t *cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_post_to_solcmd_queue(fct_local_port_t *port, fct_cmd_t *cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_logo_cb(fct_i_cmd_t *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_link_init_cb(fct_i_cmd_t *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_gsnn_cb(fct_i_cmd_t *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_gcs_cb(fct_i_cmd_t *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_gft_cb(fct_i_cmd_t *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid fct_gspn_cb(fct_i_cmd_t *icmd);
c946faca5d4627284fb79c6b04e652b471034495allanvoid fct_rls_cb(fct_i_cmd_t *icmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortedisc_action_t fct_process_link_init(fct_i_local_port_t *iport);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _FCT_IMPL_H */