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