fp.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FP_H
#define _FP_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Debugging, Error reporting, and tracing
*/
/*
* Log contents to system messages file
*/
/*
* Log contents to trace buffer
*/
/*
* Log contents to both system messages file and trace buffer
*/
/*
* Log contents to system messages file, console and trace buffer
*/
#ifdef DEBUG
#define FP_DTRACE fc_trace_debug
#else
#define FP_DTRACE
#endif
#define FP_TRACE fc_trace_debug
#ifdef DEBUG
FP_LEVEL_2 | FP_LEVEL_3 |\
FP_LEVEL_4 | FP_LEVEL_5 |\
#else
FP_LEVEL_2 | FP_LEVEL_3 |\
FP_LEVEL_4 | FP_LEVEL_5 |\
#endif
/* This is used in about a dozen or so places in fp.c */
(pkt)->pkt_resp_resid != 0))
/*
* This is only used in fp_ns_init() and fp_fabric_online().
*/
#define FP_MAX_DEVICES 255
/*
* Software restoration bit fields while doing (PM)SUSPEND/(PM)RESUME
* Used with the fp_restore field in the fc_local_port_t struct.
*/
#define FP_RESTORE_WAIT_TIMEOUT 0x01
#define FP_RESTORE_OFFLINE_TIMEOUT 0x02
#define FP_ELS_TIMEOUT (20)
#define FP_NS_TIMEOUT (120)
#define FP_IS_F_PORT(p) ((p) & 0x1000)
#define FP_RETRY_COUNT (5)
#define FP_PORT_IDENTIFIER_LEN (4)
#define FP_UNSOL_BUF_COUNT (20)
#define FP_UNSOL_BUF_SIZE (sizeof (la_els_logi_t))
/*
* Values and macros used with fp_task and fp_last_task fields in
* the fc_local_port_t struct. Also see fp_job_handler() for more info.
*/
#define FP_TASK_IDLE 0
#define FP_TASK_PORT_STARTUP 1
#define FP_TASK_OFFLINE 2
#define FP_TASK_ONLINE 3
#define FP_TASK_GETMAP 4
/*
* cmd_flags
*/
#define FP_CMD_CFLAG_UNDEFINED (-1)
#define FP_CMD_PLOGI_DONT_CARE 0x00
/*
* cmd_dflags
*/
#define FP_CMD_VALID_DMA_MEM 0x01
#define FP_CMD_VALID_DMA_BIND 0x02
#define FP_RESP_VALID_DMA_MEM 0x04
#define FP_RESP_VALID_DMA_BIND 0x08
/* Values for fp_flag field in the fc_local_port_t struct */
#define FP_IDLE 0x00
#define FP_OPEN 0x01
#define FP_EXCL 0x02
#define FP_WARNING_MESSAGES 0x01
#define FP_FATAL_MESSAGES 0x02
#define FP_IS_CLASS_1_OR_2(x) \
((x) == FC_TRAN_CLASS1 || (x) == FC_TRAN_CLASS2)
/*
* Driver message control
*/
typedef enum fp_mesg_dest {
typedef struct soft_attach {
struct fc_local_port *att_port;
typedef struct fp_cmd {
int cmd_flags; /* cmd flags */
int cmd_retry_count;
int cmd_retry_interval; /* milli secs */
} fp_cmd_t;
typedef struct fp_unsol_spec {
#if !defined(__lint)
#endif /* __lint */
/*
* Procedure templates.
*/
static void fp_ulp_port_attach(void *arg);
static void fp_resendcmd(void *port_handle);
int orphan);
static void fp_offline_timeout(void *port_handle);
job_request_t *job);
job_request_t *job);
job_request_t *job);
job_request_t *job);
static void fp_ulp_unsol_cb(void *arg);
job_request_t *job);
job_request_t *job);
#ifdef __cplusplus
}
#endif
#endif /* _FP_H */