summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/fibre-channel/impl/fcal.h
blob: 1ebc49261b7fe28efce80065bf7fb37b8b2104ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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	_SYS_FIBRE_CHANNEL_IMPL_FCAL_H
#define	_SYS_FIBRE_CHANNEL_IMPL_FCAL_H


#include <sys/note.h>

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Loop Initilization Identifier values
 */
#define	LID_LISM	0x1101
#define	LID_LIFA	0x1102
#define	LID_LIPA	0x1103
#define	LID_LIHA	0x1104
#define	LID_LISA	0x1105
#define	LID_LIRP	0x1106
#define	LID_LILP	0x1107

/*
 * lilp_magic definitions
 */
#define	MAGIC_LISM	0x01
#define	MAGIC_LIFA	0x02
#define	MAGIC_LIPA	0x03
#define	MAGIC_LIHA	0x04
#define	MAGIC_LISA	0x05
#define	MAGIC_LIRP	0x06
#define	MAGIC_LILP	0x07

/*
 * PLDA timers (in seconds)
 */
#define	PLDA_R_A_TOV	2
#define	PLDA_RR_TOV	2

/*
 * Note that my_alpa field is of 16 bit size. The lowest significant
 * byte contains the real ALPA.  The highest significant bits are
 * used to indicate if the LBIT was set during Loop Initialization.
 *
 * If the NL_Ports on the loop participate in the LIRP and LILP dance
 * as part of Loop Initialization then the presence of an F_Port can
 * be detected by checking for the presence of AL_PA '0x00' in the AL_PA
 * list (That does not however guarantee if there is a violating NL_Port
 * trying to grab AL_PA value of '0x00').
 *
 * Some FCAs may be capable of notifying if the L_BIT was set in the
 * AL_PA bit map. The host should then perform an IMPLICIT LOGO and
 * execute a PLOGI before sending any other command.
 */
#define	LILP_LBIT_SET		0x100	/* Login Required */

typedef struct fc_lilpmap {
	uint16_t	lilp_magic;
	uint16_t	lilp_myalpa;
	uchar_t		lilp_length;
	uchar_t		lilp_alpalist[127];
} fc_lilpmap_t;

#if	!defined(__lint)
_NOTE(SCHEME_PROTECTS_DATA("unique per request", fc_lilpmap))
#endif	/* __lint */

#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_FIBRE_CHANNEL_IMPL_FCAL_H */