fctl.h revision 1787f50304cd7e85910a3e14f639ac892c0d76b7
/*
* 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 _FCTL_H
#define _FCTL_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* These are the legal values for the fp_state member of the fc_local_port_t
*
* The link state value is kept the least significant byte, and the link speed
* value is kept in the next most significant byte:
*
* +------------+------------+
* | link speed | link state |
* +------------+------------+
*/
/* Values for the link state (least significant byte as above) */
/* initialized. */
/* is given in fp_topology. */
/* is a private loop. */
#define FC_STATE_RESET 0x0004
#define FC_STATE_RESET_REQUESTED 0x0005
#define FC_STATE_LIP 0x0006
#define FC_STATE_LIP_LBIT_SET 0x0007
#define FC_STATE_TARGET_PORT_RESET 0x0009
/* Values for the link speed (next least significant byte as above) */
/*
* Macros to discriminate between the link state byte and the link speed
* byte in fp_state (also good for improved code obfuscation and job security
* even during a good economy).
*/
/*
* Notify flags passed between ULPs and FCAs
*
* 3 bytes 1 byte
* +-----------------------+---------------+
* | Flag specific values | Notify flag |
* +-----------------------+---------------+
*/
#define FC_NOTIFY_RECOVERY_DONE 0x01
#define FC_NOTIFY_TARGET_MODE 0x02
#define FC_NOTIFY_NO_TARGET_MODE 0x03
#define FC_NOTIFY_RECOVERY_CLEANUP 0x04
#define FC_NOTIFY_THROTTLE 0x80
/*
* pkt_tran_flags definitions
*/
#define FC_TRAN_INTR 0x01
#define FC_TRAN_NO_INTR 0x02
#define FC_TRAN_HI_PRIORITY 0x04
#define FC_TRAN_DUMPING 0x08
#define FC_TRAN_CLASS1 0x10
#define FC_TRAN_CLASS2 0x20
#define FC_TRAN_CLASS3 0x30
#define FC_TRAN_CLASS_INVALID 0xF0
#define FC_TRAN_IMMEDIATE_CB 0x100
/*
* pkt_tran_type definitions
*/
#define FC_PKT_NOP 0
#define FC_PKT_INBOUND 1
#define FC_PKT_OUTBOUND 2
#define FC_PKT_EXCHANGE 3
#define FC_PKT_FCP_READ 4
#define FC_PKT_FCP_WRITE 5
#define FC_PKT_IP_WRITE 6
#define FC_PKT_BROADCAST 7
#define FC_TRACE_LOG_MASK 0xF00000
#define FC_TRACE_LOG_MSG 0x100000
#define FC_TRACE_LOG_CONSOLE 0x200000
#define FC_TRACE_LOG_CONSOLE_MSG 0x400000
#define FC_TRACE_LOG_BUF 0x080000
/*
* The fc_packet_t represents an FC Exchange and is the primary unit of
* information exchange between FC driver modules.
*/
typedef struct fc_packet {
void (*pkt_ulp_comp)(struct fc_packet *);
/* framework private */
/*
* The pkt_ulp_rscn_infop (aka pkt_ulp_rsvd1) field is used to carry
* the rscn info (of type fc_ulp_rscn_info_t) down to the transport so
* that the transport can determine (in some cases) whether or not the
* requested operation was aware of the latest state change
* notification.
*
* If not NULL, then the pkt_ulp_rscn_infop (aka pkt_ulp_rsvd1) may
* point to an fc_ulp_rscn_info_t struct that contains the rscn count
* information for this fc_packet_t.
*/
} fc_packet_t;
#if !defined(__lint)
#endif /* __lint */
typedef struct fca_hba_fru_details {
/*
*/
#define FC_HBA_PORTSPEED_UNKNOWN 0 /* Unknown - transceiver incable */
/* of reporting */
#define FCHBA_MANUFACTURER_LEN 64
#define FCHBA_SERIAL_NUMBER_LEN 64
#define FCHBA_MODEL_LEN 256
#define FCHBA_MODEL_DESCRIPTION_LEN 256
#define FCHBA_HARDWARE_VERSION_LEN 256
#define FCHBA_DRIVER_VERSION_LEN 256
#define FCHBA_OPTION_ROM_VERSION_LEN 256
#define FCHBA_FIRMWARE_VERSION_LEN 256
#define FCHBA_DRIVER_NAME_LEN 256
#define FCHBA_SYMB_NAME_LEN 255
typedef struct fca_port_attrs {
char model[FCHBA_MODEL_LEN];
char driver_name[FCHBA_DRIVER_NAME_LEN];
typedef struct unsolicited_buffer {
void *ub_port_private;
void *ub_fca_private;
#define FC_UB_RESP_LOGIN_REQUIRED 0x4000
typedef struct fc_trace_dmsg {
int id_size; /* message size */
int id_flag; /* for future */
#define FC_TRACE_LOGQ_V2 0x1
typedef struct fc_trace_logq {
int il_hiwat; /* maximum queue size */
int il_flags;
int il_size; /* current size */
int il_afail; /* count of allocation failures */
int il_lfail; /* general logging failures */
int il_id; /* message Id */
/*
* Values for the pd_type field in the fc_remote_port_t struct below.
* (Also used in map_type and changelist determination)
*/
/* no change on the remote port */
/* port has come back after being */
/* marked as PORT_DEVICE_OLD */
/* the remote port may come back */
/* has occurred (hot swap?) */
/*
* Flags used for fc_portmap->map_type
*/
/* entry for this target */
/* later in the list */
#define PORT_DEVICE_NO_SKIP_DEVICE_DISCOVERY 0x00000002
/*
* Logging and Debugging support
*/
/*
* Common utility routines
*/
#if !defined(__lint)
#endif /* __lint */
#ifdef __cplusplus
}
#endif
#endif /* _FCTL_H */