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