1
2
3
4
5
6
7
8#ifndef _FC_ELS_H_
9#define _FC_ELS_H_
10
11#include <linux/types.h>
12#include <asm/byteorder.h>
13
14
15
16
17
18
19
20
21
22enum fc_els_cmd {
23 ELS_LS_RJT = 0x01,
24 ELS_LS_ACC = 0x02,
25 ELS_PLOGI = 0x03,
26 ELS_FLOGI = 0x04,
27 ELS_LOGO = 0x05,
28 ELS_ABTX = 0x06,
29 ELS_RCS = 0x07,
30 ELS_RES = 0x08,
31 ELS_RSS = 0x09,
32 ELS_RSI = 0x0a,
33 ELS_ESTS = 0x0b,
34 ELS_ESTC = 0x0c,
35 ELS_ADVC = 0x0d,
36 ELS_RTV = 0x0e,
37 ELS_RLS = 0x0f,
38 ELS_ECHO = 0x10,
39 ELS_TEST = 0x11,
40 ELS_RRQ = 0x12,
41 ELS_REC = 0x13,
42 ELS_SRR = 0x14,
43 ELS_FPIN = 0x16,
44 ELS_RDP = 0x18,
45 ELS_RDF = 0x19,
46 ELS_PRLI = 0x20,
47 ELS_PRLO = 0x21,
48 ELS_SCN = 0x22,
49 ELS_TPLS = 0x23,
50 ELS_TPRLO = 0x24,
51 ELS_LCLM = 0x25,
52 ELS_GAID = 0x30,
53 ELS_FACT = 0x31,
54 ELS_FDACDT = 0x32,
55 ELS_NACT = 0x33,
56 ELS_NDACT = 0x34,
57 ELS_QOSR = 0x40,
58 ELS_RVCS = 0x41,
59 ELS_PDISC = 0x50,
60 ELS_FDISC = 0x51,
61 ELS_ADISC = 0x52,
62 ELS_RNC = 0x53,
63 ELS_FARP_REQ = 0x54,
64 ELS_FARP_REPL = 0x55,
65 ELS_RPS = 0x56,
66 ELS_RPL = 0x57,
67 ELS_RPBC = 0x58,
68 ELS_FAN = 0x60,
69 ELS_RSCN = 0x61,
70 ELS_SCR = 0x62,
71 ELS_RNFT = 0x63,
72 ELS_CSR = 0x68,
73 ELS_CSU = 0x69,
74 ELS_LINIT = 0x70,
75 ELS_LSTS = 0x72,
76 ELS_RNID = 0x78,
77 ELS_RLIR = 0x79,
78 ELS_LIRR = 0x7a,
79 ELS_SRL = 0x7b,
80 ELS_SBRP = 0x7c,
81 ELS_RPSC = 0x7d,
82 ELS_QSA = 0x7e,
83 ELS_EVFP = 0x7f,
84 ELS_LKA = 0x80,
85 ELS_AUTH_ELS = 0x90,
86};
87
88
89
90
91
92#define FC_ELS_CMDS_INIT { \
93 [ELS_LS_RJT] = "LS_RJT", \
94 [ELS_LS_ACC] = "LS_ACC", \
95 [ELS_PLOGI] = "PLOGI", \
96 [ELS_FLOGI] = "FLOGI", \
97 [ELS_LOGO] = "LOGO", \
98 [ELS_ABTX] = "ABTX", \
99 [ELS_RCS] = "RCS", \
100 [ELS_RES] = "RES", \
101 [ELS_RSS] = "RSS", \
102 [ELS_RSI] = "RSI", \
103 [ELS_ESTS] = "ESTS", \
104 [ELS_ESTC] = "ESTC", \
105 [ELS_ADVC] = "ADVC", \
106 [ELS_RTV] = "RTV", \
107 [ELS_RLS] = "RLS", \
108 [ELS_ECHO] = "ECHO", \
109 [ELS_TEST] = "TEST", \
110 [ELS_RRQ] = "RRQ", \
111 [ELS_REC] = "REC", \
112 [ELS_SRR] = "SRR", \
113 [ELS_FPIN] = "FPIN", \
114 [ELS_RDP] = "RDP", \
115 [ELS_RDF] = "RDF", \
116 [ELS_PRLI] = "PRLI", \
117 [ELS_PRLO] = "PRLO", \
118 [ELS_SCN] = "SCN", \
119 [ELS_TPLS] = "TPLS", \
120 [ELS_TPRLO] = "TPRLO", \
121 [ELS_LCLM] = "LCLM", \
122 [ELS_GAID] = "GAID", \
123 [ELS_FACT] = "FACT", \
124 [ELS_FDACDT] = "FDACDT", \
125 [ELS_NACT] = "NACT", \
126 [ELS_NDACT] = "NDACT", \
127 [ELS_QOSR] = "QOSR", \
128 [ELS_RVCS] = "RVCS", \
129 [ELS_PDISC] = "PDISC", \
130 [ELS_FDISC] = "FDISC", \
131 [ELS_ADISC] = "ADISC", \
132 [ELS_RNC] = "RNC", \
133 [ELS_FARP_REQ] = "FARP_REQ", \
134 [ELS_FARP_REPL] = "FARP_REPL", \
135 [ELS_RPS] = "RPS", \
136 [ELS_RPL] = "RPL", \
137 [ELS_RPBC] = "RPBC", \
138 [ELS_FAN] = "FAN", \
139 [ELS_RSCN] = "RSCN", \
140 [ELS_SCR] = "SCR", \
141 [ELS_RNFT] = "RNFT", \
142 [ELS_CSR] = "CSR", \
143 [ELS_CSU] = "CSU", \
144 [ELS_LINIT] = "LINIT", \
145 [ELS_LSTS] = "LSTS", \
146 [ELS_RNID] = "RNID", \
147 [ELS_RLIR] = "RLIR", \
148 [ELS_LIRR] = "LIRR", \
149 [ELS_SRL] = "SRL", \
150 [ELS_SBRP] = "SBRP", \
151 [ELS_RPSC] = "RPSC", \
152 [ELS_QSA] = "QSA", \
153 [ELS_EVFP] = "EVFP", \
154 [ELS_LKA] = "LKA", \
155 [ELS_AUTH_ELS] = "AUTH_ELS", \
156}
157
158
159
160
161struct fc_els_ls_acc {
162 __u8 la_cmd;
163 __u8 la_resv[3];
164};
165
166
167
168
169struct fc_els_ls_rjt {
170 __u8 er_cmd;
171 __u8 er_resv[4];
172 __u8 er_reason;
173 __u8 er_explan;
174 __u8 er_vendor;
175};
176
177
178
179
180enum fc_els_rjt_reason {
181 ELS_RJT_NONE = 0,
182 ELS_RJT_INVAL = 0x01,
183 ELS_RJT_LOGIC = 0x03,
184 ELS_RJT_BUSY = 0x05,
185 ELS_RJT_PROT = 0x07,
186 ELS_RJT_UNAB = 0x09,
187 ELS_RJT_UNSUP = 0x0b,
188 ELS_RJT_INPROG = 0x0e,
189 ELS_RJT_FIP = 0x20,
190 ELS_RJT_VENDOR = 0xff,
191};
192
193
194
195
196
197enum fc_els_rjt_explan {
198 ELS_EXPL_NONE = 0x00,
199 ELS_EXPL_SPP_OPT_ERR = 0x01,
200 ELS_EXPL_SPP_ICTL_ERR = 0x03,
201 ELS_EXPL_AH = 0x11,
202 ELS_EXPL_AH_REQ = 0x13,
203 ELS_EXPL_SID = 0x15,
204 ELS_EXPL_OXID_RXID = 0x17,
205 ELS_EXPL_INPROG = 0x19,
206 ELS_EXPL_PLOGI_REQD = 0x1e,
207 ELS_EXPL_INSUF_RES = 0x29,
208 ELS_EXPL_UNAB_DATA = 0x2a,
209 ELS_EXPL_UNSUPR = 0x2c,
210 ELS_EXPL_INV_LEN = 0x2d,
211 ELS_EXPL_NOT_NEIGHBOR = 0x62,
212
213};
214
215
216
217
218enum fc_ls_tlv_dtag {
219 ELS_DTAG_LS_REQ_INFO = 0x00000001,
220
221 ELS_DTAG_LNK_INTEGRITY = 0x00020001,
222
223 ELS_DTAG_DELIVERY = 0x00020002,
224
225 ELS_DTAG_PEER_CONGEST = 0x00020003,
226
227 ELS_DTAG_CONGESTION = 0x00020004,
228
229 ELS_DTAG_FPIN_REGISTER = 0x00030001,
230
231};
232
233
234
235
236
237#define FC_LS_TLV_DTAG_INIT { \
238 { ELS_DTAG_LS_REQ_INFO, "Link Service Request Information" }, \
239 { ELS_DTAG_LNK_INTEGRITY, "Link Integrity Notification" }, \
240 { ELS_DTAG_DELIVERY, "Delivery Notification Present" }, \
241 { ELS_DTAG_PEER_CONGEST, "Peer Congestion Notification" }, \
242 { ELS_DTAG_CONGESTION, "Congestion Notification" }, \
243 { ELS_DTAG_FPIN_REGISTER, "FPIN Registration" }, \
244}
245
246
247
248
249
250
251
252
253struct fc_tlv_desc {
254 __be32 desc_tag;
255 __be32 desc_len;
256
257
258
259 __u8 desc_value[0];
260};
261
262
263
264
265#define FC_TLV_DESC_HDR_SZ sizeof(struct fc_tlv_desc)
266
267
268
269
270
271#define FC_TLV_DESC_LENGTH_FROM_SZ(desc) \
272 (sizeof(desc) - FC_TLV_DESC_HDR_SZ)
273
274
275#define FC_TLV_DESC_SZ_FROM_LENGTH(tlv) \
276 (__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
277
278
279
280
281
282
283
284static inline void *fc_tlv_next_desc(void *desc)
285{
286 struct fc_tlv_desc *tlv = desc;
287
288 return (desc + FC_TLV_DESC_SZ_FROM_LENGTH(tlv));
289}
290
291
292
293
294
295struct fc_els_lsri_desc {
296 __be32 desc_tag;
297 __be32 desc_len;
298
299
300
301 struct {
302 __u8 cmd;
303 __u8 bytes[3];
304 } rqst_w0;
305};
306
307
308
309
310
311struct fc_els_csp {
312 __u8 sp_hi_ver;
313 __u8 sp_lo_ver;
314 __be16 sp_bb_cred;
315 __be16 sp_features;
316 __be16 sp_bb_data;
317 union {
318 struct {
319 __be16 _sp_tot_seq;
320 __be16 _sp_rel_off;
321 } sp_plogi;
322 struct {
323 __be32 _sp_r_a_tov;
324 } sp_flogi_acc;
325 } sp_u;
326 __be32 sp_e_d_tov;
327};
328#define sp_tot_seq sp_u.sp_plogi._sp_tot_seq
329#define sp_rel_off sp_u.sp_plogi._sp_rel_off
330#define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov
331
332#define FC_SP_BB_DATA_MASK 0xfff
333
334
335
336
337#define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD
338#define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD
339
340
341
342
343#define FC_SP_FT_NPIV 0x8000
344#define FC_SP_FT_CIRO 0x8000
345#define FC_SP_FT_CLAD 0x8000
346#define FC_SP_FT_RAND 0x4000
347#define FC_SP_FT_VAL 0x2000
348#define FC_SP_FT_NPIV_ACC 0x2000
349#define FC_SP_FT_FPORT 0x1000
350#define FC_SP_FT_ABB 0x0800
351#define FC_SP_FT_EDTR 0x0400
352#define FC_SP_FT_MCAST 0x0200
353#define FC_SP_FT_BCAST 0x0100
354#define FC_SP_FT_HUNT 0x0080
355#define FC_SP_FT_SIMP 0x0040
356#define FC_SP_FT_SEC 0x0020
357#define FC_SP_FT_CSYN 0x0010
358#define FC_SP_FT_RTTOV 0x0008
359#define FC_SP_FT_HALF 0x0004
360#define FC_SP_FT_SEQC 0x0002
361#define FC_SP_FT_PAYL 0x0001
362
363
364
365
366struct fc_els_cssp {
367 __be16 cp_class;
368 __be16 cp_init;
369 __be16 cp_recip;
370 __be16 cp_rdfs;
371 __be16 cp_con_seq;
372 __be16 cp_ee_cred;
373 __u8 cp_resv1;
374 __u8 cp_open_seq;
375 __u8 _cp_resv2[2];
376};
377
378
379
380
381#define FC_CPC_VALID 0x8000
382#define FC_CPC_IMIX 0x4000
383#define FC_CPC_SEQ 0x0800
384#define FC_CPC_CAMP 0x0200
385#define FC_CPC_PRI 0x0080
386
387
388
389
390
391#define FC_CPI_CSYN 0x0010
392
393
394
395
396#define FC_CPR_CSYN 0x0008
397
398
399
400
401
402struct fc_els_flogi {
403 __u8 fl_cmd;
404 __u8 _fl_resvd[3];
405 struct fc_els_csp fl_csp;
406 __be64 fl_wwpn;
407 __be64 fl_wwnn;
408 struct fc_els_cssp fl_cssp[4];
409 __u8 fl_vend[16];
410} __attribute__((__packed__));
411
412
413
414
415struct fc_els_spp {
416 __u8 spp_type;
417 __u8 spp_type_ext;
418 __u8 spp_flags;
419 __u8 _spp_resvd;
420 __be32 spp_orig_pa;
421 __be32 spp_resp_pa;
422 __be32 spp_params;
423};
424
425
426
427
428#define FC_SPP_OPA_VAL 0x80
429#define FC_SPP_RPA_VAL 0x40
430#define FC_SPP_EST_IMG_PAIR 0x20
431#define FC_SPP_RESP_MASK 0x0f
432
433
434
435
436enum fc_els_spp_resp {
437 FC_SPP_RESP_ACK = 1,
438 FC_SPP_RESP_RES = 2,
439 FC_SPP_RESP_INIT = 3,
440 FC_SPP_RESP_NO_PA = 4,
441 FC_SPP_RESP_CONF = 5,
442 FC_SPP_RESP_COND = 6,
443 FC_SPP_RESP_MULT = 7,
444 FC_SPP_RESP_INVL = 8,
445};
446
447
448
449
450struct fc_els_rrq {
451 __u8 rrq_cmd;
452 __u8 rrq_zero[3];
453 __u8 rrq_resvd;
454 __u8 rrq_s_id[3];
455 __be16 rrq_ox_id;
456 __be16 rrq_rx_id;
457};
458
459
460
461
462struct fc_els_rec {
463 __u8 rec_cmd;
464 __u8 rec_zero[3];
465 __u8 rec_resvd;
466 __u8 rec_s_id[3];
467 __be16 rec_ox_id;
468 __be16 rec_rx_id;
469};
470
471
472
473
474struct fc_els_rec_acc {
475 __u8 reca_cmd;
476 __u8 reca_zero[3];
477 __be16 reca_ox_id;
478 __be16 reca_rx_id;
479 __u8 reca_resvd1;
480 __u8 reca_ofid[3];
481 __u8 reca_resvd2;
482 __u8 reca_rfid[3];
483 __be32 reca_fc4value;
484 __be32 reca_e_stat;
485};
486
487
488
489
490struct fc_els_prli {
491 __u8 prli_cmd;
492 __u8 prli_spp_len;
493 __be16 prli_len;
494
495};
496
497
498
499
500struct fc_els_prlo {
501 __u8 prlo_cmd;
502 __u8 prlo_obs;
503 __be16 prlo_len;
504};
505
506
507
508
509struct fc_els_adisc {
510 __u8 adisc_cmd;
511 __u8 adisc_resv[3];
512 __u8 adisc_resv1;
513 __u8 adisc_hard_addr[3];
514 __be64 adisc_wwpn;
515 __be64 adisc_wwnn;
516 __u8 adisc_resv2;
517 __u8 adisc_port_id[3];
518} __attribute__((__packed__));
519
520
521
522
523struct fc_els_logo {
524 __u8 fl_cmd;
525 __u8 fl_zero[3];
526 __u8 fl_resvd;
527 __u8 fl_n_port_id[3];
528 __be64 fl_n_port_wwn;
529};
530
531
532
533
534struct fc_els_rtv {
535 __u8 rtv_cmd;
536 __u8 rtv_zero[3];
537};
538
539
540
541
542struct fc_els_rtv_acc {
543 __u8 rtv_cmd;
544 __u8 rtv_zero[3];
545 __be32 rtv_r_a_tov;
546 __be32 rtv_e_d_tov;
547 __be32 rtv_toq;
548};
549
550
551
552
553#define FC_ELS_RTV_EDRES (1 << 26)
554#define FC_ELS_RTV_RTTOV (1 << 19)
555
556
557
558
559struct fc_els_scr {
560 __u8 scr_cmd;
561 __u8 scr_resv[6];
562 __u8 scr_reg_func;
563};
564
565enum fc_els_scr_func {
566 ELS_SCRF_FAB = 1,
567 ELS_SCRF_NPORT = 2,
568 ELS_SCRF_FULL = 3,
569 ELS_SCRF_CLEAR = 255,
570};
571
572
573
574
575struct fc_els_rscn {
576 __u8 rscn_cmd;
577 __u8 rscn_page_len;
578 __be16 rscn_plen;
579
580
581};
582
583struct fc_els_rscn_page {
584 __u8 rscn_page_flags;
585 __u8 rscn_fid[3];
586};
587
588#define ELS_RSCN_EV_QUAL_BIT 2
589#define ELS_RSCN_EV_QUAL_MASK 0xf
590#define ELS_RSCN_ADDR_FMT_BIT 0
591#define ELS_RSCN_ADDR_FMT_MASK 0x3
592
593enum fc_els_rscn_ev_qual {
594 ELS_EV_QUAL_NONE = 0,
595 ELS_EV_QUAL_NS_OBJ = 1,
596 ELS_EV_QUAL_PORT_ATTR = 2,
597 ELS_EV_QUAL_SERV_OBJ = 3,
598 ELS_EV_QUAL_SW_CONFIG = 4,
599 ELS_EV_QUAL_REM_OBJ = 5,
600};
601
602enum fc_els_rscn_addr_fmt {
603 ELS_ADDR_FMT_PORT = 0,
604 ELS_ADDR_FMT_AREA = 1,
605 ELS_ADDR_FMT_DOM = 2,
606 ELS_ADDR_FMT_FAB = 3,
607};
608
609
610
611
612struct fc_els_rnid {
613 __u8 rnid_cmd;
614 __u8 rnid_resv[3];
615 __u8 rnid_fmt;
616 __u8 rnid_resv2[3];
617};
618
619
620
621
622enum fc_els_rnid_fmt {
623 ELS_RNIDF_NONE = 0,
624 ELS_RNIDF_GEN = 0xdf,
625};
626
627
628
629
630struct fc_els_rnid_resp {
631 __u8 rnid_cmd;
632 __u8 rnid_resv[3];
633 __u8 rnid_fmt;
634 __u8 rnid_cid_len;
635 __u8 rnid_resv2;
636 __u8 rnid_sid_len;
637};
638
639struct fc_els_rnid_cid {
640 __be64 rnid_wwpn;
641 __be64 rnid_wwnn;
642};
643
644struct fc_els_rnid_gen {
645 __u8 rnid_vend_id[16];
646 __be32 rnid_atype;
647 __be32 rnid_phys_port;
648 __be32 rnid_att_nodes;
649 __u8 rnid_node_mgmt;
650 __u8 rnid_ip_ver;
651 __be16 rnid_prot_port;
652 __be32 rnid_ip_addr[4];
653 __u8 rnid_resvd[2];
654 __be16 rnid_vend_spec;
655};
656
657enum fc_els_rnid_atype {
658 ELS_RNIDA_UNK = 0x01,
659 ELS_RNIDA_OTHER = 0x02,
660 ELS_RNIDA_HUB = 0x03,
661 ELS_RNIDA_SWITCH = 0x04,
662 ELS_RNIDA_GATEWAY = 0x05,
663 ELS_RNIDA_CONV = 0x06,
664 ELS_RNIDA_HBA = 0x07,
665 ELS_RNIDA_PROXY = 0x08,
666 ELS_RNIDA_STORAGE = 0x09,
667 ELS_RNIDA_HOST = 0x0a,
668 ELS_RNIDA_SUBSYS = 0x0b,
669 ELS_RNIDA_ACCESS = 0x0e,
670 ELS_RNIDA_NAS = 0x11,
671 ELS_RNIDA_BRIDGE = 0x12,
672 ELS_RNIDA_VIRT = 0x13,
673 ELS_RNIDA_MF = 0xff,
674 ELS_RNIDA_MF_HUB = 1UL << 31,
675 ELS_RNIDA_MF_SW = 1UL << 30,
676 ELS_RNIDA_MF_GW = 1UL << 29,
677 ELS_RNIDA_MF_ST = 1UL << 28,
678 ELS_RNIDA_MF_HOST = 1UL << 27,
679 ELS_RNIDA_MF_SUB = 1UL << 26,
680 ELS_RNIDA_MF_ACC = 1UL << 25,
681 ELS_RNIDA_MF_WDM = 1UL << 24,
682 ELS_RNIDA_MF_NAS = 1UL << 23,
683 ELS_RNIDA_MF_BR = 1UL << 22,
684 ELS_RNIDA_MF_VIRT = 1UL << 21,
685};
686
687enum fc_els_rnid_mgmt {
688 ELS_RNIDM_SNMP = 0,
689 ELS_RNIDM_TELNET = 1,
690 ELS_RNIDM_HTTP = 2,
691 ELS_RNIDM_HTTPS = 3,
692 ELS_RNIDM_XML = 4,
693};
694
695enum fc_els_rnid_ipver {
696 ELS_RNIDIP_NONE = 0,
697 ELS_RNIDIP_V4 = 1,
698 ELS_RNIDIP_V6 = 2,
699};
700
701
702
703
704struct fc_els_rpl {
705 __u8 rpl_cmd;
706 __u8 rpl_resv[5];
707 __be16 rpl_max_size;
708 __u8 rpl_resv1;
709 __u8 rpl_index[3];
710};
711
712
713
714
715struct fc_els_pnb {
716 __be32 pnb_phys_pn;
717 __u8 pnb_resv;
718 __u8 pnb_port_id[3];
719 __be64 pnb_wwpn;
720};
721
722
723
724
725struct fc_els_rpl_resp {
726 __u8 rpl_cmd;
727 __u8 rpl_resv1;
728 __be16 rpl_plen;
729 __u8 rpl_resv2;
730 __u8 rpl_llen[3];
731 __u8 rpl_resv3;
732 __u8 rpl_index[3];
733 struct fc_els_pnb rpl_pnb[1];
734};
735
736
737
738
739struct fc_els_lesb {
740 __be32 lesb_link_fail;
741 __be32 lesb_sync_loss;
742 __be32 lesb_sig_loss;
743 __be32 lesb_prim_err;
744 __be32 lesb_inv_word;
745 __be32 lesb_inv_crc;
746};
747
748
749
750
751struct fc_els_rps {
752 __u8 rps_cmd;
753 __u8 rps_resv[2];
754 __u8 rps_flag;
755 __be64 rps_port_spec;
756};
757
758enum fc_els_rps_flag {
759 FC_ELS_RPS_DID = 0x00,
760 FC_ELS_RPS_PPN = 0x01,
761 FC_ELS_RPS_WWPN = 0x02,
762};
763
764
765
766
767struct fc_els_rps_resp {
768 __u8 rps_cmd;
769 __u8 rps_resv[2];
770 __u8 rps_flag;
771 __u8 rps_resv2[2];
772 __be16 rps_status;
773 struct fc_els_lesb rps_lesb;
774};
775
776enum fc_els_rps_resp_flag {
777 FC_ELS_RPS_LPEV = 0x01,
778};
779
780enum fc_els_rps_resp_status {
781 FC_ELS_RPS_PTP = 1 << 5,
782 FC_ELS_RPS_LOOP = 1 << 4,
783 FC_ELS_RPS_FAB = 1 << 3,
784 FC_ELS_RPS_NO_SIG = 1 << 2,
785 FC_ELS_RPS_NO_SYNC = 1 << 1,
786 FC_ELS_RPS_RESET = 1 << 0,
787};
788
789
790
791
792struct fc_els_lirr {
793 __u8 lirr_cmd;
794 __u8 lirr_resv[3];
795 __u8 lirr_func;
796 __u8 lirr_fmt;
797 __u8 lirr_resv2[2];
798};
799
800enum fc_els_lirr_func {
801 ELS_LIRR_SET_COND = 0x01,
802 ELS_LIRR_SET_UNCOND = 0x02,
803 ELS_LIRR_CLEAR = 0xff
804};
805
806
807
808
809struct fc_els_srl {
810 __u8 srl_cmd;
811 __u8 srl_resv[3];
812 __u8 srl_flag;
813 __u8 srl_flag_param[3];
814};
815
816enum fc_els_srl_flag {
817 FC_ELS_SRL_ALL = 0x00,
818 FC_ELS_SRL_ONE = 0x01,
819 FC_ELS_SRL_EN_PER = 0x02,
820 FC_ELS_SRL_DIS_PER = 0x03,
821};
822
823
824
825
826struct fc_els_rls {
827 __u8 rls_cmd;
828 __u8 rls_resv[4];
829 __u8 rls_port_id[3];
830};
831
832
833
834
835struct fc_els_rls_resp {
836 __u8 rls_cmd;
837 __u8 rls_resv[3];
838 struct fc_els_lesb rls_lesb;
839};
840
841
842
843
844
845struct fc_els_rlir {
846 __u8 rlir_cmd;
847 __u8 rlir_resv[3];
848 __u8 rlir_fmt;
849 __u8 rlir_clr_len;
850 __u8 rlir_cld_len;
851 __u8 rlir_slr_len;
852};
853
854
855
856
857struct fc_els_clir {
858 __be64 clir_wwpn;
859 __be64 clir_wwnn;
860 __u8 clir_port_type;
861 __u8 clir_port_id[3];
862
863 __be64 clir_conn_wwpn;
864 __be64 clir_conn_wwnn;
865 __be64 clir_fab_name;
866 __be32 clir_phys_port;
867 __be32 clir_trans_id;
868 __u8 clir_resv[3];
869 __u8 clir_ts_fmt;
870 __be64 clir_timestamp;
871};
872
873
874
875
876enum fc_els_clir_ts_fmt {
877 ELS_CLIR_TS_UNKNOWN = 0,
878 ELS_CLIR_TS_SEC_FRAC = 1,
879 ELS_CLIR_TS_CSU = 2,
880};
881
882
883
884
885struct fc_els_clid {
886 __u8 clid_iq;
887 __u8 clid_ic;
888 __be16 clid_epai;
889};
890
891
892
893
894enum fc_els_clid_iq {
895 ELS_CLID_SWITCH = 0x20,
896 ELS_CLID_E_PORT = 0x10,
897 ELS_CLID_SEV_MASK = 0x0c,
898 ELS_CLID_SEV_INFO = 0x00,
899 ELS_CLID_SEV_INOP = 0x08,
900 ELS_CLID_SEV_DEG = 0x04,
901 ELS_CLID_LASER = 0x02,
902 ELS_CLID_FRU = 0x01,
903};
904
905
906
907
908enum fc_els_clid_ic {
909 ELS_CLID_IC_IMPL = 1,
910 ELS_CLID_IC_BER = 2,
911 ELS_CLID_IC_LOS = 3,
912 ELS_CLID_IC_NOS = 4,
913 ELS_CLID_IC_PST = 5,
914 ELS_CLID_IC_INVAL = 6,
915 ELS_CLID_IC_LOOP_TO = 7,
916 ELS_CLID_IC_LIP = 8,
917};
918
919
920
921
922enum fc_fpin_li_event_types {
923 FPIN_LI_UNKNOWN = 0x0,
924 FPIN_LI_LINK_FAILURE = 0x1,
925 FPIN_LI_LOSS_OF_SYNC = 0x2,
926 FPIN_LI_LOSS_OF_SIG = 0x3,
927 FPIN_LI_PRIM_SEQ_ERR = 0x4,
928 FPIN_LI_INVALID_TX_WD = 0x5,
929 FPIN_LI_INVALID_CRC = 0x6,
930 FPIN_LI_DEVICE_SPEC = 0xF,
931};
932
933
934
935
936
937#define FC_FPIN_LI_EVT_TYPES_INIT { \
938 { FPIN_LI_UNKNOWN, "Unknown" }, \
939 { FPIN_LI_LINK_FAILURE, "Link Failure" }, \
940 { FPIN_LI_LOSS_OF_SYNC, "Loss of Synchronization" }, \
941 { FPIN_LI_LOSS_OF_SIG, "Loss of Signal" }, \
942 { FPIN_LI_PRIM_SEQ_ERR, "Primitive Sequence Protocol Error" }, \
943 { FPIN_LI_INVALID_TX_WD, "Invalid Transmission Word" }, \
944 { FPIN_LI_INVALID_CRC, "Invalid CRC" }, \
945 { FPIN_LI_DEVICE_SPEC, "Device Specific" }, \
946}
947
948
949
950
951enum fc_fpin_deli_event_types {
952 FPIN_DELI_UNKNOWN = 0x0,
953 FPIN_DELI_TIMEOUT = 0x1,
954 FPIN_DELI_UNABLE_TO_ROUTE = 0x2,
955 FPIN_DELI_DEVICE_SPEC = 0xF,
956};
957
958
959
960
961
962#define FC_FPIN_DELI_EVT_TYPES_INIT { \
963 { FPIN_DELI_UNKNOWN, "Unknown" }, \
964 { FPIN_DELI_TIMEOUT, "Timeout" }, \
965 { FPIN_DELI_UNABLE_TO_ROUTE, "Unable to Route" }, \
966 { FPIN_DELI_DEVICE_SPEC, "Device Specific" }, \
967}
968
969
970
971
972enum fc_fpin_congn_event_types {
973 FPIN_CONGN_CLEAR = 0x0,
974 FPIN_CONGN_LOST_CREDIT = 0x1,
975 FPIN_CONGN_CREDIT_STALL = 0x2,
976 FPIN_CONGN_OVERSUBSCRIPTION = 0x3,
977 FPIN_CONGN_DEVICE_SPEC = 0xF,
978};
979
980
981
982
983
984#define FC_FPIN_CONGN_EVT_TYPES_INIT { \
985 { FPIN_CONGN_CLEAR, "Clear" }, \
986 { FPIN_CONGN_LOST_CREDIT, "Lost Credit" }, \
987 { FPIN_CONGN_CREDIT_STALL, "Credit Stall" }, \
988 { FPIN_CONGN_OVERSUBSCRIPTION, "Oversubscription" }, \
989 { FPIN_CONGN_DEVICE_SPEC, "Device Specific" }, \
990}
991
992enum fc_fpin_congn_severity_types {
993 FPIN_CONGN_SEVERITY_WARNING = 0xF1,
994 FPIN_CONGN_SEVERITY_ERROR = 0xF7,
995};
996
997
998
999
1000struct fc_fn_li_desc {
1001 __be32 desc_tag;
1002 __be32 desc_len;
1003
1004
1005
1006 __be64 detecting_wwpn;
1007 __be64 attached_wwpn;
1008
1009
1010 __be16 event_type;
1011 __be16 event_modifier;
1012
1013
1014 __be32 event_threshold;
1015
1016
1017 __be32 event_count;
1018
1019
1020
1021 __be32 pname_count;
1022 __be64 pname_list[0];
1023
1024
1025};
1026
1027
1028
1029
1030struct fc_fn_deli_desc {
1031 __be32 desc_tag;
1032 __be32 desc_len;
1033
1034
1035
1036 __be64 detecting_wwpn;
1037 __be64 attached_wwpn;
1038
1039
1040 __be32 deli_reason_code;
1041};
1042
1043
1044
1045
1046struct fc_fn_peer_congn_desc {
1047 __be32 desc_tag;
1048 __be32 desc_len;
1049
1050
1051
1052 __be64 detecting_wwpn;
1053 __be64 attached_wwpn;
1054
1055
1056 __be16 event_type;
1057 __be16 event_modifier;
1058
1059
1060 __be32 event_period;
1061
1062
1063 __be32 pname_count;
1064 __be64 pname_list[0];
1065
1066
1067};
1068
1069
1070
1071
1072struct fc_fn_congn_desc {
1073 __be32 desc_tag;
1074 __be32 desc_len;
1075
1076
1077
1078 __be16 event_type;
1079 __be16 event_modifier;
1080
1081
1082 __be32 event_period;
1083
1084
1085 __u8 severity;
1086 __u8 resv[3];
1087};
1088
1089
1090
1091
1092struct fc_els_fpin {
1093 __u8 fpin_cmd;
1094 __u8 fpin_zero[3];
1095 __be32 desc_len;
1096
1097
1098
1099 struct fc_tlv_desc fpin_desc[0];
1100};
1101
1102
1103struct fc_df_desc_fpin_reg {
1104 __be32 desc_tag;
1105 __be32 desc_len;
1106
1107
1108
1109 __be32 count;
1110 __be32 desc_tags[0];
1111
1112
1113
1114
1115
1116
1117
1118};
1119
1120
1121
1122
1123struct fc_els_rdf {
1124 __u8 fpin_cmd;
1125 __u8 fpin_zero[3];
1126 __be32 desc_len;
1127
1128
1129
1130 struct fc_tlv_desc desc[0];
1131};
1132
1133
1134
1135
1136struct fc_els_rdf_resp {
1137 struct fc_els_ls_acc acc_hdr;
1138 __be32 desc_list_len;
1139
1140
1141
1142 struct fc_els_lsri_desc lsri;
1143 struct fc_tlv_desc desc[0];
1144};
1145
1146
1147#endif
1148