xref: /onnv-gate/usr/src/uts/common/sys/fibre-channel/impl/fcal.h (revision 7836:4e95154b5b7a)
1*7836SJohn.Forte@Sun.COM /*
2*7836SJohn.Forte@Sun.COM  * CDDL HEADER START
3*7836SJohn.Forte@Sun.COM  *
4*7836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
5*7836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
6*7836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
7*7836SJohn.Forte@Sun.COM  *
8*7836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*7836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
11*7836SJohn.Forte@Sun.COM  * and limitations under the License.
12*7836SJohn.Forte@Sun.COM  *
13*7836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*7836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*7836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*7836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*7836SJohn.Forte@Sun.COM  *
19*7836SJohn.Forte@Sun.COM  * CDDL HEADER END
20*7836SJohn.Forte@Sun.COM  */
21*7836SJohn.Forte@Sun.COM /*
22*7836SJohn.Forte@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*7836SJohn.Forte@Sun.COM  * Use is subject to license terms.
24*7836SJohn.Forte@Sun.COM  */
25*7836SJohn.Forte@Sun.COM 
26*7836SJohn.Forte@Sun.COM #ifndef	_SYS_FIBRE_CHANNEL_IMPL_FCAL_H
27*7836SJohn.Forte@Sun.COM #define	_SYS_FIBRE_CHANNEL_IMPL_FCAL_H
28*7836SJohn.Forte@Sun.COM 
29*7836SJohn.Forte@Sun.COM 
30*7836SJohn.Forte@Sun.COM #include <sys/note.h>
31*7836SJohn.Forte@Sun.COM 
32*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
33*7836SJohn.Forte@Sun.COM extern "C" {
34*7836SJohn.Forte@Sun.COM #endif
35*7836SJohn.Forte@Sun.COM 
36*7836SJohn.Forte@Sun.COM /*
37*7836SJohn.Forte@Sun.COM  * Loop Initilization Identifier values
38*7836SJohn.Forte@Sun.COM  */
39*7836SJohn.Forte@Sun.COM #define	LID_LISM	0x1101
40*7836SJohn.Forte@Sun.COM #define	LID_LIFA	0x1102
41*7836SJohn.Forte@Sun.COM #define	LID_LIPA	0x1103
42*7836SJohn.Forte@Sun.COM #define	LID_LIHA	0x1104
43*7836SJohn.Forte@Sun.COM #define	LID_LISA	0x1105
44*7836SJohn.Forte@Sun.COM #define	LID_LIRP	0x1106
45*7836SJohn.Forte@Sun.COM #define	LID_LILP	0x1107
46*7836SJohn.Forte@Sun.COM 
47*7836SJohn.Forte@Sun.COM /*
48*7836SJohn.Forte@Sun.COM  * lilp_magic definitions
49*7836SJohn.Forte@Sun.COM  */
50*7836SJohn.Forte@Sun.COM #define	MAGIC_LISM	0x01
51*7836SJohn.Forte@Sun.COM #define	MAGIC_LIFA	0x02
52*7836SJohn.Forte@Sun.COM #define	MAGIC_LIPA	0x03
53*7836SJohn.Forte@Sun.COM #define	MAGIC_LIHA	0x04
54*7836SJohn.Forte@Sun.COM #define	MAGIC_LISA	0x05
55*7836SJohn.Forte@Sun.COM #define	MAGIC_LIRP	0x06
56*7836SJohn.Forte@Sun.COM #define	MAGIC_LILP	0x07
57*7836SJohn.Forte@Sun.COM 
58*7836SJohn.Forte@Sun.COM /*
59*7836SJohn.Forte@Sun.COM  * PLDA timers (in seconds)
60*7836SJohn.Forte@Sun.COM  */
61*7836SJohn.Forte@Sun.COM #define	PLDA_R_A_TOV	2
62*7836SJohn.Forte@Sun.COM #define	PLDA_RR_TOV	2
63*7836SJohn.Forte@Sun.COM 
64*7836SJohn.Forte@Sun.COM /*
65*7836SJohn.Forte@Sun.COM  * Note that my_alpa field is of 16 bit size. The lowest significant
66*7836SJohn.Forte@Sun.COM  * byte contains the real ALPA.  The highest significant bits are
67*7836SJohn.Forte@Sun.COM  * used to indicate if the LBIT was set during Loop Initialization.
68*7836SJohn.Forte@Sun.COM  *
69*7836SJohn.Forte@Sun.COM  * If the NL_Ports on the loop participate in the LIRP and LILP dance
70*7836SJohn.Forte@Sun.COM  * as part of Loop Initialization then the presence of an F_Port can
71*7836SJohn.Forte@Sun.COM  * be detected by checking for the presence of AL_PA '0x00' in the AL_PA
72*7836SJohn.Forte@Sun.COM  * list (That does not however guarantee if there is a violating NL_Port
73*7836SJohn.Forte@Sun.COM  * trying to grab AL_PA value of '0x00').
74*7836SJohn.Forte@Sun.COM  *
75*7836SJohn.Forte@Sun.COM  * Some FCAs may be capable of notifying if the L_BIT was set in the
76*7836SJohn.Forte@Sun.COM  * AL_PA bit map. The host should then perform an IMPLICIT LOGO and
77*7836SJohn.Forte@Sun.COM  * execute a PLOGI before sending any other command.
78*7836SJohn.Forte@Sun.COM  */
79*7836SJohn.Forte@Sun.COM #define	LILP_LBIT_SET		0x100	/* Login Required */
80*7836SJohn.Forte@Sun.COM 
81*7836SJohn.Forte@Sun.COM typedef struct fc_lilpmap {
82*7836SJohn.Forte@Sun.COM 	uint16_t	lilp_magic;
83*7836SJohn.Forte@Sun.COM 	uint16_t	lilp_myalpa;
84*7836SJohn.Forte@Sun.COM 	uchar_t		lilp_length;
85*7836SJohn.Forte@Sun.COM 	uchar_t		lilp_alpalist[127];
86*7836SJohn.Forte@Sun.COM } fc_lilpmap_t;
87*7836SJohn.Forte@Sun.COM 
88*7836SJohn.Forte@Sun.COM #if	!defined(__lint)
89*7836SJohn.Forte@Sun.COM _NOTE(SCHEME_PROTECTS_DATA("unique per request", fc_lilpmap))
90*7836SJohn.Forte@Sun.COM #endif	/* __lint */
91*7836SJohn.Forte@Sun.COM 
92*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
93*7836SJohn.Forte@Sun.COM }
94*7836SJohn.Forte@Sun.COM #endif
95*7836SJohn.Forte@Sun.COM 
96*7836SJohn.Forte@Sun.COM #endif	/* _SYS_FIBRE_CHANNEL_IMPL_FCAL_H */
97