4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1996-1998 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _SYS_FC4_FCAL_LINKAPP_H
28 #define _SYS_FC4_FCAL_LINKAPP_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
39 * This file contains the definitions for structures and macros
40 * for fiber channel link application payloads and data.
44 * Well Known Fiber Chaneel Addresses to reach the fabric for
48 #define MAX_FCODE_SIZE 0x2000
49 #define FS_GENERAL_MULTICAST 0xfffff7
50 #define FS_WELL_KNOWN_MULTICAST 0xfffff8
51 #define FS_HUNT_GROUP 0xfffff9
52 #define FS_MANAGEMENT_SERVER 0xfffffa
53 #define FS_TIME_SERVER 0xfffffb
54 #define FS_NAME_SERVER 0xfffffc
55 #define FS_FABRIC_CONTROLLER 0xfffffd
56 #define FS_FABRIC_F_PORT 0xfffffe
57 #define FS_BROADCAST 0xffffff
60 * Link Application Opcodes.
63 #define LA_ELS_RJT 0x01
64 #define LA_ELS_ACC 0x02
65 #define LA_ELS_PLOGI 0x03
66 #define LA_ELS_FLOGI 0x04
67 #define LA_ELS_LOGO 0x05
68 #define LA_ELS_ABTX 0x06
69 #define LA_ELS_RCS 0x07
70 #define LA_ELS_RES 0x08
71 #define LA_ELS_RSS 0x09
72 #define LA_ELS_RSI 0x0a
73 #define LA_ELS_ESTS 0x0b
74 #define LA_ELS_ESTC 0x0c
75 #define LA_ELS_ADVC 0x0d
76 #define LA_ELS_RTV 0x0e
77 #define LA_ELS_RLS 0x0f
78 #define LA_ELS_ECHO 0x10
79 #define LA_ELS_RRQ 0x12
80 #define LA_ELS_PRLI 0x20
81 #define LA_ELS_PRLO 0x21
82 #define LA_ELS_SCN 0x22
83 #define LA_ELS_TPLS 0x23
84 #define LA_ELS_GPRLO 0x24
85 #define LA_ELS_GAID 0x30
86 #define LA_ELS_FACT 0x31
87 #define LA_ELS_FDACT 0x32
88 #define LA_ELS_NACT 0x33
89 #define LA_ELS_NDACT 0x34
90 #define LA_ELS_QoSR 0x40
91 #define LA_ELS_RVCS 0x41
92 #define LA_ELS_PDISC 0x50
93 #define LA_ELS_FDISC 0x51
94 #define LA_ELS_ADISC 0x52
95 #define LA_ELS_NEW_IDENT 0xf0 /* SMCC specific */
96 #define LA_ELS_DISPLAY 0xf1 /* SMCC specific */
97 #define LA_ELS_IDENT 0x20 /* SMCC specifi, SSA compat. */
100 * Events supported by soc+ HBA driver
102 #define FCAL_INSERT_EVENT "SUNW,sf:DEVICE-INSERTION.1"
103 #define FCAL_REMOVE_EVENT "SUNW,sf:DEVICE-REMOVAL.1"
105 /* Basic Accept Payload. */
106 typedef struct la_ba_acc
{
114 typedef struct la_ba_rjt
{
122 * Basic Reject Reason Codes.
124 #define RJT_INVALID_CMD 0x01
125 #define RJT_LOGICAL_ERR 0x03
126 #define RJT_LOGICAL_BUSY 0x05
127 #define RJT_PROTOCOL_ERR 0x07
128 #define RJT_UNABLE 0x09
129 #define RJT_UNSUPPORTED 0x0B
130 #define RJT_VENDOR 0xFF
133 * Basic Reject Explanation Codes
135 #define RJT_NOEXPLANATION 0x00
136 #define RJT_INVALID_OSID 0x01
137 #define RJT_INVALID_OXID_RXID 0x03
138 #define RJT_INVALID_SEQID 0x05
139 #define RJT_ABORT_INACTIVE_SEQ 0x07
140 #define RJT_UNABLE_TO_SUPPLY 0x09
143 * Service parameters.
145 typedef struct common_service
{
152 typedef struct service_param
{
156 /* World Wide Name formats */
157 typedef union la_wwn
{
161 uint_t nport_id
: 12;
167 #define FC_WWN_SIZE 8
172 #define NAA_ID_IEEE 1
173 #define NAA_ID_IEEE_EXTENDED 2
176 typedef struct la_els_logi
{
179 common_svc_t common_service
;
181 la_wwn_t nport_ww_name
;
182 la_wwn_t node_ww_name
;
187 uchar_t reserved
[16];
188 uchar_t vendor_version_level
[16];
191 typedef la_els_logi_t la_els_logi_reply_t
;
192 #define la_logi_t la_els_logi_t
194 #define SP_F_PORT_LOGIN 0x10
196 /* Read Link Error Status */
197 typedef struct la_els_rls
{
204 /* Read Link Error Status Reply */
205 typedef struct la_els_rls_reply
{
210 uint_t loss_of_signal
;
212 uint_t invalid_transmission
;
214 } la_els_rls_reply_t
;
216 /* Logout payload. */
217 typedef struct la_els_logo
{
222 la_wwn_t nport_ww_name
;
225 /* Logout reply payload. */
226 typedef la_els_logo_t la_els_logo_reply_t
;
228 /* Reinstate recovery qualifier */
229 typedef struct la_els_rrq
{
233 uchar_t source_id
[3];
236 uchar_t assoc_header
[32];
239 /* Reinstate recovery qualifier reply */
240 typedef la_els_logo_t la_els_rrq_reply_t
;
243 typedef struct la_els_prli
{
246 ushort_t payload_length
;
247 uchar_t service_params
[16];
250 /* Process login reply */
251 typedef la_els_prli_t la_els_prli_reply_t
;
254 typedef la_els_prli_t la_els_prlo_t
;
256 /* process logout reply */
257 typedef la_els_prli_t la_els_prlo_reply_t
;
260 typedef la_els_logi_t la_els_pdisc_t
;
262 /* Port discovery reply */
263 typedef la_els_logi_reply_t la_els_pdisc_reply_t
;
265 /* Address discovery */
266 typedef struct la_els_adisc
{
275 /* Address discovery reply */
276 typedef la_els_adisc_t la_els_adisc_reply_t
;
279 typedef struct la_els_identify
{
285 typedef struct la_els_identify_reply
{
287 uchar_t fcode
[MAX_FCODE_SIZE
];
288 } la_els_identify_reply
;
290 /* Link Application Reject */
291 typedef struct la_els_rjt
{
301 * LA_RJT Reason Codes.
303 #define LA_RJT_INVALID 0x01
304 #define LA_RJT_LOGICAL_ERR 0x03
305 #define LA_RJT_LOGICAL_BUSY 0x05
306 #define LA_RJT_PROTOCOL_ERR 0x07
307 #define LA_RJT_UNABLE_TO_PERFORM 0x09
308 #define LA_RJT_NOT_SUPPORTED 0x0b
309 #define LA_RJT_VENDOR 0xff
312 * LA_RJT explanations
314 #define LA_RJT_NOEXPLANATION 0x00
315 #define LA_RJT_OPTIONS 0x01
316 #define LA_RJT_INITIATOR 0x03
317 #define LA_RJT_RECIPIENT 0x05
318 #define LA_RJT_DATA_FIELD_SIZE 0x07
319 #define LA_RJT_CONCURRENT 0x09
320 #define LA_RJT_CREDIT 0x0b
322 #define LA_RJT_INVALID_PORT_WWNAME 0x0d
323 #define LA_RJT_INVALID_NODE_WWNAME 0x0e
324 #define LA_RJT_INVALID_COMMON_SVC 0x0f
326 #define LA_RJT_INVALID_ASSOC_HEADER 0x11
327 #define LA_RJT_ASSOC_HDR_REQD 0x13
328 #define LA_RJT_INVALID_ORIG_SID 0x15
329 #define LA_RJT_INVALID_FQXID 0x17
330 #define LA_RJT_REQUEST_IN_PROGRESS 0x19
331 #define LA_RJT_INVALID_NPORT_ID 0x1f
333 #define LA_RJT_ INVALID_SEQ_ID 0x21
334 #define LA_RJT_ABT_INVALID_XID 0x23
335 #define LA_RJT_ABT_INACTIVE_XID 0x25
336 #define LA_RJT_RRQ_REQUIRED 0x27
337 #define LA_RJT_INSUFFICENT 0x29
339 #define LA_RJT_REQUESTED_DATA 0x2a
340 #define LA_RJT_REQUEST_NOT_SUPPORTED 0x2c
346 #endif /* !_SYS_FC4_FCAL_LINKAPP_H */