1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _FC_ELS_H_
20 #define _FC_ELS_H_
21 #include <linux/types.h>
22 #include <asm/byteorder.h>
23 enum fc_els_cmd {
24   ELS_LS_RJT = 0x01,
25   ELS_LS_ACC = 0x02,
26   ELS_PLOGI = 0x03,
27   ELS_FLOGI = 0x04,
28   ELS_LOGO = 0x05,
29   ELS_ABTX = 0x06,
30   ELS_RCS = 0x07,
31   ELS_RES = 0x08,
32   ELS_RSS = 0x09,
33   ELS_RSI = 0x0a,
34   ELS_ESTS = 0x0b,
35   ELS_ESTC = 0x0c,
36   ELS_ADVC = 0x0d,
37   ELS_RTV = 0x0e,
38   ELS_RLS = 0x0f,
39   ELS_ECHO = 0x10,
40   ELS_TEST = 0x11,
41   ELS_RRQ = 0x12,
42   ELS_REC = 0x13,
43   ELS_SRR = 0x14,
44   ELS_FPIN = 0x16,
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 #define FC_ELS_CMDS_INIT {[ELS_LS_RJT] = "LS_RJT",[ELS_LS_ACC] = "LS_ACC",[ELS_PLOGI] = "PLOGI",[ELS_FLOGI] = "FLOGI",[ELS_LOGO] = "LOGO",[ELS_ABTX] = "ABTX",[ELS_RCS] = "RCS",[ELS_RES] = "RES",[ELS_RSS] = "RSS",[ELS_RSI] = "RSI",[ELS_ESTS] = "ESTS",[ELS_ESTC] = "ESTC",[ELS_ADVC] = "ADVC",[ELS_RTV] = "RTV",[ELS_RLS] = "RLS",[ELS_ECHO] = "ECHO",[ELS_TEST] = "TEST",[ELS_RRQ] = "RRQ",[ELS_REC] = "REC",[ELS_SRR] = "SRR",[ELS_FPIN] = "FPIN",[ELS_RDF] = "RDF",[ELS_PRLI] = "PRLI",[ELS_PRLO] = "PRLO",[ELS_SCN] = "SCN",[ELS_TPLS] = "TPLS",[ELS_TPRLO] = "TPRLO",[ELS_LCLM] = "LCLM",[ELS_GAID] = "GAID",[ELS_FACT] = "FACT",[ELS_FDACDT] = "FDACDT",[ELS_NACT] = "NACT",[ELS_NDACT] = "NDACT",[ELS_QOSR] = "QOSR",[ELS_RVCS] = "RVCS",[ELS_PDISC] = "PDISC",[ELS_FDISC] = "FDISC",[ELS_ADISC] = "ADISC",[ELS_RNC] = "RNC",[ELS_FARP_REQ] = "FARP_REQ",[ELS_FARP_REPL] = "FARP_REPL",[ELS_RPS] = "RPS",[ELS_RPL] = "RPL",[ELS_RPBC] = "RPBC",[ELS_FAN] = "FAN",[ELS_RSCN] = "RSCN",[ELS_SCR] = "SCR",[ELS_RNFT] = "RNFT",[ELS_CSR] = "CSR",[ELS_CSU] = "CSU",[ELS_LINIT] = "LINIT",[ELS_LSTS] = "LSTS",[ELS_RNID] = "RNID",[ELS_RLIR] = "RLIR",[ELS_LIRR] = "LIRR",[ELS_SRL] = "SRL",[ELS_SBRP] = "SBRP",[ELS_RPSC] = "RPSC",[ELS_QSA] = "QSA",[ELS_EVFP] = "EVFP",[ELS_LKA] = "LKA",[ELS_AUTH_ELS] = "AUTH_ELS", \
88 }
89 struct fc_els_ls_acc {
90   __u8 la_cmd;
91   __u8 la_resv[3];
92 };
93 struct fc_els_ls_rjt {
94   __u8 er_cmd;
95   __u8 er_resv[4];
96   __u8 er_reason;
97   __u8 er_explan;
98   __u8 er_vendor;
99 };
100 enum fc_els_rjt_reason {
101   ELS_RJT_NONE = 0,
102   ELS_RJT_INVAL = 0x01,
103   ELS_RJT_LOGIC = 0x03,
104   ELS_RJT_BUSY = 0x05,
105   ELS_RJT_PROT = 0x07,
106   ELS_RJT_UNAB = 0x09,
107   ELS_RJT_UNSUP = 0x0b,
108   ELS_RJT_INPROG = 0x0e,
109   ELS_RJT_FIP = 0x20,
110   ELS_RJT_VENDOR = 0xff,
111 };
112 enum fc_els_rjt_explan {
113   ELS_EXPL_NONE = 0x00,
114   ELS_EXPL_SPP_OPT_ERR = 0x01,
115   ELS_EXPL_SPP_ICTL_ERR = 0x03,
116   ELS_EXPL_AH = 0x11,
117   ELS_EXPL_AH_REQ = 0x13,
118   ELS_EXPL_SID = 0x15,
119   ELS_EXPL_OXID_RXID = 0x17,
120   ELS_EXPL_INPROG = 0x19,
121   ELS_EXPL_PLOGI_REQD = 0x1e,
122   ELS_EXPL_INSUF_RES = 0x29,
123   ELS_EXPL_UNAB_DATA = 0x2a,
124   ELS_EXPL_UNSUPR = 0x2c,
125   ELS_EXPL_INV_LEN = 0x2d,
126   ELS_EXPL_NOT_NEIGHBOR = 0x62,
127 };
128 enum fc_ls_tlv_dtag {
129   ELS_DTAG_LS_REQ_INFO = 0x00000001,
130   ELS_DTAG_LNK_INTEGRITY = 0x00020001,
131   ELS_DTAG_DELIVERY = 0x00020002,
132   ELS_DTAG_PEER_CONGEST = 0x00020003,
133   ELS_DTAG_CONGESTION = 0x00020004,
134   ELS_DTAG_FPIN_REGISTER = 0x00030001,
135 };
136 #define FC_LS_TLV_DTAG_INIT { { ELS_DTAG_LS_REQ_INFO, "Link Service Request Information" }, { ELS_DTAG_LNK_INTEGRITY, "Link Integrity Notification" }, { ELS_DTAG_DELIVERY, "Delivery Notification Present" }, { ELS_DTAG_PEER_CONGEST, "Peer Congestion Notification" }, { ELS_DTAG_CONGESTION, "Congestion Notification" }, { ELS_DTAG_FPIN_REGISTER, "FPIN Registration" }, \
137 }
138 struct fc_tlv_desc {
139   __be32 desc_tag;
140   __be32 desc_len;
141   __u8 desc_value[0];
142 };
143 #define FC_TLV_DESC_HDR_SZ sizeof(struct fc_tlv_desc)
144 #define FC_TLV_DESC_LENGTH_FROM_SZ(desc) (sizeof(desc) - FC_TLV_DESC_HDR_SZ)
145 #define FC_TLV_DESC_SZ_FROM_LENGTH(tlv) (__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)
146 struct fc_els_lsri_desc {
147   __be32 desc_tag;
148   __be32 desc_len;
149   struct {
150     __u8 cmd;
151     __u8 bytes[3];
152   } rqst_w0;
153 };
154 struct fc_els_csp {
155   __u8 sp_hi_ver;
156   __u8 sp_lo_ver;
157   __be16 sp_bb_cred;
158   __be16 sp_features;
159   __be16 sp_bb_data;
160   union {
161     struct {
162       __be16 _sp_tot_seq;
163       __be16 _sp_rel_off;
164     } sp_plogi;
165     struct {
166       __be32 _sp_r_a_tov;
167     } sp_flogi_acc;
168   } sp_u;
169   __be32 sp_e_d_tov;
170 };
171 #define sp_tot_seq sp_u.sp_plogi._sp_tot_seq
172 #define sp_rel_off sp_u.sp_plogi._sp_rel_off
173 #define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov
174 #define FC_SP_BB_DATA_MASK 0xfff
175 #define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD
176 #define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD
177 #define FC_SP_FT_NPIV 0x8000
178 #define FC_SP_FT_CIRO 0x8000
179 #define FC_SP_FT_CLAD 0x8000
180 #define FC_SP_FT_RAND 0x4000
181 #define FC_SP_FT_VAL 0x2000
182 #define FC_SP_FT_NPIV_ACC 0x2000
183 #define FC_SP_FT_FPORT 0x1000
184 #define FC_SP_FT_ABB 0x0800
185 #define FC_SP_FT_EDTR 0x0400
186 #define FC_SP_FT_MCAST 0x0200
187 #define FC_SP_FT_BCAST 0x0100
188 #define FC_SP_FT_HUNT 0x0080
189 #define FC_SP_FT_SIMP 0x0040
190 #define FC_SP_FT_SEC 0x0020
191 #define FC_SP_FT_CSYN 0x0010
192 #define FC_SP_FT_RTTOV 0x0008
193 #define FC_SP_FT_HALF 0x0004
194 #define FC_SP_FT_SEQC 0x0002
195 #define FC_SP_FT_PAYL 0x0001
196 struct fc_els_cssp {
197   __be16 cp_class;
198   __be16 cp_init;
199   __be16 cp_recip;
200   __be16 cp_rdfs;
201   __be16 cp_con_seq;
202   __be16 cp_ee_cred;
203   __u8 cp_resv1;
204   __u8 cp_open_seq;
205   __u8 _cp_resv2[2];
206 };
207 #define FC_CPC_VALID 0x8000
208 #define FC_CPC_IMIX 0x4000
209 #define FC_CPC_SEQ 0x0800
210 #define FC_CPC_CAMP 0x0200
211 #define FC_CPC_PRI 0x0080
212 #define FC_CPI_CSYN 0x0010
213 #define FC_CPR_CSYN 0x0008
214 struct fc_els_flogi {
215   __u8 fl_cmd;
216   __u8 _fl_resvd[3];
217   struct fc_els_csp fl_csp;
218   __be64 fl_wwpn;
219   __be64 fl_wwnn;
220   struct fc_els_cssp fl_cssp[4];
221   __u8 fl_vend[16];
222 } __attribute__((__packed__));
223 struct fc_els_spp {
224   __u8 spp_type;
225   __u8 spp_type_ext;
226   __u8 spp_flags;
227   __u8 _spp_resvd;
228   __be32 spp_orig_pa;
229   __be32 spp_resp_pa;
230   __be32 spp_params;
231 };
232 #define FC_SPP_OPA_VAL 0x80
233 #define FC_SPP_RPA_VAL 0x40
234 #define FC_SPP_EST_IMG_PAIR 0x20
235 #define FC_SPP_RESP_MASK 0x0f
236 enum fc_els_spp_resp {
237   FC_SPP_RESP_ACK = 1,
238   FC_SPP_RESP_RES = 2,
239   FC_SPP_RESP_INIT = 3,
240   FC_SPP_RESP_NO_PA = 4,
241   FC_SPP_RESP_CONF = 5,
242   FC_SPP_RESP_COND = 6,
243   FC_SPP_RESP_MULT = 7,
244   FC_SPP_RESP_INVL = 8,
245 };
246 struct fc_els_rrq {
247   __u8 rrq_cmd;
248   __u8 rrq_zero[3];
249   __u8 rrq_resvd;
250   __u8 rrq_s_id[3];
251   __be16 rrq_ox_id;
252   __be16 rrq_rx_id;
253 };
254 struct fc_els_rec {
255   __u8 rec_cmd;
256   __u8 rec_zero[3];
257   __u8 rec_resvd;
258   __u8 rec_s_id[3];
259   __be16 rec_ox_id;
260   __be16 rec_rx_id;
261 };
262 struct fc_els_rec_acc {
263   __u8 reca_cmd;
264   __u8 reca_zero[3];
265   __be16 reca_ox_id;
266   __be16 reca_rx_id;
267   __u8 reca_resvd1;
268   __u8 reca_ofid[3];
269   __u8 reca_resvd2;
270   __u8 reca_rfid[3];
271   __be32 reca_fc4value;
272   __be32 reca_e_stat;
273 };
274 struct fc_els_prli {
275   __u8 prli_cmd;
276   __u8 prli_spp_len;
277   __be16 prli_len;
278 };
279 struct fc_els_prlo {
280   __u8 prlo_cmd;
281   __u8 prlo_obs;
282   __be16 prlo_len;
283 };
284 struct fc_els_adisc {
285   __u8 adisc_cmd;
286   __u8 adisc_resv[3];
287   __u8 adisc_resv1;
288   __u8 adisc_hard_addr[3];
289   __be64 adisc_wwpn;
290   __be64 adisc_wwnn;
291   __u8 adisc_resv2;
292   __u8 adisc_port_id[3];
293 } __attribute__((__packed__));
294 struct fc_els_logo {
295   __u8 fl_cmd;
296   __u8 fl_zero[3];
297   __u8 fl_resvd;
298   __u8 fl_n_port_id[3];
299   __be64 fl_n_port_wwn;
300 };
301 struct fc_els_rtv {
302   __u8 rtv_cmd;
303   __u8 rtv_zero[3];
304 };
305 struct fc_els_rtv_acc {
306   __u8 rtv_cmd;
307   __u8 rtv_zero[3];
308   __be32 rtv_r_a_tov;
309   __be32 rtv_e_d_tov;
310   __be32 rtv_toq;
311 };
312 #define FC_ELS_RTV_EDRES (1 << 26)
313 #define FC_ELS_RTV_RTTOV (1 << 19)
314 struct fc_els_scr {
315   __u8 scr_cmd;
316   __u8 scr_resv[6];
317   __u8 scr_reg_func;
318 };
319 enum fc_els_scr_func {
320   ELS_SCRF_FAB = 1,
321   ELS_SCRF_NPORT = 2,
322   ELS_SCRF_FULL = 3,
323   ELS_SCRF_CLEAR = 255,
324 };
325 struct fc_els_rscn {
326   __u8 rscn_cmd;
327   __u8 rscn_page_len;
328   __be16 rscn_plen;
329 };
330 struct fc_els_rscn_page {
331   __u8 rscn_page_flags;
332   __u8 rscn_fid[3];
333 };
334 #define ELS_RSCN_EV_QUAL_BIT 2
335 #define ELS_RSCN_EV_QUAL_MASK 0xf
336 #define ELS_RSCN_ADDR_FMT_BIT 0
337 #define ELS_RSCN_ADDR_FMT_MASK 0x3
338 enum fc_els_rscn_ev_qual {
339   ELS_EV_QUAL_NONE = 0,
340   ELS_EV_QUAL_NS_OBJ = 1,
341   ELS_EV_QUAL_PORT_ATTR = 2,
342   ELS_EV_QUAL_SERV_OBJ = 3,
343   ELS_EV_QUAL_SW_CONFIG = 4,
344   ELS_EV_QUAL_REM_OBJ = 5,
345 };
346 enum fc_els_rscn_addr_fmt {
347   ELS_ADDR_FMT_PORT = 0,
348   ELS_ADDR_FMT_AREA = 1,
349   ELS_ADDR_FMT_DOM = 2,
350   ELS_ADDR_FMT_FAB = 3,
351 };
352 struct fc_els_rnid {
353   __u8 rnid_cmd;
354   __u8 rnid_resv[3];
355   __u8 rnid_fmt;
356   __u8 rnid_resv2[3];
357 };
358 enum fc_els_rnid_fmt {
359   ELS_RNIDF_NONE = 0,
360   ELS_RNIDF_GEN = 0xdf,
361 };
362 struct fc_els_rnid_resp {
363   __u8 rnid_cmd;
364   __u8 rnid_resv[3];
365   __u8 rnid_fmt;
366   __u8 rnid_cid_len;
367   __u8 rnid_resv2;
368   __u8 rnid_sid_len;
369 };
370 struct fc_els_rnid_cid {
371   __be64 rnid_wwpn;
372   __be64 rnid_wwnn;
373 };
374 struct fc_els_rnid_gen {
375   __u8 rnid_vend_id[16];
376   __be32 rnid_atype;
377   __be32 rnid_phys_port;
378   __be32 rnid_att_nodes;
379   __u8 rnid_node_mgmt;
380   __u8 rnid_ip_ver;
381   __be16 rnid_prot_port;
382   __be32 rnid_ip_addr[4];
383   __u8 rnid_resvd[2];
384   __be16 rnid_vend_spec;
385 };
386 enum fc_els_rnid_atype {
387   ELS_RNIDA_UNK = 0x01,
388   ELS_RNIDA_OTHER = 0x02,
389   ELS_RNIDA_HUB = 0x03,
390   ELS_RNIDA_SWITCH = 0x04,
391   ELS_RNIDA_GATEWAY = 0x05,
392   ELS_RNIDA_CONV = 0x06,
393   ELS_RNIDA_HBA = 0x07,
394   ELS_RNIDA_PROXY = 0x08,
395   ELS_RNIDA_STORAGE = 0x09,
396   ELS_RNIDA_HOST = 0x0a,
397   ELS_RNIDA_SUBSYS = 0x0b,
398   ELS_RNIDA_ACCESS = 0x0e,
399   ELS_RNIDA_NAS = 0x11,
400   ELS_RNIDA_BRIDGE = 0x12,
401   ELS_RNIDA_VIRT = 0x13,
402   ELS_RNIDA_MF = 0xff,
403   ELS_RNIDA_MF_HUB = 1UL << 31,
404   ELS_RNIDA_MF_SW = 1UL << 30,
405   ELS_RNIDA_MF_GW = 1UL << 29,
406   ELS_RNIDA_MF_ST = 1UL << 28,
407   ELS_RNIDA_MF_HOST = 1UL << 27,
408   ELS_RNIDA_MF_SUB = 1UL << 26,
409   ELS_RNIDA_MF_ACC = 1UL << 25,
410   ELS_RNIDA_MF_WDM = 1UL << 24,
411   ELS_RNIDA_MF_NAS = 1UL << 23,
412   ELS_RNIDA_MF_BR = 1UL << 22,
413   ELS_RNIDA_MF_VIRT = 1UL << 21,
414 };
415 enum fc_els_rnid_mgmt {
416   ELS_RNIDM_SNMP = 0,
417   ELS_RNIDM_TELNET = 1,
418   ELS_RNIDM_HTTP = 2,
419   ELS_RNIDM_HTTPS = 3,
420   ELS_RNIDM_XML = 4,
421 };
422 enum fc_els_rnid_ipver {
423   ELS_RNIDIP_NONE = 0,
424   ELS_RNIDIP_V4 = 1,
425   ELS_RNIDIP_V6 = 2,
426 };
427 struct fc_els_rpl {
428   __u8 rpl_cmd;
429   __u8 rpl_resv[5];
430   __be16 rpl_max_size;
431   __u8 rpl_resv1;
432   __u8 rpl_index[3];
433 };
434 struct fc_els_pnb {
435   __be32 pnb_phys_pn;
436   __u8 pnb_resv;
437   __u8 pnb_port_id[3];
438   __be64 pnb_wwpn;
439 };
440 struct fc_els_rpl_resp {
441   __u8 rpl_cmd;
442   __u8 rpl_resv1;
443   __be16 rpl_plen;
444   __u8 rpl_resv2;
445   __u8 rpl_llen[3];
446   __u8 rpl_resv3;
447   __u8 rpl_index[3];
448   struct fc_els_pnb rpl_pnb[1];
449 };
450 struct fc_els_lesb {
451   __be32 lesb_link_fail;
452   __be32 lesb_sync_loss;
453   __be32 lesb_sig_loss;
454   __be32 lesb_prim_err;
455   __be32 lesb_inv_word;
456   __be32 lesb_inv_crc;
457 };
458 struct fc_els_rps {
459   __u8 rps_cmd;
460   __u8 rps_resv[2];
461   __u8 rps_flag;
462   __be64 rps_port_spec;
463 };
464 enum fc_els_rps_flag {
465   FC_ELS_RPS_DID = 0x00,
466   FC_ELS_RPS_PPN = 0x01,
467   FC_ELS_RPS_WWPN = 0x02,
468 };
469 struct fc_els_rps_resp {
470   __u8 rps_cmd;
471   __u8 rps_resv[2];
472   __u8 rps_flag;
473   __u8 rps_resv2[2];
474   __be16 rps_status;
475   struct fc_els_lesb rps_lesb;
476 };
477 enum fc_els_rps_resp_flag {
478   FC_ELS_RPS_LPEV = 0x01,
479 };
480 enum fc_els_rps_resp_status {
481   FC_ELS_RPS_PTP = 1 << 5,
482   FC_ELS_RPS_LOOP = 1 << 4,
483   FC_ELS_RPS_FAB = 1 << 3,
484   FC_ELS_RPS_NO_SIG = 1 << 2,
485   FC_ELS_RPS_NO_SYNC = 1 << 1,
486   FC_ELS_RPS_RESET = 1 << 0,
487 };
488 struct fc_els_lirr {
489   __u8 lirr_cmd;
490   __u8 lirr_resv[3];
491   __u8 lirr_func;
492   __u8 lirr_fmt;
493   __u8 lirr_resv2[2];
494 };
495 enum fc_els_lirr_func {
496   ELS_LIRR_SET_COND = 0x01,
497   ELS_LIRR_SET_UNCOND = 0x02,
498   ELS_LIRR_CLEAR = 0xff
499 };
500 struct fc_els_srl {
501   __u8 srl_cmd;
502   __u8 srl_resv[3];
503   __u8 srl_flag;
504   __u8 srl_flag_param[3];
505 };
506 enum fc_els_srl_flag {
507   FC_ELS_SRL_ALL = 0x00,
508   FC_ELS_SRL_ONE = 0x01,
509   FC_ELS_SRL_EN_PER = 0x02,
510   FC_ELS_SRL_DIS_PER = 0x03,
511 };
512 struct fc_els_rls {
513   __u8 rls_cmd;
514   __u8 rls_resv[4];
515   __u8 rls_port_id[3];
516 };
517 struct fc_els_rls_resp {
518   __u8 rls_cmd;
519   __u8 rls_resv[3];
520   struct fc_els_lesb rls_lesb;
521 };
522 struct fc_els_rlir {
523   __u8 rlir_cmd;
524   __u8 rlir_resv[3];
525   __u8 rlir_fmt;
526   __u8 rlir_clr_len;
527   __u8 rlir_cld_len;
528   __u8 rlir_slr_len;
529 };
530 struct fc_els_clir {
531   __be64 clir_wwpn;
532   __be64 clir_wwnn;
533   __u8 clir_port_type;
534   __u8 clir_port_id[3];
535   __be64 clir_conn_wwpn;
536   __be64 clir_conn_wwnn;
537   __be64 clir_fab_name;
538   __be32 clir_phys_port;
539   __be32 clir_trans_id;
540   __u8 clir_resv[3];
541   __u8 clir_ts_fmt;
542   __be64 clir_timestamp;
543 };
544 enum fc_els_clir_ts_fmt {
545   ELS_CLIR_TS_UNKNOWN = 0,
546   ELS_CLIR_TS_SEC_FRAC = 1,
547   ELS_CLIR_TS_CSU = 2,
548 };
549 struct fc_els_clid {
550   __u8 clid_iq;
551   __u8 clid_ic;
552   __be16 clid_epai;
553 };
554 enum fc_els_clid_iq {
555   ELS_CLID_SWITCH = 0x20,
556   ELS_CLID_E_PORT = 0x10,
557   ELS_CLID_SEV_MASK = 0x0c,
558   ELS_CLID_SEV_INFO = 0x00,
559   ELS_CLID_SEV_INOP = 0x08,
560   ELS_CLID_SEV_DEG = 0x04,
561   ELS_CLID_LASER = 0x02,
562   ELS_CLID_FRU = 0x01,
563 };
564 enum fc_els_clid_ic {
565   ELS_CLID_IC_IMPL = 1,
566   ELS_CLID_IC_BER = 2,
567   ELS_CLID_IC_LOS = 3,
568   ELS_CLID_IC_NOS = 4,
569   ELS_CLID_IC_PST = 5,
570   ELS_CLID_IC_INVAL = 6,
571   ELS_CLID_IC_LOOP_TO = 7,
572   ELS_CLID_IC_LIP = 8,
573 };
574 enum fc_fpin_li_event_types {
575   FPIN_LI_UNKNOWN = 0x0,
576   FPIN_LI_LINK_FAILURE = 0x1,
577   FPIN_LI_LOSS_OF_SYNC = 0x2,
578   FPIN_LI_LOSS_OF_SIG = 0x3,
579   FPIN_LI_PRIM_SEQ_ERR = 0x4,
580   FPIN_LI_INVALID_TX_WD = 0x5,
581   FPIN_LI_INVALID_CRC = 0x6,
582   FPIN_LI_DEVICE_SPEC = 0xF,
583 };
584 #define FC_FPIN_LI_EVT_TYPES_INIT { { FPIN_LI_UNKNOWN, "Unknown" }, { FPIN_LI_LINK_FAILURE, "Link Failure" }, { FPIN_LI_LOSS_OF_SYNC, "Loss of Synchronization" }, { FPIN_LI_LOSS_OF_SIG, "Loss of Signal" }, { FPIN_LI_PRIM_SEQ_ERR, "Primitive Sequence Protocol Error" }, { FPIN_LI_INVALID_TX_WD, "Invalid Transmission Word" }, { FPIN_LI_INVALID_CRC, "Invalid CRC" }, { FPIN_LI_DEVICE_SPEC, "Device Specific" }, \
585 }
586 struct fc_fn_li_desc {
587   __be32 desc_tag;
588   __be32 desc_len;
589   __be64 detecting_wwpn;
590   __be64 attached_wwpn;
591   __be16 event_type;
592   __be16 event_modifier;
593   __be32 event_threshold;
594   __be32 event_count;
595   __be32 pname_count;
596   __be64 pname_list[0];
597 };
598 struct fc_els_fpin {
599   __u8 fpin_cmd;
600   __u8 fpin_zero[3];
601   __be32 desc_len;
602   struct fc_tlv_desc fpin_desc[0];
603 };
604 struct fc_df_desc_fpin_reg {
605   __be32 desc_tag;
606   __be32 desc_len;
607   __be32 count;
608   __be32 desc_tags[0];
609 };
610 struct fc_els_rdf {
611   __u8 fpin_cmd;
612   __u8 fpin_zero[3];
613   __be32 desc_len;
614   struct fc_tlv_desc desc[0];
615 };
616 struct fc_els_rdf_resp {
617   struct fc_els_ls_acc acc_hdr;
618   __be32 desc_list_len;
619   struct fc_els_lsri_desc lsri;
620   struct fc_tlv_desc desc[0];
621 };
622 #endif
623