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