1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __BFA_DEFS_FCS_H__
19#define __BFA_DEFS_FCS_H__
20
21#include "bfa_fc.h"
22#include "bfa_defs_svc.h"
23
24
25
26
27enum bfa_vf_state {
28 BFA_VF_UNINIT = 0,
29 BFA_VF_LINK_DOWN = 1,
30 BFA_VF_FLOGI = 2,
31 BFA_VF_AUTH = 3,
32 BFA_VF_NOFABRIC = 4,
33 BFA_VF_ONLINE = 5,
34 BFA_VF_EVFP = 6,
35 BFA_VF_ISOLATED = 7,
36};
37
38
39
40
41struct bfa_vf_stats_s {
42 u32 flogi_sent;
43 u32 flogi_rsp_err;
44 u32 flogi_acc_err;
45 u32 flogi_accepts;
46 u32 flogi_rejects;
47 u32 flogi_unknown_rsp;
48 u32 flogi_alloc_wait;
49 u32 flogi_rcvd;
50 u32 flogi_rejected;
51 u32 fabric_onlines;
52
53 u32 fabric_offlines;
54
55 u32 resvd;
56};
57
58
59
60
61struct bfa_vf_attr_s {
62 enum bfa_vf_state state;
63 u32 rsvd;
64 wwn_t fabric_name;
65};
66
67#define BFA_FCS_MAX_LPORTS 256
68#define BFA_FCS_FABRIC_IPADDR_SZ 16
69
70
71
72
73#define BFA_SYMNAME_MAXLEN 128
74struct bfa_lport_symname_s {
75 char symname[BFA_SYMNAME_MAXLEN];
76};
77
78
79
80
81
82
83
84enum bfa_lport_role {
85 BFA_LPORT_ROLE_FCP_IM = 0x01,
86 BFA_LPORT_ROLE_FCP_MAX = BFA_LPORT_ROLE_FCP_IM,
87};
88
89
90
91
92struct bfa_lport_cfg_s {
93 wwn_t pwwn;
94 wwn_t nwwn;
95 struct bfa_lport_symname_s sym_name;
96 enum bfa_lport_role roles;
97 u32 rsvd;
98 bfa_boolean_t preboot_vp;
99 u8 tag[16];
100 u8 padding[4];
101};
102
103
104
105
106enum bfa_lport_state {
107 BFA_LPORT_UNINIT = 0,
108 BFA_LPORT_FDISC = 1,
109 BFA_LPORT_ONLINE = 2,
110 BFA_LPORT_OFFLINE = 3,
111};
112
113
114
115
116enum bfa_lport_type {
117 BFA_LPORT_TYPE_PHYSICAL = 0,
118 BFA_LPORT_TYPE_VIRTUAL,
119};
120
121
122
123
124enum bfa_lport_offline_reason {
125 BFA_LPORT_OFFLINE_UNKNOWN = 0,
126 BFA_LPORT_OFFLINE_LINKDOWN,
127 BFA_LPORT_OFFLINE_FAB_UNSUPPORTED,
128
129 BFA_LPORT_OFFLINE_FAB_NORESOURCES,
130 BFA_LPORT_OFFLINE_FAB_LOGOUT,
131};
132
133
134
135
136struct bfa_lport_info_s {
137 u8 port_type;
138
139 u8 port_state;
140 u8 offline_reason;
141
142 wwn_t port_wwn;
143 wwn_t node_wwn;
144
145
146
147
148 u32 max_vports_supp;
149 u32 num_vports_inuse;
150 u32 max_rports_supp;
151 u32 num_rports_inuse;
152
153};
154
155
156
157
158struct bfa_lport_stats_s {
159 u32 ns_plogi_sent;
160 u32 ns_plogi_rsp_err;
161 u32 ns_plogi_acc_err;
162 u32 ns_plogi_accepts;
163 u32 ns_rejects;
164 u32 ns_plogi_unknown_rsp;
165 u32 ns_plogi_alloc_wait;
166
167 u32 ns_retries;
168 u32 ns_timeouts;
169
170 u32 ns_rspnid_sent;
171 u32 ns_rspnid_accepts;
172 u32 ns_rspnid_rsp_err;
173 u32 ns_rspnid_rejects;
174 u32 ns_rspnid_alloc_wait;
175
176 u32 ns_rftid_sent;
177 u32 ns_rftid_accepts;
178 u32 ns_rftid_rsp_err;
179 u32 ns_rftid_rejects;
180 u32 ns_rftid_alloc_wait;
181
182 u32 ns_rffid_sent;
183 u32 ns_rffid_accepts;
184 u32 ns_rffid_rsp_err;
185 u32 ns_rffid_rejects;
186 u32 ns_rffid_alloc_wait;
187
188 u32 ns_gidft_sent;
189 u32 ns_gidft_accepts;
190 u32 ns_gidft_rsp_err;
191 u32 ns_gidft_rejects;
192 u32 ns_gidft_unknown_rsp;
193 u32 ns_gidft_alloc_wait;
194
195
196
197
198 u32 ms_retries;
199 u32 ms_timeouts;
200 u32 ms_plogi_sent;
201 u32 ms_plogi_rsp_err;
202 u32 ms_plogi_acc_err;
203 u32 ms_plogi_accepts;
204 u32 ms_rejects;
205 u32 ms_plogi_unknown_rsp;
206 u32 ms_plogi_alloc_wait;
207
208 u32 num_rscn;
209 u32 num_portid_rscn;
210
211
212 u32 uf_recvs;
213 u32 uf_recv_drops;
214
215 u32 plogi_rcvd;
216 u32 prli_rcvd;
217 u32 adisc_rcvd;
218 u32 prlo_rcvd;
219 u32 logo_rcvd;
220 u32 rpsc_rcvd;
221 u32 un_handled_els_rcvd;
222 u32 rport_plogi_timeouts;
223 u32 rport_del_max_plogi_retry;
224
225};
226
227
228
229
230struct bfa_lport_attr_s {
231 enum bfa_lport_state state;
232 u32 pid;
233 struct bfa_lport_cfg_s port_cfg;
234 enum bfa_port_type port_type;
235 u32 loopback;
236 wwn_t fabric_name;
237 u8 fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ];
238
239 mac_t fpma_mac;
240 u16 authfail;
241};
242
243
244
245
246
247enum bfa_vport_state {
248 BFA_FCS_VPORT_UNINIT = 0,
249 BFA_FCS_VPORT_CREATED = 1,
250 BFA_FCS_VPORT_OFFLINE = 1,
251 BFA_FCS_VPORT_FDISC_SEND = 2,
252 BFA_FCS_VPORT_FDISC = 3,
253 BFA_FCS_VPORT_FDISC_RETRY = 4,
254 BFA_FCS_VPORT_FDISC_RSP_WAIT = 5,
255 BFA_FCS_VPORT_ONLINE = 6,
256 BFA_FCS_VPORT_DELETING = 7,
257 BFA_FCS_VPORT_CLEANUP = 8,
258 BFA_FCS_VPORT_LOGO_SEND = 9,
259 BFA_FCS_VPORT_LOGO = 10,
260 BFA_FCS_VPORT_ERROR = 11,
261 BFA_FCS_VPORT_MAX_STATE,
262};
263
264
265
266
267struct bfa_vport_stats_s {
268 struct bfa_lport_stats_s port_stats;
269
270
271
272
273 u32 fdisc_sent;
274 u32 fdisc_accepts;
275 u32 fdisc_retries;
276 u32 fdisc_timeouts;
277 u32 fdisc_rsp_err;
278 u32 fdisc_acc_bad;
279 u32 fdisc_rejects;
280 u32 fdisc_unknown_rsp;
281
282
283
284 u32 fdisc_alloc_wait;
285
286 u32 logo_alloc_wait;
287 u32 logo_sent;
288 u32 logo_accepts;
289 u32 logo_rejects;
290 u32 logo_rsp_err;
291 u32 logo_unknown_rsp;
292
293
294 u32 fab_no_npiv;
295
296 u32 fab_offline;
297 u32 fab_online;
298 u32 fab_cleanup;
299 u32 rsvd;
300};
301
302
303
304
305struct bfa_vport_attr_s {
306 struct bfa_lport_attr_s port_attr;
307 enum bfa_vport_state vport_state;
308 u32 rsvd;
309};
310
311
312
313
314enum bfa_rport_state {
315 BFA_RPORT_UNINIT = 0,
316 BFA_RPORT_OFFLINE = 1,
317 BFA_RPORT_PLOGI = 2,
318 BFA_RPORT_ONLINE = 3,
319 BFA_RPORT_PLOGI_RETRY = 4,
320 BFA_RPORT_NSQUERY = 5,
321 BFA_RPORT_ADISC = 6,
322 BFA_RPORT_LOGO = 7,
323 BFA_RPORT_LOGORCV = 8,
324 BFA_RPORT_NSDISC = 9,
325};
326
327
328
329
330enum bfa_rport_function {
331 BFA_RPORT_INITIATOR = 0x01,
332 BFA_RPORT_TARGET = 0x02,
333};
334
335
336
337
338#define BFA_RPORT_SYMNAME_MAXLEN 255
339struct bfa_rport_symname_s {
340 char symname[BFA_RPORT_SYMNAME_MAXLEN];
341};
342
343
344
345
346struct bfa_rport_stats_s {
347 u32 offlines;
348 u32 onlines;
349 u32 rscns;
350 u32 plogis;
351 u32 plogi_accs;
352 u32 plogi_timeouts;
353 u32 plogi_rejects;
354 u32 plogi_failed;
355 u32 plogi_rcvd;
356 u32 prli_rcvd;
357 u32 adisc_rcvd;
358 u32 adisc_rejects;
359 u32 adisc_sent;
360 u32 adisc_accs;
361 u32 adisc_failed;
362 u32 adisc_rejected;
363 u32 logos;
364 u32 logo_accs;
365 u32 logo_failed;
366 u32 logo_rejected;
367 u32 logo_rcvd;
368
369 u32 rpsc_rcvd;
370 u32 rpsc_rejects;
371 u32 rpsc_sent;
372 u32 rpsc_accs;
373 u32 rpsc_failed;
374 u32 rpsc_rejected;
375
376 u32 rjt_insuff_res;
377 struct bfa_rport_hal_stats_s hal_stats;
378};
379
380
381
382
383struct bfa_rport_attr_s {
384 wwn_t nwwn;
385 wwn_t pwwn;
386 enum fc_cos cos_supported;
387 u32 pid;
388 u32 df_sz;
389 enum bfa_rport_state state;
390 enum fc_cos fc_cos;
391 bfa_boolean_t cisc;
392 struct bfa_rport_symname_s symname;
393 enum bfa_rport_function scsi_function;
394 struct bfa_rport_qos_attr_s qos_attr;
395 enum bfa_port_speed curr_speed;
396
397
398 bfa_boolean_t trl_enforced;
399 enum bfa_port_speed assigned_speed;
400
401
402};
403
404struct bfa_rport_remote_link_stats_s {
405 u32 lfc;
406 u32 lsyc;
407 u32 lsic;
408 u32 pspec;
409 u32 itwc;
410 u32 icc;
411};
412
413
414#define BFA_MAX_IO_INDEX 7
415#define BFA_NO_IO_INDEX 9
416
417
418
419
420enum bfa_itnim_state {
421 BFA_ITNIM_OFFLINE = 0,
422 BFA_ITNIM_PRLI_SEND = 1,
423 BFA_ITNIM_PRLI_SENT = 2,
424 BFA_ITNIM_PRLI_RETRY = 3,
425 BFA_ITNIM_HCB_ONLINE = 4,
426 BFA_ITNIM_ONLINE = 5,
427 BFA_ITNIM_HCB_OFFLINE = 6,
428 BFA_ITNIM_INITIATIOR = 7,
429};
430
431
432
433
434struct bfa_itnim_stats_s {
435 u32 onlines;
436 u32 offlines;
437 u32 prli_sent;
438 u32 fcxp_alloc_wait;
439 u32 prli_rsp_err;
440 u32 prli_rsp_acc;
441 u32 initiator;
442 u32 prli_rsp_parse_err;
443 u32 prli_rsp_rjt;
444 u32 timeout;
445 u32 sler;
446 u32 rsvd;
447};
448
449
450
451
452struct bfa_itnim_attr_s {
453 enum bfa_itnim_state state;
454 u8 retry;
455 u8 task_retry_id;
456 u8 rec_support;
457 u8 conf_comp;
458};
459
460#endif
461