/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FCT_IMPL_H
#define _FCT_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
typedef enum fct_li_state {
#define LI_STATE_START 0
/* Next state depends on the return value */
/* Link init cmd is still outstanding */
/* Flag to indicate that link info is not available yet */
struct fct_i_cmd;
typedef struct fct_i_cmd {
void *icmd_cb_private;
} fct_i_cmd_t;
/*
* icmd_flags
*/
/* High order are debug flags */
/*
* For solicited commands, there's only 3 states:
* 1) it's new. We need send it to FCA. ICMD_SOLCMD_NEW is set
* 2) it's running. We are waiting for completion.
* 3) it's completed. We need free it. ICMD_CMD_COMPLETE is set
* ICMD_SOLCMD_NEW and ICMD_CMD_COMPLETE should not be set in the same time
*/
typedef struct fct_i_remote_port {
/* For queueing to local port */
/* For queueing to handle elses */
/*
* sa stands for session affecting, nsa is non session affecting.
* The els counts only represent elses under progress not the ones
* that are terminated. active_xchg_count covers everything including
* the ones waiting to be terminated.
*/
/*
* Most HBAs will only register symbolic node name instead of port name,
* so we use SNN as session alias.
*/
char *irp_snn;
/* items will be filled in ns cmd */
/*
* structure used for fct_rls_cb() callback private data
*/
typedef struct fct_rls_cb_data {
/*
* irp flags
*/
typedef struct fct_cmd_slot {
typedef struct fct_i_local_port {
char *iport_alias;
/*
* These variables are used to manage fct_cmd_t cache for SCSI traffic
*/
/*
* Total # of cmds allocated by the driver. Some of which are free
* and sitting on iport_cached_cmdlist. And some are executing.
*/
/*
* Max active cmds in last interval (10 or 30 seconds)
*/
/*
* # of free cmds sitting on the iport_cached_cmdlist
*/
/*
* To release free cmds periodically
*/
/* cmd slots */
/* upper 16 bits is just a counter to avoid ABA issues */
/* worker thread data */
/* link initialization */
/* solicited cmd link */
/* rpwe = remote port with pending els(es) */
/*
* iport flags
*/
/* Limits for scsi task load of local port */
typedef struct fct_i_event {
int event_type;
typedef enum { /* Seggested action values for discovery thread */
DISC_ACTION_NO_WORK = 0,
/*
* Local port state definitions
* NOTE that every time there is a state change, the newly set bit suggests
* the action. So far there are 3 actions S_PORT_CLEANUP, S_ADAPTER_FATAL
* and S_INIT_LINK.
*/
/*
* Internal events
*/
/*
* Offline processing states, used by worker thread.
*/
#define FCT_OPR_DONE 0
/*
* Check time
*/
/*
* Define frequently used macros
*/
#ifdef __cplusplus
}
#endif
#endif /* _FCT_IMPL_H */