diff options
Diffstat (limited to 'include/scsi/fc/fc_els.h')
-rw-r--r-- | include/scsi/fc/fc_els.h | 816 |
1 files changed, 816 insertions, 0 deletions
diff --git a/include/scsi/fc/fc_els.h b/include/scsi/fc/fc_els.h new file mode 100644 index 000000000000..195ca014d3ce --- /dev/null +++ b/include/scsi/fc/fc_els.h | |||
@@ -0,0 +1,816 @@ | |||
1 | /* | ||
2 | * Copyright(c) 2007 Intel Corporation. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
16 | * | ||
17 | * Maintained at www.Open-FCoE.org | ||
18 | */ | ||
19 | |||
20 | #ifndef _FC_ELS_H_ | ||
21 | #define _FC_ELS_H_ | ||
22 | |||
23 | /* | ||
24 | * Fibre Channel Switch - Enhanced Link Services definitions. | ||
25 | * From T11 FC-LS Rev 1.2 June 7, 2005. | ||
26 | */ | ||
27 | |||
28 | /* | ||
29 | * ELS Command codes - byte 0 of the frame payload | ||
30 | */ | ||
31 | enum fc_els_cmd { | ||
32 | ELS_LS_RJT = 0x01, /* ESL reject */ | ||
33 | ELS_LS_ACC = 0x02, /* ESL Accept */ | ||
34 | ELS_PLOGI = 0x03, /* N_Port login */ | ||
35 | ELS_FLOGI = 0x04, /* F_Port login */ | ||
36 | ELS_LOGO = 0x05, /* Logout */ | ||
37 | ELS_ABTX = 0x06, /* Abort exchange - obsolete */ | ||
38 | ELS_RCS = 0x07, /* read connection status */ | ||
39 | ELS_RES = 0x08, /* read exchange status block */ | ||
40 | ELS_RSS = 0x09, /* read sequence status block */ | ||
41 | ELS_RSI = 0x0a, /* read sequence initiative */ | ||
42 | ELS_ESTS = 0x0b, /* establish streaming */ | ||
43 | ELS_ESTC = 0x0c, /* estimate credit */ | ||
44 | ELS_ADVC = 0x0d, /* advise credit */ | ||
45 | ELS_RTV = 0x0e, /* read timeout value */ | ||
46 | ELS_RLS = 0x0f, /* read link error status block */ | ||
47 | ELS_ECHO = 0x10, /* echo */ | ||
48 | ELS_TEST = 0x11, /* test */ | ||
49 | ELS_RRQ = 0x12, /* reinstate recovery qualifier */ | ||
50 | ELS_REC = 0x13, /* read exchange concise */ | ||
51 | ELS_SRR = 0x14, /* sequence retransmission request */ | ||
52 | ELS_PRLI = 0x20, /* process login */ | ||
53 | ELS_PRLO = 0x21, /* process logout */ | ||
54 | ELS_SCN = 0x22, /* state change notification */ | ||
55 | ELS_TPLS = 0x23, /* test process login state */ | ||
56 | ELS_TPRLO = 0x24, /* third party process logout */ | ||
57 | ELS_LCLM = 0x25, /* login control list mgmt (obs) */ | ||
58 | ELS_GAID = 0x30, /* get alias_ID */ | ||
59 | ELS_FACT = 0x31, /* fabric activate alias_id */ | ||
60 | ELS_FDACDT = 0x32, /* fabric deactivate alias_id */ | ||
61 | ELS_NACT = 0x33, /* N-port activate alias_id */ | ||
62 | ELS_NDACT = 0x34, /* N-port deactivate alias_id */ | ||
63 | ELS_QOSR = 0x40, /* quality of service request */ | ||
64 | ELS_RVCS = 0x41, /* read virtual circuit status */ | ||
65 | ELS_PDISC = 0x50, /* discover N_port service params */ | ||
66 | ELS_FDISC = 0x51, /* discover F_port service params */ | ||
67 | ELS_ADISC = 0x52, /* discover address */ | ||
68 | ELS_RNC = 0x53, /* report node cap (obs) */ | ||
69 | ELS_FARP_REQ = 0x54, /* FC ARP request */ | ||
70 | ELS_FARP_REPL = 0x55, /* FC ARP reply */ | ||
71 | ELS_RPS = 0x56, /* read port status block */ | ||
72 | ELS_RPL = 0x57, /* read port list */ | ||
73 | ELS_RPBC = 0x58, /* read port buffer condition */ | ||
74 | ELS_FAN = 0x60, /* fabric address notification */ | ||
75 | ELS_RSCN = 0x61, /* registered state change notification */ | ||
76 | ELS_SCR = 0x62, /* state change registration */ | ||
77 | ELS_RNFT = 0x63, /* report node FC-4 types */ | ||
78 | ELS_CSR = 0x68, /* clock synch. request */ | ||
79 | ELS_CSU = 0x69, /* clock synch. update */ | ||
80 | ELS_LINIT = 0x70, /* loop initialize */ | ||
81 | ELS_LSTS = 0x72, /* loop status */ | ||
82 | ELS_RNID = 0x78, /* request node ID data */ | ||
83 | ELS_RLIR = 0x79, /* registered link incident report */ | ||
84 | ELS_LIRR = 0x7a, /* link incident record registration */ | ||
85 | ELS_SRL = 0x7b, /* scan remote loop */ | ||
86 | ELS_SBRP = 0x7c, /* set bit-error reporting params */ | ||
87 | ELS_RPSC = 0x7d, /* report speed capabilities */ | ||
88 | ELS_QSA = 0x7e, /* query security attributes */ | ||
89 | ELS_EVFP = 0x7f, /* exchange virt. fabrics params */ | ||
90 | ELS_LKA = 0x80, /* link keep-alive */ | ||
91 | ELS_AUTH_ELS = 0x90, /* authentication ELS */ | ||
92 | }; | ||
93 | |||
94 | /* | ||
95 | * Initializer useful for decoding table. | ||
96 | * Please keep this in sync with the above definitions. | ||
97 | */ | ||
98 | #define FC_ELS_CMDS_INIT { \ | ||
99 | [ELS_LS_RJT] = "LS_RJT", \ | ||
100 | [ELS_LS_ACC] = "LS_ACC", \ | ||
101 | [ELS_PLOGI] = "PLOGI", \ | ||
102 | [ELS_FLOGI] = "FLOGI", \ | ||
103 | [ELS_LOGO] = "LOGO", \ | ||
104 | [ELS_ABTX] = "ABTX", \ | ||
105 | [ELS_RCS] = "RCS", \ | ||
106 | [ELS_RES] = "RES", \ | ||
107 | [ELS_RSS] = "RSS", \ | ||
108 | [ELS_RSI] = "RSI", \ | ||
109 | [ELS_ESTS] = "ESTS", \ | ||
110 | [ELS_ESTC] = "ESTC", \ | ||
111 | [ELS_ADVC] = "ADVC", \ | ||
112 | [ELS_RTV] = "RTV", \ | ||
113 | [ELS_RLS] = "RLS", \ | ||
114 | [ELS_ECHO] = "ECHO", \ | ||
115 | [ELS_TEST] = "TEST", \ | ||
116 | [ELS_RRQ] = "RRQ", \ | ||
117 | [ELS_REC] = "REC", \ | ||
118 | [ELS_SRR] = "SRR", \ | ||
119 | [ELS_PRLI] = "PRLI", \ | ||
120 | [ELS_PRLO] = "PRLO", \ | ||
121 | [ELS_SCN] = "SCN", \ | ||
122 | [ELS_TPLS] = "TPLS", \ | ||
123 | [ELS_TPRLO] = "TPRLO", \ | ||
124 | [ELS_LCLM] = "LCLM", \ | ||
125 | [ELS_GAID] = "GAID", \ | ||
126 | [ELS_FACT] = "FACT", \ | ||
127 | [ELS_FDACDT] = "FDACDT", \ | ||
128 | [ELS_NACT] = "NACT", \ | ||
129 | [ELS_NDACT] = "NDACT", \ | ||
130 | [ELS_QOSR] = "QOSR", \ | ||
131 | [ELS_RVCS] = "RVCS", \ | ||
132 | [ELS_PDISC] = "PDISC", \ | ||
133 | [ELS_FDISC] = "FDISC", \ | ||
134 | [ELS_ADISC] = "ADISC", \ | ||
135 | [ELS_RNC] = "RNC", \ | ||
136 | [ELS_FARP_REQ] = "FARP_REQ", \ | ||
137 | [ELS_FARP_REPL] = "FARP_REPL", \ | ||
138 | [ELS_RPS] = "RPS", \ | ||
139 | [ELS_RPL] = "RPL", \ | ||
140 | [ELS_RPBC] = "RPBC", \ | ||
141 | [ELS_FAN] = "FAN", \ | ||
142 | [ELS_RSCN] = "RSCN", \ | ||
143 | [ELS_SCR] = "SCR", \ | ||
144 | [ELS_RNFT] = "RNFT", \ | ||
145 | [ELS_CSR] = "CSR", \ | ||
146 | [ELS_CSU] = "CSU", \ | ||
147 | [ELS_LINIT] = "LINIT", \ | ||
148 | [ELS_LSTS] = "LSTS", \ | ||
149 | [ELS_RNID] = "RNID", \ | ||
150 | [ELS_RLIR] = "RLIR", \ | ||
151 | [ELS_LIRR] = "LIRR", \ | ||
152 | [ELS_SRL] = "SRL", \ | ||
153 | [ELS_SBRP] = "SBRP", \ | ||
154 | [ELS_RPSC] = "RPSC", \ | ||
155 | [ELS_QSA] = "QSA", \ | ||
156 | [ELS_EVFP] = "EVFP", \ | ||
157 | [ELS_LKA] = "LKA", \ | ||
158 | [ELS_AUTH_ELS] = "AUTH_ELS", \ | ||
159 | } | ||
160 | |||
161 | /* | ||
162 | * LS_ACC payload. | ||
163 | */ | ||
164 | struct fc_els_ls_acc { | ||
165 | __u8 la_cmd; /* command code ELS_LS_ACC */ | ||
166 | __u8 la_resv[3]; /* reserved */ | ||
167 | }; | ||
168 | |||
169 | /* | ||
170 | * ELS reject payload. | ||
171 | */ | ||
172 | struct fc_els_ls_rjt { | ||
173 | __u8 er_cmd; /* command code ELS_LS_RJT */ | ||
174 | __u8 er_resv[4]; /* reserved must be zero */ | ||
175 | __u8 er_reason; /* reason (enum fc_els_rjt_reason below) */ | ||
176 | __u8 er_explan; /* explanation (enum fc_els_rjt_explan below) */ | ||
177 | __u8 er_vendor; /* vendor specific code */ | ||
178 | }; | ||
179 | |||
180 | /* | ||
181 | * ELS reject reason codes (er_reason). | ||
182 | */ | ||
183 | enum fc_els_rjt_reason { | ||
184 | ELS_RJT_NONE = 0, /* no reject - not to be sent */ | ||
185 | ELS_RJT_INVAL = 0x01, /* invalid ELS command code */ | ||
186 | ELS_RJT_LOGIC = 0x03, /* logical error */ | ||
187 | ELS_RJT_BUSY = 0x05, /* logical busy */ | ||
188 | ELS_RJT_PROT = 0x07, /* protocol error */ | ||
189 | ELS_RJT_UNAB = 0x09, /* unable to perform command request */ | ||
190 | ELS_RJT_UNSUP = 0x0b, /* command not supported */ | ||
191 | ELS_RJT_INPROG = 0x0e, /* command already in progress */ | ||
192 | ELS_RJT_VENDOR = 0xff, /* vendor specific error */ | ||
193 | }; | ||
194 | |||
195 | |||
196 | /* | ||
197 | * reason code explanation (er_explan). | ||
198 | */ | ||
199 | enum fc_els_rjt_explan { | ||
200 | ELS_EXPL_NONE = 0x00, /* No additional explanation */ | ||
201 | ELS_EXPL_SPP_OPT_ERR = 0x01, /* service parameter error - options */ | ||
202 | ELS_EXPL_SPP_ICTL_ERR = 0x03, /* service parm error - initiator ctl */ | ||
203 | ELS_EXPL_AH = 0x11, /* invalid association header */ | ||
204 | ELS_EXPL_AH_REQ = 0x13, /* association_header required */ | ||
205 | ELS_EXPL_SID = 0x15, /* invalid originator S_ID */ | ||
206 | ELS_EXPL_OXID_RXID = 0x17, /* invalid OX_ID-RX_ID combination */ | ||
207 | ELS_EXPL_INPROG = 0x19, /* Request already in progress */ | ||
208 | ELS_EXPL_PLOGI_REQD = 0x1e, /* N_Port login required */ | ||
209 | ELS_EXPL_INSUF_RES = 0x29, /* insufficient resources */ | ||
210 | ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */ | ||
211 | ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */ | ||
212 | ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */ | ||
213 | /* TBD - above definitions incomplete */ | ||
214 | }; | ||
215 | |||
216 | /* | ||
217 | * Common service parameters (N ports). | ||
218 | */ | ||
219 | struct fc_els_csp { | ||
220 | __u8 sp_hi_ver; /* highest version supported (obs.) */ | ||
221 | __u8 sp_lo_ver; /* highest version supported (obs.) */ | ||
222 | __be16 sp_bb_cred; /* buffer-to-buffer credits */ | ||
223 | __be16 sp_features; /* common feature flags */ | ||
224 | __be16 sp_bb_data; /* b-b state number and data field sz */ | ||
225 | union { | ||
226 | struct { | ||
227 | __be16 _sp_tot_seq; /* total concurrent sequences */ | ||
228 | __be16 _sp_rel_off; /* rel. offset by info cat */ | ||
229 | } sp_plogi; | ||
230 | struct { | ||
231 | __be32 _sp_r_a_tov; /* resource alloc. timeout msec */ | ||
232 | } sp_flogi_acc; | ||
233 | } sp_u; | ||
234 | __be32 sp_e_d_tov; /* error detect timeout value */ | ||
235 | }; | ||
236 | #define sp_tot_seq sp_u.sp_plogi._sp_tot_seq | ||
237 | #define sp_rel_off sp_u.sp_plogi._sp_rel_off | ||
238 | #define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov | ||
239 | |||
240 | #define FC_SP_BB_DATA_MASK 0xfff /* mask for data field size in sp_bb_data */ | ||
241 | |||
242 | /* | ||
243 | * Minimum and maximum values for max data field size in service parameters. | ||
244 | */ | ||
245 | #define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD | ||
246 | #define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD | ||
247 | |||
248 | /* | ||
249 | * sp_features | ||
250 | */ | ||
251 | #define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel. off. */ | ||
252 | #define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */ | ||
253 | #define FC_SP_FT_RAND 0x4000 /* random relative offset */ | ||
254 | #define FC_SP_FT_VAL 0x2000 /* valid vendor version level */ | ||
255 | #define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */ | ||
256 | #define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */ | ||
257 | #define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */ | ||
258 | #define FC_SP_FT_MCAST 0x0200 /* multicast */ | ||
259 | #define FC_SP_FT_BCAST 0x0100 /* broadcast */ | ||
260 | #define FC_SP_FT_HUNT 0x0080 /* hunt group */ | ||
261 | #define FC_SP_FT_SIMP 0x0040 /* dedicated simplex */ | ||
262 | #define FC_SP_FT_SEC 0x0020 /* reserved for security */ | ||
263 | #define FC_SP_FT_CSYN 0x0010 /* clock synch. supported */ | ||
264 | #define FC_SP_FT_RTTOV 0x0008 /* R_T_TOV value 100 uS, else 100 mS */ | ||
265 | #define FC_SP_FT_HALF 0x0004 /* dynamic half duplex */ | ||
266 | #define FC_SP_FT_SEQC 0x0002 /* SEQ_CNT */ | ||
267 | #define FC_SP_FT_PAYL 0x0001 /* FLOGI payload length 256, else 116 */ | ||
268 | |||
269 | /* | ||
270 | * Class-specific service parameters. | ||
271 | */ | ||
272 | struct fc_els_cssp { | ||
273 | __be16 cp_class; /* class flags */ | ||
274 | __be16 cp_init; /* initiator flags */ | ||
275 | __be16 cp_recip; /* recipient flags */ | ||
276 | __be16 cp_rdfs; /* receive data field size */ | ||
277 | __be16 cp_con_seq; /* concurrent sequences */ | ||
278 | __be16 cp_ee_cred; /* N-port end-to-end credit */ | ||
279 | __u8 cp_resv1; /* reserved */ | ||
280 | __u8 cp_open_seq; /* open sequences per exchange */ | ||
281 | __u8 _cp_resv2[2]; /* reserved */ | ||
282 | }; | ||
283 | |||
284 | /* | ||
285 | * cp_class flags. | ||
286 | */ | ||
287 | #define FC_CPC_VALID 0x8000 /* class valid */ | ||
288 | #define FC_CPC_IMIX 0x4000 /* intermix mode */ | ||
289 | #define FC_CPC_SEQ 0x0800 /* sequential delivery */ | ||
290 | #define FC_CPC_CAMP 0x0200 /* camp-on */ | ||
291 | #define FC_CPC_PRI 0x0080 /* priority */ | ||
292 | |||
293 | /* | ||
294 | * cp_init flags. | ||
295 | * (TBD: not all flags defined here). | ||
296 | */ | ||
297 | #define FC_CPI_CSYN 0x0010 /* clock synch. capable */ | ||
298 | |||
299 | /* | ||
300 | * cp_recip flags. | ||
301 | */ | ||
302 | #define FC_CPR_CSYN 0x0008 /* clock synch. capable */ | ||
303 | |||
304 | /* | ||
305 | * NFC_ELS_FLOGI: Fabric login request. | ||
306 | * NFC_ELS_PLOGI: Port login request (same format). | ||
307 | */ | ||
308 | struct fc_els_flogi { | ||
309 | __u8 fl_cmd; /* command */ | ||
310 | __u8 _fl_resvd[3]; /* must be zero */ | ||
311 | struct fc_els_csp fl_csp; /* common service parameters */ | ||
312 | __be64 fl_wwpn; /* port name */ | ||
313 | __be64 fl_wwnn; /* node name */ | ||
314 | struct fc_els_cssp fl_cssp[4]; /* class 1-4 service parameters */ | ||
315 | __u8 fl_vend[16]; /* vendor version level */ | ||
316 | } __attribute__((__packed__)); | ||
317 | |||
318 | /* | ||
319 | * Process login service parameter page. | ||
320 | */ | ||
321 | struct fc_els_spp { | ||
322 | __u8 spp_type; /* type code or common service params */ | ||
323 | __u8 spp_type_ext; /* type code extension */ | ||
324 | __u8 spp_flags; | ||
325 | __u8 _spp_resvd; | ||
326 | __be32 spp_orig_pa; /* originator process associator */ | ||
327 | __be32 spp_resp_pa; /* responder process associator */ | ||
328 | __be32 spp_params; /* service parameters */ | ||
329 | }; | ||
330 | |||
331 | /* | ||
332 | * spp_flags. | ||
333 | */ | ||
334 | #define FC_SPP_OPA_VAL 0x80 /* originator proc. assoc. valid */ | ||
335 | #define FC_SPP_RPA_VAL 0x40 /* responder proc. assoc. valid */ | ||
336 | #define FC_SPP_EST_IMG_PAIR 0x20 /* establish image pair */ | ||
337 | #define FC_SPP_RESP_MASK 0x0f /* mask for response code (below) */ | ||
338 | |||
339 | /* | ||
340 | * SPP response code in spp_flags - lower 4 bits. | ||
341 | */ | ||
342 | enum fc_els_spp_resp { | ||
343 | FC_SPP_RESP_ACK = 1, /* request executed */ | ||
344 | FC_SPP_RESP_RES = 2, /* unable due to lack of resources */ | ||
345 | FC_SPP_RESP_INIT = 3, /* initialization not complete */ | ||
346 | FC_SPP_RESP_NO_PA = 4, /* unknown process associator */ | ||
347 | FC_SPP_RESP_CONF = 5, /* configuration precludes image pair */ | ||
348 | FC_SPP_RESP_COND = 6, /* request completed conditionally */ | ||
349 | FC_SPP_RESP_MULT = 7, /* unable to handle multiple SPPs */ | ||
350 | FC_SPP_RESP_INVL = 8, /* SPP is invalid */ | ||
351 | }; | ||
352 | |||
353 | /* | ||
354 | * ELS_RRQ - Reinstate Recovery Qualifier | ||
355 | */ | ||
356 | struct fc_els_rrq { | ||
357 | __u8 rrq_cmd; /* command (0x12) */ | ||
358 | __u8 rrq_zero[3]; /* specified as zero - part of cmd */ | ||
359 | __u8 rrq_resvd; /* reserved */ | ||
360 | __u8 rrq_s_id[3]; /* originator FID */ | ||
361 | __be16 rrq_ox_id; /* originator exchange ID */ | ||
362 | __be16 rrq_rx_id; /* responders exchange ID */ | ||
363 | }; | ||
364 | |||
365 | /* | ||
366 | * ELS_REC - Read exchange concise. | ||
367 | */ | ||
368 | struct fc_els_rec { | ||
369 | __u8 rec_cmd; /* command (0x13) */ | ||
370 | __u8 rec_zero[3]; /* specified as zero - part of cmd */ | ||
371 | __u8 rec_resvd; /* reserved */ | ||
372 | __u8 rec_s_id[3]; /* originator FID */ | ||
373 | __be16 rec_ox_id; /* originator exchange ID */ | ||
374 | __be16 rec_rx_id; /* responders exchange ID */ | ||
375 | }; | ||
376 | |||
377 | /* | ||
378 | * ELS_REC LS_ACC payload. | ||
379 | */ | ||
380 | struct fc_els_rec_acc { | ||
381 | __u8 reca_cmd; /* accept (0x02) */ | ||
382 | __u8 reca_zero[3]; /* specified as zero - part of cmd */ | ||
383 | __be16 reca_ox_id; /* originator exchange ID */ | ||
384 | __be16 reca_rx_id; /* responders exchange ID */ | ||
385 | __u8 reca_resvd1; /* reserved */ | ||
386 | __u8 reca_ofid[3]; /* originator FID */ | ||
387 | __u8 reca_resvd2; /* reserved */ | ||
388 | __u8 reca_rfid[3]; /* responder FID */ | ||
389 | __be32 reca_fc4value; /* FC4 value */ | ||
390 | __be32 reca_e_stat; /* ESB (exchange status block) status */ | ||
391 | }; | ||
392 | |||
393 | /* | ||
394 | * ELS_PRLI - Process login request and response. | ||
395 | */ | ||
396 | struct fc_els_prli { | ||
397 | __u8 prli_cmd; /* command */ | ||
398 | __u8 prli_spp_len; /* length of each serv. parm. page */ | ||
399 | __be16 prli_len; /* length of entire payload */ | ||
400 | /* service parameter pages follow */ | ||
401 | }; | ||
402 | |||
403 | /* | ||
404 | * ELS_ADISC payload | ||
405 | */ | ||
406 | struct fc_els_adisc { | ||
407 | __u8 adisc_cmd; | ||
408 | __u8 adisc_resv[3]; | ||
409 | __u8 adisc_resv1; | ||
410 | __u8 adisc_hard_addr[3]; | ||
411 | __be64 adisc_wwpn; | ||
412 | __be64 adisc_wwnn; | ||
413 | __u8 adisc_resv2; | ||
414 | __u8 adisc_port_id[3]; | ||
415 | } __attribute__((__packed__)); | ||
416 | |||
417 | /* | ||
418 | * ELS_LOGO - process or fabric logout. | ||
419 | */ | ||
420 | struct fc_els_logo { | ||
421 | __u8 fl_cmd; /* command code */ | ||
422 | __u8 fl_zero[3]; /* specified as zero - part of cmd */ | ||
423 | __u8 fl_resvd; /* reserved */ | ||
424 | __u8 fl_n_port_id[3];/* N port ID */ | ||
425 | __be64 fl_n_port_wwn; /* port name */ | ||
426 | }; | ||
427 | |||
428 | /* | ||
429 | * ELS_RTV - read timeout value. | ||
430 | */ | ||
431 | struct fc_els_rtv { | ||
432 | __u8 rtv_cmd; /* command code 0x0e */ | ||
433 | __u8 rtv_zero[3]; /* specified as zero - part of cmd */ | ||
434 | }; | ||
435 | |||
436 | /* | ||
437 | * LS_ACC for ELS_RTV - read timeout value. | ||
438 | */ | ||
439 | struct fc_els_rtv_acc { | ||
440 | __u8 rtv_cmd; /* command code 0x02 */ | ||
441 | __u8 rtv_zero[3]; /* specified as zero - part of cmd */ | ||
442 | __be32 rtv_r_a_tov; /* resource allocation timeout value */ | ||
443 | __be32 rtv_e_d_tov; /* error detection timeout value */ | ||
444 | __be32 rtv_toq; /* timeout qualifier (see below) */ | ||
445 | }; | ||
446 | |||
447 | /* | ||
448 | * rtv_toq bits. | ||
449 | */ | ||
450 | #define FC_ELS_RTV_EDRES (1 << 26) /* E_D_TOV resolution is nS else mS */ | ||
451 | #define FC_ELS_RTV_RTTOV (1 << 19) /* R_T_TOV is 100 uS else 100 mS */ | ||
452 | |||
453 | /* | ||
454 | * ELS_SCR - state change registration payload. | ||
455 | */ | ||
456 | struct fc_els_scr { | ||
457 | __u8 scr_cmd; /* command code */ | ||
458 | __u8 scr_resv[6]; /* reserved */ | ||
459 | __u8 scr_reg_func; /* registration function (see below) */ | ||
460 | }; | ||
461 | |||
462 | enum fc_els_scr_func { | ||
463 | ELS_SCRF_FAB = 1, /* fabric-detected registration */ | ||
464 | ELS_SCRF_NPORT = 2, /* Nx_Port-detected registration */ | ||
465 | ELS_SCRF_FULL = 3, /* full registration */ | ||
466 | ELS_SCRF_CLEAR = 255, /* remove any current registrations */ | ||
467 | }; | ||
468 | |||
469 | /* | ||
470 | * ELS_RSCN - registered state change notification payload. | ||
471 | */ | ||
472 | struct fc_els_rscn { | ||
473 | __u8 rscn_cmd; /* RSCN opcode (0x61) */ | ||
474 | __u8 rscn_page_len; /* page length (4) */ | ||
475 | __be16 rscn_plen; /* payload length including this word */ | ||
476 | |||
477 | /* followed by 4-byte generic affected Port_ID pages */ | ||
478 | }; | ||
479 | |||
480 | struct fc_els_rscn_page { | ||
481 | __u8 rscn_page_flags; /* event and address format */ | ||
482 | __u8 rscn_fid[3]; /* fabric ID */ | ||
483 | }; | ||
484 | |||
485 | #define ELS_RSCN_EV_QUAL_BIT 2 /* shift count for event qualifier */ | ||
486 | #define ELS_RSCN_EV_QUAL_MASK 0xf /* mask for event qualifier */ | ||
487 | #define ELS_RSCN_ADDR_FMT_BIT 0 /* shift count for address format */ | ||
488 | #define ELS_RSCN_ADDR_FMT_MASK 0x3 /* mask for address format */ | ||
489 | |||
490 | enum fc_els_rscn_ev_qual { | ||
491 | ELS_EV_QUAL_NONE = 0, /* unspecified */ | ||
492 | ELS_EV_QUAL_NS_OBJ = 1, /* changed name server object */ | ||
493 | ELS_EV_QUAL_PORT_ATTR = 2, /* changed port attribute */ | ||
494 | ELS_EV_QUAL_SERV_OBJ = 3, /* changed service object */ | ||
495 | ELS_EV_QUAL_SW_CONFIG = 4, /* changed switch configuration */ | ||
496 | ELS_EV_QUAL_REM_OBJ = 5, /* removed object */ | ||
497 | }; | ||
498 | |||
499 | enum fc_els_rscn_addr_fmt { | ||
500 | ELS_ADDR_FMT_PORT = 0, /* rscn_fid is a port address */ | ||
501 | ELS_ADDR_FMT_AREA = 1, /* rscn_fid is a area address */ | ||
502 | ELS_ADDR_FMT_DOM = 2, /* rscn_fid is a domain address */ | ||
503 | ELS_ADDR_FMT_FAB = 3, /* anything on fabric may have changed */ | ||
504 | }; | ||
505 | |||
506 | /* | ||
507 | * ELS_RNID - request Node ID. | ||
508 | */ | ||
509 | struct fc_els_rnid { | ||
510 | __u8 rnid_cmd; /* RNID opcode (0x78) */ | ||
511 | __u8 rnid_resv[3]; /* reserved */ | ||
512 | __u8 rnid_fmt; /* data format */ | ||
513 | __u8 rnid_resv2[3]; /* reserved */ | ||
514 | }; | ||
515 | |||
516 | /* | ||
517 | * Node Identification Data formats (rnid_fmt) | ||
518 | */ | ||
519 | enum fc_els_rnid_fmt { | ||
520 | ELS_RNIDF_NONE = 0, /* no specific identification data */ | ||
521 | ELS_RNIDF_GEN = 0xdf, /* general topology discovery format */ | ||
522 | }; | ||
523 | |||
524 | /* | ||
525 | * ELS_RNID response. | ||
526 | */ | ||
527 | struct fc_els_rnid_resp { | ||
528 | __u8 rnid_cmd; /* response code (LS_ACC) */ | ||
529 | __u8 rnid_resv[3]; /* reserved */ | ||
530 | __u8 rnid_fmt; /* data format */ | ||
531 | __u8 rnid_cid_len; /* common ID data length */ | ||
532 | __u8 rnid_resv2; /* reserved */ | ||
533 | __u8 rnid_sid_len; /* specific ID data length */ | ||
534 | }; | ||
535 | |||
536 | struct fc_els_rnid_cid { | ||
537 | __be64 rnid_wwpn; /* N port name */ | ||
538 | __be64 rnid_wwnn; /* node name */ | ||
539 | }; | ||
540 | |||
541 | struct fc_els_rnid_gen { | ||
542 | __u8 rnid_vend_id[16]; /* vendor-unique ID */ | ||
543 | __be32 rnid_atype; /* associated type (see below) */ | ||
544 | __be32 rnid_phys_port; /* physical port number */ | ||
545 | __be32 rnid_att_nodes; /* number of attached nodes */ | ||
546 | __u8 rnid_node_mgmt; /* node management (see below) */ | ||
547 | __u8 rnid_ip_ver; /* IP version (see below) */ | ||
548 | __be16 rnid_prot_port; /* UDP / TCP port number */ | ||
549 | __be32 rnid_ip_addr[4]; /* IP address */ | ||
550 | __u8 rnid_resvd[2]; /* reserved */ | ||
551 | __be16 rnid_vend_spec; /* vendor-specific field */ | ||
552 | }; | ||
553 | |||
554 | enum fc_els_rnid_atype { | ||
555 | ELS_RNIDA_UNK = 0x01, /* unknown */ | ||
556 | ELS_RNIDA_OTHER = 0x02, /* none of the following */ | ||
557 | ELS_RNIDA_HUB = 0x03, | ||
558 | ELS_RNIDA_SWITCH = 0x04, | ||
559 | ELS_RNIDA_GATEWAY = 0x05, | ||
560 | ELS_RNIDA_CONV = 0x06, /* Obsolete, do not use this value */ | ||
561 | ELS_RNIDA_HBA = 0x07, /* Obsolete, do not use this value */ | ||
562 | ELS_RNIDA_PROXY = 0x08, /* Obsolete, do not use this value */ | ||
563 | ELS_RNIDA_STORAGE = 0x09, | ||
564 | ELS_RNIDA_HOST = 0x0a, | ||
565 | ELS_RNIDA_SUBSYS = 0x0b, /* storage subsystem (e.g., RAID) */ | ||
566 | ELS_RNIDA_ACCESS = 0x0e, /* access device (e.g. media changer) */ | ||
567 | ELS_RNIDA_NAS = 0x11, /* NAS server */ | ||
568 | ELS_RNIDA_BRIDGE = 0x12, /* bridge */ | ||
569 | ELS_RNIDA_VIRT = 0x13, /* virtualization device */ | ||
570 | ELS_RNIDA_MF = 0xff, /* multifunction device (bits below) */ | ||
571 | ELS_RNIDA_MF_HUB = 1UL << 31, /* hub */ | ||
572 | ELS_RNIDA_MF_SW = 1UL << 30, /* switch */ | ||
573 | ELS_RNIDA_MF_GW = 1UL << 29, /* gateway */ | ||
574 | ELS_RNIDA_MF_ST = 1UL << 28, /* storage */ | ||
575 | ELS_RNIDA_MF_HOST = 1UL << 27, /* host */ | ||
576 | ELS_RNIDA_MF_SUB = 1UL << 26, /* storage subsystem */ | ||
577 | ELS_RNIDA_MF_ACC = 1UL << 25, /* storage access dev */ | ||
578 | ELS_RNIDA_MF_WDM = 1UL << 24, /* wavelength division mux */ | ||
579 | ELS_RNIDA_MF_NAS = 1UL << 23, /* NAS server */ | ||
580 | ELS_RNIDA_MF_BR = 1UL << 22, /* bridge */ | ||
581 | ELS_RNIDA_MF_VIRT = 1UL << 21, /* virtualization device */ | ||
582 | }; | ||
583 | |||
584 | enum fc_els_rnid_mgmt { | ||
585 | ELS_RNIDM_SNMP = 0, | ||
586 | ELS_RNIDM_TELNET = 1, | ||
587 | ELS_RNIDM_HTTP = 2, | ||
588 | ELS_RNIDM_HTTPS = 3, | ||
589 | ELS_RNIDM_XML = 4, /* HTTP + XML */ | ||
590 | }; | ||
591 | |||
592 | enum fc_els_rnid_ipver { | ||
593 | ELS_RNIDIP_NONE = 0, /* no IP support or node mgmt. */ | ||
594 | ELS_RNIDIP_V4 = 1, /* IPv4 */ | ||
595 | ELS_RNIDIP_V6 = 2, /* IPv6 */ | ||
596 | }; | ||
597 | |||
598 | /* | ||
599 | * ELS RPL - Read Port List. | ||
600 | */ | ||
601 | struct fc_els_rpl { | ||
602 | __u8 rpl_cmd; /* command */ | ||
603 | __u8 rpl_resv[5]; /* reserved - must be zero */ | ||
604 | __be16 rpl_max_size; /* maximum response size or zero */ | ||
605 | __u8 rpl_resv1; /* reserved - must be zero */ | ||
606 | __u8 rpl_index[3]; /* starting index */ | ||
607 | }; | ||
608 | |||
609 | /* | ||
610 | * Port number block in RPL response. | ||
611 | */ | ||
612 | struct fc_els_pnb { | ||
613 | __be32 pnb_phys_pn; /* physical port number */ | ||
614 | __u8 pnb_resv; /* reserved */ | ||
615 | __u8 pnb_port_id[3]; /* port ID */ | ||
616 | __be64 pnb_wwpn; /* port name */ | ||
617 | }; | ||
618 | |||
619 | /* | ||
620 | * RPL LS_ACC response. | ||
621 | */ | ||
622 | struct fc_els_rpl_resp { | ||
623 | __u8 rpl_cmd; /* ELS_LS_ACC */ | ||
624 | __u8 rpl_resv1; /* reserved - must be zero */ | ||
625 | __be16 rpl_plen; /* payload length */ | ||
626 | __u8 rpl_resv2; /* reserved - must be zero */ | ||
627 | __u8 rpl_llen[3]; /* list length */ | ||
628 | __u8 rpl_resv3; /* reserved - must be zero */ | ||
629 | __u8 rpl_index[3]; /* starting index */ | ||
630 | struct fc_els_pnb rpl_pnb[1]; /* variable number of PNBs */ | ||
631 | }; | ||
632 | |||
633 | /* | ||
634 | * Link Error Status Block. | ||
635 | */ | ||
636 | struct fc_els_lesb { | ||
637 | __be32 lesb_link_fail; /* link failure count */ | ||
638 | __be32 lesb_sync_loss; /* loss of synchronization count */ | ||
639 | __be32 lesb_sig_loss; /* loss of signal count */ | ||
640 | __be32 lesb_prim_err; /* primitive sequence error count */ | ||
641 | __be32 lesb_inv_word; /* invalid transmission word count */ | ||
642 | __be32 lesb_inv_crc; /* invalid CRC count */ | ||
643 | }; | ||
644 | |||
645 | /* | ||
646 | * ELS RPS - Read Port Status Block request. | ||
647 | */ | ||
648 | struct fc_els_rps { | ||
649 | __u8 rps_cmd; /* command */ | ||
650 | __u8 rps_resv[2]; /* reserved - must be zero */ | ||
651 | __u8 rps_flag; /* flag - see below */ | ||
652 | __be64 rps_port_spec; /* port selection */ | ||
653 | }; | ||
654 | |||
655 | enum fc_els_rps_flag { | ||
656 | FC_ELS_RPS_DID = 0x00, /* port identified by D_ID of req. */ | ||
657 | FC_ELS_RPS_PPN = 0x01, /* port_spec is physical port number */ | ||
658 | FC_ELS_RPS_WWPN = 0x02, /* port_spec is port WWN */ | ||
659 | }; | ||
660 | |||
661 | /* | ||
662 | * ELS RPS LS_ACC response. | ||
663 | */ | ||
664 | struct fc_els_rps_resp { | ||
665 | __u8 rps_cmd; /* command - LS_ACC */ | ||
666 | __u8 rps_resv[2]; /* reserved - must be zero */ | ||
667 | __u8 rps_flag; /* flag - see below */ | ||
668 | __u8 rps_resv2[2]; /* reserved */ | ||
669 | __be16 rps_status; /* port status - see below */ | ||
670 | struct fc_els_lesb rps_lesb; /* link error status block */ | ||
671 | }; | ||
672 | |||
673 | enum fc_els_rps_resp_flag { | ||
674 | FC_ELS_RPS_LPEV = 0x01, /* L_port extension valid */ | ||
675 | }; | ||
676 | |||
677 | enum fc_els_rps_resp_status { | ||
678 | FC_ELS_RPS_PTP = 1 << 5, /* point-to-point connection */ | ||
679 | FC_ELS_RPS_LOOP = 1 << 4, /* loop mode */ | ||
680 | FC_ELS_RPS_FAB = 1 << 3, /* fabric present */ | ||
681 | FC_ELS_RPS_NO_SIG = 1 << 2, /* loss of signal */ | ||
682 | FC_ELS_RPS_NO_SYNC = 1 << 1, /* loss of synchronization */ | ||
683 | FC_ELS_RPS_RESET = 1 << 0, /* in link reset protocol */ | ||
684 | }; | ||
685 | |||
686 | /* | ||
687 | * ELS LIRR - Link Incident Record Registration request. | ||
688 | */ | ||
689 | struct fc_els_lirr { | ||
690 | __u8 lirr_cmd; /* command */ | ||
691 | __u8 lirr_resv[3]; /* reserved - must be zero */ | ||
692 | __u8 lirr_func; /* registration function */ | ||
693 | __u8 lirr_fmt; /* FC-4 type of RLIR requested */ | ||
694 | __u8 lirr_resv2[2]; /* reserved - must be zero */ | ||
695 | }; | ||
696 | |||
697 | enum fc_els_lirr_func { | ||
698 | ELS_LIRR_SET_COND = 0x01, /* set - conditionally receive */ | ||
699 | ELS_LIRR_SET_UNCOND = 0x02, /* set - unconditionally receive */ | ||
700 | ELS_LIRR_CLEAR = 0xff /* clear registration */ | ||
701 | }; | ||
702 | |||
703 | /* | ||
704 | * ELS SRL - Scan Remote Loop request. | ||
705 | */ | ||
706 | struct fc_els_srl { | ||
707 | __u8 srl_cmd; /* command */ | ||
708 | __u8 srl_resv[3]; /* reserved - must be zero */ | ||
709 | __u8 srl_flag; /* flag - see below */ | ||
710 | __u8 srl_flag_param[3]; /* flag parameter */ | ||
711 | }; | ||
712 | |||
713 | enum fc_els_srl_flag { | ||
714 | FC_ELS_SRL_ALL = 0x00, /* scan all FL ports */ | ||
715 | FC_ELS_SRL_ONE = 0x01, /* scan specified loop */ | ||
716 | FC_ELS_SRL_EN_PER = 0x02, /* enable periodic scanning (param) */ | ||
717 | FC_ELS_SRL_DIS_PER = 0x03, /* disable periodic scanning */ | ||
718 | }; | ||
719 | |||
720 | /* | ||
721 | * ELS RLS - Read Link Error Status Block request. | ||
722 | */ | ||
723 | struct fc_els_rls { | ||
724 | __u8 rls_cmd; /* command */ | ||
725 | __u8 rls_resv[4]; /* reserved - must be zero */ | ||
726 | __u8 rls_port_id[3]; /* port ID */ | ||
727 | }; | ||
728 | |||
729 | /* | ||
730 | * ELS RLS LS_ACC Response. | ||
731 | */ | ||
732 | struct fc_els_rls_resp { | ||
733 | __u8 rls_cmd; /* ELS_LS_ACC */ | ||
734 | __u8 rls_resv[3]; /* reserved - must be zero */ | ||
735 | struct fc_els_lesb rls_lesb; /* link error status block */ | ||
736 | }; | ||
737 | |||
738 | /* | ||
739 | * ELS RLIR - Registered Link Incident Report. | ||
740 | * This is followed by the CLIR and the CLID, described below. | ||
741 | */ | ||
742 | struct fc_els_rlir { | ||
743 | __u8 rlir_cmd; /* command */ | ||
744 | __u8 rlir_resv[3]; /* reserved - must be zero */ | ||
745 | __u8 rlir_fmt; /* format (FC4-type if type specific) */ | ||
746 | __u8 rlir_clr_len; /* common link incident record length */ | ||
747 | __u8 rlir_cld_len; /* common link incident desc. length */ | ||
748 | __u8 rlir_slr_len; /* spec. link incident record length */ | ||
749 | }; | ||
750 | |||
751 | /* | ||
752 | * CLIR - Common Link Incident Record Data. - Sent via RLIR. | ||
753 | */ | ||
754 | struct fc_els_clir { | ||
755 | __be64 clir_wwpn; /* incident port name */ | ||
756 | __be64 clir_wwnn; /* incident port node name */ | ||
757 | __u8 clir_port_type; /* incident port type */ | ||
758 | __u8 clir_port_id[3]; /* incident port ID */ | ||
759 | |||
760 | __be64 clir_conn_wwpn; /* connected port name */ | ||
761 | __be64 clir_conn_wwnn; /* connected node name */ | ||
762 | __be64 clir_fab_name; /* fabric name */ | ||
763 | __be32 clir_phys_port; /* physical port number */ | ||
764 | __be32 clir_trans_id; /* transaction ID */ | ||
765 | __u8 clir_resv[3]; /* reserved */ | ||
766 | __u8 clir_ts_fmt; /* time stamp format */ | ||
767 | __be64 clir_timestamp; /* time stamp */ | ||
768 | }; | ||
769 | |||
770 | /* | ||
771 | * CLIR clir_ts_fmt - time stamp format values. | ||
772 | */ | ||
773 | enum fc_els_clir_ts_fmt { | ||
774 | ELS_CLIR_TS_UNKNOWN = 0, /* time stamp field unknown */ | ||
775 | ELS_CLIR_TS_SEC_FRAC = 1, /* time in seconds and fractions */ | ||
776 | ELS_CLIR_TS_CSU = 2, /* time in clock synch update format */ | ||
777 | }; | ||
778 | |||
779 | /* | ||
780 | * Common Link Incident Descriptor - sent via RLIR. | ||
781 | */ | ||
782 | struct fc_els_clid { | ||
783 | __u8 clid_iq; /* incident qualifier flags */ | ||
784 | __u8 clid_ic; /* incident code */ | ||
785 | __be16 clid_epai; /* domain/area of ISL */ | ||
786 | }; | ||
787 | |||
788 | /* | ||
789 | * CLID incident qualifier flags. | ||
790 | */ | ||
791 | enum fc_els_clid_iq { | ||
792 | ELS_CLID_SWITCH = 0x20, /* incident port is a switch node */ | ||
793 | ELS_CLID_E_PORT = 0x10, /* incident is an ISL (E) port */ | ||
794 | ELS_CLID_SEV_MASK = 0x0c, /* severity 2-bit field mask */ | ||
795 | ELS_CLID_SEV_INFO = 0x00, /* report is informational */ | ||
796 | ELS_CLID_SEV_INOP = 0x08, /* link not operational */ | ||
797 | ELS_CLID_SEV_DEG = 0x04, /* link degraded but operational */ | ||
798 | ELS_CLID_LASER = 0x02, /* subassembly is a laser */ | ||
799 | ELS_CLID_FRU = 0x01, /* format can identify a FRU */ | ||
800 | }; | ||
801 | |||
802 | /* | ||
803 | * CLID incident code. | ||
804 | */ | ||
805 | enum fc_els_clid_ic { | ||
806 | ELS_CLID_IC_IMPL = 1, /* implicit incident */ | ||
807 | ELS_CLID_IC_BER = 2, /* bit-error-rate threshold exceeded */ | ||
808 | ELS_CLID_IC_LOS = 3, /* loss of synch or signal */ | ||
809 | ELS_CLID_IC_NOS = 4, /* non-operational primitive sequence */ | ||
810 | ELS_CLID_IC_PST = 5, /* primitive sequence timeout */ | ||
811 | ELS_CLID_IC_INVAL = 6, /* invalid primitive sequence */ | ||
812 | ELS_CLID_IC_LOOP_TO = 7, /* loop initialization time out */ | ||
813 | ELS_CLID_IC_LIP = 8, /* receiving LIP */ | ||
814 | }; | ||
815 | |||
816 | #endif /* _FC_ELS_H_ */ | ||