1
2
3
4
5
6
7
8
9
10
11 #ifndef __BFA_DEFS_SVC_H__
12 #define __BFA_DEFS_SVC_H__
13
14 #include "bfa_defs.h"
15 #include "bfa_fc.h"
16 #include "bfi.h"
17
18 #define BFA_IOCFC_INTR_DELAY 1125
19 #define BFA_IOCFC_INTR_LATENCY 225
20 #define BFA_IOCFCOE_INTR_DELAY 25
21 #define BFA_IOCFCOE_INTR_LATENCY 5
22
23
24
25
26 #pragma pack(1)
27 struct bfa_iocfc_intr_attr_s {
28 u8 coalesce;
29 u8 rsvd[3];
30 __be16 latency;
31 __be16 delay;
32 };
33
34
35
36
37 struct bfa_iocfc_fwcfg_s {
38 u16 num_fabrics;
39 u16 num_lports;
40 u16 num_rports;
41 u16 num_ioim_reqs;
42 u16 num_tskim_reqs;
43 u16 num_fwtio_reqs;
44 u16 num_fcxp_reqs;
45 u16 num_uf_bufs;
46 u8 num_cqs;
47 u8 fw_tick_res;
48 u8 rsvd[6];
49 };
50 #pragma pack()
51
52 struct bfa_iocfc_drvcfg_s {
53 u16 num_reqq_elems;
54 u16 num_rspq_elems;
55 u16 num_sgpgs;
56 u16 num_sboot_tgts;
57 u16 num_sboot_luns;
58 u16 ioc_recover;
59 u16 min_cfg;
60 u16 path_tov;
61 u16 num_tio_reqs;
62 u8 port_mode;
63 u8 rsvd_a;
64 bfa_boolean_t delay_comp;
65
66 u16 num_ttsk_reqs;
67 u32 rsvd;
68 };
69
70
71
72
73 struct bfa_iocfc_cfg_s {
74 struct bfa_iocfc_fwcfg_s fwcfg;
75 struct bfa_iocfc_drvcfg_s drvcfg;
76 };
77
78
79
80
81 struct bfa_fw_ioim_stats_s {
82 u32 host_abort;
83 u32 host_cleanup;
84
85 u32 fw_io_timeout;
86 u32 fw_frm_parse;
87 u32 fw_frm_data;
88 u32 fw_frm_rsp;
89 u32 fw_frm_xfer_rdy;
90 u32 fw_frm_bls_acc;
91 u32 fw_frm_tgt_abort;
92 u32 fw_frm_unknown;
93 u32 fw_data_dma;
94 u32 fw_frm_drop;
95
96 u32 rec_timeout;
97 u32 error_rec;
98
99 u32 wait_for_si;
100 u32 rec_rsp_inval;
101 u32 rec_rsp_xchg_comp;
102 u32 rec_rsp_rd_si_ownd;
103
104 u32 seqr_io_abort;
105 u32 seqr_io_retry;
106
107 u32 itn_cisc_upd_rsp;
108 u32 itn_cisc_upd_data;
109 u32 itn_cisc_upd_xfer_rdy;
110
111 u32 fcp_data_lost;
112
113 u32 ro_set_in_xfer_rdy;
114 u32 xfer_rdy_ooo_err;
115 u32 xfer_rdy_unknown_err;
116
117 u32 io_abort_timeout;
118 u32 sler_initiated;
119
120 u32 unexp_fcp_rsp;
121
122 u32 fcp_rsp_under_run;
123 u32 fcp_rsp_under_run_wr;
124 u32 fcp_rsp_under_run_err;
125 u32 fcp_rsp_resid_inval;
126 u32 fcp_rsp_over_run;
127 u32 fcp_rsp_over_run_err;
128 u32 fcp_rsp_proto_err;
129 u32 fcp_rsp_sense_err;
130 u32 fcp_conf_req;
131
132 u32 tgt_aborted_io;
133
134 u32 ioh_edtov_timeout_event;
135 u32 ioh_fcp_rsp_excp_event;
136 u32 ioh_fcp_conf_event;
137 u32 ioh_mult_frm_rsp_event;
138 u32 ioh_hit_class2_event;
139 u32 ioh_miss_other_event;
140 u32 ioh_seq_cnt_err_event;
141 u32 ioh_len_err_event;
142
143 u32 ioh_seq_len_err_event;
144 u32 ioh_data_oor_event;
145 u32 ioh_ro_ooo_event;
146 u32 ioh_cpu_owned_event;
147 u32 ioh_unexp_frame_event;
148
149 u32 ioh_err_int;
150
151 };
152
153 struct bfa_fw_tio_stats_s {
154 u32 tio_conf_proc;
155 u32 tio_conf_drop;
156 u32 tio_cleanup_req;
157 u32 tio_cleanup_comp;
158 u32 tio_abort_rsp;
159 u32 tio_abort_rsp_comp;
160 u32 tio_abts_req;
161 u32 tio_abts_ack;
162 u32 tio_abts_ack_nocomp;
163 u32 tio_abts_tmo;
164 u32 tio_snsdata_dma;
165 u32 tio_rxwchan_wait;
166 u32 tio_rxwchan_avail;
167 u32 tio_hit_bls;
168 u32 tio_uf_recv;
169 u32 tio_rd_invalid_sm;
170 u32 tio_wr_invalid_sm;
171
172 u32 ds_rxwchan_wait;
173 u32 ds_rxwchan_avail;
174 u32 ds_unaligned_rd;
175 u32 ds_rdcomp_invalid_sm;
176
177 u32 ds_wrcomp_invalid_sm;
178
179 u32 ds_flush_req;
180 u32 ds_flush_comp;
181 u32 ds_xfrdy_exp;
182 u32 ds_seq_cnt_err;
183 u32 ds_seq_len_err;
184 u32 ds_data_oor;
185 u32 ds_hit_bls;
186 u32 ds_edtov_timer_exp;
187 u32 ds_cpu_owned;
188 u32 ds_hit_class2;
189 u32 ds_length_err;
190 u32 ds_ro_ooo_err;
191 u32 ds_rectov_timer_exp;
192 u32 ds_unexp_fr_err;
193 };
194
195
196
197
198 struct bfa_fw_io_stats_s {
199 struct bfa_fw_ioim_stats_s ioim_stats;
200 struct bfa_fw_tio_stats_s tio_stats;
201 };
202
203
204
205
206
207 struct bfa_fw_port_fpg_stats_s {
208 u32 intr_evt;
209 u32 intr;
210 u32 intr_excess;
211 u32 intr_cause0;
212 u32 intr_other;
213 u32 intr_other_ign;
214 u32 sig_lost;
215 u32 sig_regained;
216 u32 sync_lost;
217 u32 sync_to;
218 u32 sync_regained;
219 u32 div2_overflow;
220 u32 div2_underflow;
221 u32 efifo_overflow;
222 u32 efifo_underflow;
223 u32 idle_rx;
224 u32 lrr_rx;
225 u32 lr_rx;
226 u32 ols_rx;
227 u32 nos_rx;
228 u32 lip_rx;
229 u32 arbf0_rx;
230 u32 arb_rx;
231 u32 mrk_rx;
232 u32 const_mrk_rx;
233 u32 prim_unknown;
234 };
235
236
237 struct bfa_fw_port_lksm_stats_s {
238 u32 hwsm_success;
239 u32 hwsm_fails;
240 u32 hwsm_wdtov;
241 u32 swsm_success;
242 u32 swsm_fails;
243 u32 swsm_wdtov;
244 u32 busybufs;
245 u32 buf_waits;
246 u32 link_fails;
247 u32 psp_errors;
248 u32 lr_unexp;
249 u32 lrr_unexp;
250 u32 lr_tx;
251 u32 lrr_tx;
252 u32 ols_tx;
253 u32 nos_tx;
254 u32 hwsm_lrr_rx;
255 u32 hwsm_lr_rx;
256 };
257
258 struct bfa_fw_port_snsm_stats_s {
259 u32 hwsm_success;
260 u32 hwsm_fails;
261 u32 hwsm_wdtov;
262 u32 swsm_success;
263 u32 swsm_wdtov;
264 u32 error_resets;
265 u32 sync_lost;
266 u32 sig_lost;
267 u32 asn8g_attempts;
268 u32 adapt_success;
269 u32 adapt_fails;
270 u32 adapt_ign_fails;
271 };
272
273 struct bfa_fw_port_physm_stats_s {
274 u32 module_inserts;
275 u32 module_xtracts;
276 u32 module_invalids;
277 u32 module_read_ign;
278 u32 laser_faults;
279 u32 rsvd;
280 };
281
282 struct bfa_fw_fip_stats_s {
283 u32 vlan_req;
284 u32 vlan_notify;
285 u32 vlan_err;
286 u32 vlan_timeouts;
287 u32 vlan_invalids;
288 u32 disc_req;
289 u32 disc_rsp;
290 u32 disc_err;
291 u32 disc_unsol;
292 u32 disc_timeouts;
293 u32 disc_fcf_unavail;
294 u32 linksvc_unsupp;
295 u32 linksvc_err;
296 u32 logo_req;
297 u32 clrvlink_req;
298 u32 op_unsupp;
299 u32 untagged;
300 u32 invalid_version;
301 };
302
303 struct bfa_fw_lps_stats_s {
304 u32 mac_invalids;
305 u32 rsvd;
306 };
307
308 struct bfa_fw_fcoe_stats_s {
309 u32 cee_linkups;
310 u32 cee_linkdns;
311 u32 fip_linkups;
312 u32 fip_linkdns;
313 u32 fip_fails;
314 u32 mac_invalids;
315 };
316
317
318
319
320 struct bfa_fw_fcoe_port_stats_s {
321 struct bfa_fw_fcoe_stats_s fcoe_stats;
322 struct bfa_fw_fip_stats_s fip_stats;
323 };
324
325
326
327
328 struct bfa_fw_lpsm_stats_s {
329 u32 cls_rx;
330 u32 cls_tx;
331 u32 arbf0_rx;
332 u32 arbf0_tx;
333 u32 init_rx;
334 u32 unexp_hwst;
335 u32 unexp_frame;
336 u32 unexp_prim;
337 u32 prev_alpa_unavail;
338 u32 alpa_unavail;
339 u32 lip_rx;
340 u32 lip_f7f7_rx;
341 u32 lip_f8_rx;
342 u32 lip_f8f7_rx;
343 u32 lip_other_rx;
344 u32 lip_tx;
345 u32 retry_tov;
346 u32 lip_tov;
347 u32 idle_tov;
348 u32 arbf0_tov;
349 u32 stop_loop_tov;
350 u32 lixa_tov;
351 u32 lixx_tov;
352 u32 cls_tov;
353 u32 sler;
354 u32 failed;
355 u32 success;
356 };
357
358
359
360
361 struct bfa_fw_fc_uport_stats_s {
362 struct bfa_fw_port_snsm_stats_s snsm_stats;
363 struct bfa_fw_port_lksm_stats_s lksm_stats;
364 struct bfa_fw_lpsm_stats_s lpsm_stats;
365 };
366
367
368
369
370 union bfa_fw_fc_port_stats_s {
371 struct bfa_fw_fc_uport_stats_s fc_stats;
372 struct bfa_fw_fcoe_port_stats_s fcoe_stats;
373 };
374
375
376
377
378 struct bfa_fw_port_stats_s {
379 struct bfa_fw_port_fpg_stats_s fpg_stats;
380 struct bfa_fw_port_physm_stats_s physm_stats;
381 union bfa_fw_fc_port_stats_s fc_port;
382 };
383
384
385
386
387 struct bfa_fw_fcxchg_stats_s {
388 u32 ua_tag_inv;
389 u32 ua_state_inv;
390 };
391
392
393
394
395 struct bfa_fw_trunk_stats_s {
396 u32 emt_recvd;
397 u32 emt_accepted;
398 u32 emt_rejected;
399 u32 etp_recvd;
400 u32 etp_accepted;
401 u32 etp_rejected;
402 u32 lr_recvd;
403 u32 rsvd;
404 };
405
406 struct bfa_fw_aport_stats_s {
407 u32 flogi_sent;
408 u32 flogi_acc_recvd;
409 u32 flogi_rjt_recvd;
410 u32 flogi_retries;
411
412 u32 elp_recvd;
413 u32 elp_accepted;
414 u32 elp_rejected;
415 u32 elp_dropped;
416
417 u32 bbcr_lr_count;
418 u32 frame_lost_intrs;
419 u32 rrdy_lost_intrs;
420
421 u32 rsvd;
422 };
423
424
425
426
427 struct bfa_fw_iocfc_stats_s {
428 u32 cfg_reqs;
429 u32 updq_reqs;
430 u32 ic_reqs;
431 u32 unknown_reqs;
432 u32 set_intr_reqs;
433 };
434
435
436
437
438 struct bfa_iocfc_attr_s {
439 struct bfa_iocfc_cfg_s config;
440 struct bfa_iocfc_intr_attr_s intr_attr;
441 };
442
443
444
445
446 struct bfa_fw_eth_sndrcv_stats_s {
447 u32 crc_err;
448 u32 rsvd;
449 };
450
451
452
453
454 struct bfa_fw_mac_mod_stats_s {
455 u32 mac_on;
456 u32 link_up;
457 u32 signal_off;
458 u32 dfe_on;
459 u32 mac_reset;
460 u32 pcs_reset;
461 u32 loopback;
462 u32 lb_mac_reset;
463
464 u32 lb_pcs_reset;
465
466 u32 rsvd;
467 };
468
469
470
471
472 struct bfa_fw_ct_mod_stats_s {
473 u32 rxa_rds_undrun;
474 u32 rad_bpc_ovfl;
475 u32 rad_rlb_bpc_ovfl;
476 u32 bpc_fcs_err;
477 u32 txa_tso_hdr;
478 u32 rsvd;
479 };
480
481
482
483
484 struct bfa_fw_rds_stats_s {
485 u32 no_fid_drop_err;
486 u32 rsvd;
487 };
488
489
490
491
492 struct bfa_fw_stats_s {
493 struct bfa_fw_ioc_stats_s ioc_stats;
494 struct bfa_fw_iocfc_stats_s iocfc_stats;
495 struct bfa_fw_io_stats_s io_stats;
496 struct bfa_fw_port_stats_s port_stats;
497 struct bfa_fw_fcxchg_stats_s fcxchg_stats;
498 struct bfa_fw_lps_stats_s lps_stats;
499 struct bfa_fw_trunk_stats_s trunk_stats;
500 struct bfa_fw_aport_stats_s aport_stats;
501 struct bfa_fw_mac_mod_stats_s macmod_stats;
502 struct bfa_fw_ct_mod_stats_s ctmod_stats;
503 struct bfa_fw_eth_sndrcv_stats_s ethsndrcv_stats;
504 struct bfa_fw_rds_stats_s rds_stats;
505 };
506
507 #define BFA_IOCFC_PATHTOV_MAX 60
508 #define BFA_IOCFC_QDEPTH_MAX 2000
509
510
511
512
513 enum bfa_qos_state {
514 BFA_QOS_DISABLED = 0,
515 BFA_QOS_ONLINE = 1,
516 BFA_QOS_OFFLINE = 2,
517 };
518
519
520
521
522 enum bfa_qos_priority {
523 BFA_QOS_UNKNOWN = 0,
524 BFA_QOS_HIGH = 1,
525 BFA_QOS_MED = 2,
526 BFA_QOS_LOW = 3,
527 };
528
529
530
531
532 enum bfa_qos_bw_alloc {
533 BFA_QOS_BW_HIGH = 60,
534 BFA_QOS_BW_MED = 30,
535 BFA_QOS_BW_LOW = 10,
536 };
537 #pragma pack(1)
538
539 struct bfa_qos_bw_s {
540 u8 qos_bw_set;
541 u8 high;
542 u8 med;
543 u8 low;
544 };
545
546
547
548
549 struct bfa_qos_attr_s {
550 u8 state;
551 u8 rsvd1[3];
552 u32 total_bb_cr;
553 struct bfa_qos_bw_s qos_bw;
554 struct bfa_qos_bw_s qos_bw_op;
555 };
556
557 enum bfa_bbcr_state {
558 BFA_BBCR_DISABLED,
559 BFA_BBCR_ONLINE,
560 BFA_BBCR_OFFLINE,
561 };
562
563 enum bfa_bbcr_err_reason {
564 BFA_BBCR_ERR_REASON_NONE,
565 BFA_BBCR_ERR_REASON_SPEED_UNSUP,
566 BFA_BBCR_ERR_REASON_PEER_UNSUP,
567 BFA_BBCR_ERR_REASON_NON_BRCD_SW,
568 BFA_BBCR_ERR_REASON_FLOGI_RJT,
569 };
570
571 struct bfa_bbcr_attr_s {
572 u8 state;
573 u8 peer_bb_scn;
574 u8 reason;
575 u8 rsvd;
576 };
577
578
579
580
581
582
583
584 #define BFA_QOS_MAX_VC 16
585
586 struct bfa_qos_vc_info_s {
587 u8 vc_credit;
588 u8 borrow_credit;
589 u8 priority;
590 u8 resvd;
591 };
592
593 struct bfa_qos_vc_attr_s {
594 u16 total_vc_count;
595 u16 shared_credit;
596 u32 elp_opmode_flags;
597 struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC];
598
599 };
600
601
602
603
604 struct bfa_qos_stats_s {
605 u32 flogi_sent;
606 u32 flogi_acc_recvd;
607 u32 flogi_rjt_recvd;
608 u32 flogi_retries;
609
610 u32 elp_recvd;
611 u32 elp_accepted;
612 u32 elp_rejected;
613 u32 elp_dropped;
614
615 u32 qos_rscn_recvd;
616 u32 rsvd;
617 };
618
619
620
621
622 struct bfa_fcoe_stats_s {
623 u64 secs_reset;
624 u64 cee_linkups;
625 u64 cee_linkdns;
626 u64 fip_linkups;
627 u64 fip_linkdns;
628 u64 fip_fails;
629 u64 mac_invalids;
630 u64 vlan_req;
631 u64 vlan_notify;
632 u64 vlan_err;
633 u64 vlan_timeouts;
634 u64 vlan_invalids;
635 u64 disc_req;
636 u64 disc_rsp;
637 u64 disc_err;
638 u64 disc_unsol;
639 u64 disc_timeouts;
640 u64 disc_fcf_unavail;
641 u64 linksvc_unsupp;
642 u64 linksvc_err;
643 u64 logo_req;
644 u64 clrvlink_req;
645 u64 op_unsupp;
646 u64 untagged;
647 u64 txf_ucast;
648 u64 txf_ucast_vlan;
649 u64 txf_ucast_octets;
650 u64 txf_mcast;
651 u64 txf_mcast_vlan;
652 u64 txf_mcast_octets;
653 u64 txf_bcast;
654 u64 txf_bcast_vlan;
655 u64 txf_bcast_octets;
656 u64 txf_timeout;
657 u64 txf_parity_errors;
658 u64 txf_fid_parity_errors;
659 u64 rxf_ucast_octets;
660 u64 rxf_ucast;
661 u64 rxf_ucast_vlan;
662 u64 rxf_mcast_octets;
663 u64 rxf_mcast;
664 u64 rxf_mcast_vlan;
665 u64 rxf_bcast_octets;
666 u64 rxf_bcast;
667 u64 rxf_bcast_vlan;
668 };
669
670
671
672
673 union bfa_fcport_stats_u {
674 struct bfa_qos_stats_s fcqos;
675 struct bfa_fcoe_stats_s fcoe;
676 };
677 #pragma pack()
678
679 struct bfa_fcpim_del_itn_stats_s {
680 u32 del_itn_iocomp_aborted;
681 u32 del_itn_iocomp_timedout;
682 u32 del_itn_iocom_sqer_needed;
683 u32 del_itn_iocom_res_free;
684 u32 del_itn_iocom_hostabrts;
685 u32 del_itn_total_ios;
686 u32 del_io_iocdowns;
687 u32 del_tm_iocdowns;
688 };
689
690 struct bfa_itnim_iostats_s {
691
692 u32 total_ios;
693 u32 input_reqs;
694 u32 output_reqs;
695 u32 io_comps;
696 u32 wr_throughput;
697 u32 rd_throughput;
698
699 u32 iocomp_ok;
700 u32 iocomp_underrun;
701 u32 iocomp_overrun;
702 u32 qwait;
703 u32 qresumes;
704 u32 no_iotags;
705 u32 iocomp_timedout;
706 u32 iocom_nexus_abort;
707 u32 iocom_proto_err;
708 u32 iocom_dif_err;
709
710 u32 iocom_sqer_needed;
711 u32 iocom_res_free;
712
713
714 u32 io_aborts;
715 u32 iocom_hostabrts;
716 u32 io_cleanups;
717 u32 path_tov_expired;
718 u32 iocomp_aborted;
719 u32 io_iocdowns;
720 u32 iocom_utags;
721
722 u32 io_tmaborts;
723 u32 tm_io_comps;
724
725 u32 creates;
726 u32 fw_create;
727 u32 create_comps;
728 u32 onlines;
729 u32 offlines;
730 u32 fw_delete;
731 u32 delete_comps;
732 u32 deletes;
733 u32 sler_events;
734 u32 ioc_disabled;
735 u32 cleanup_comps;
736
737 u32 tm_cmnds;
738 u32 tm_fw_rsps;
739 u32 tm_success;
740 u32 tm_failures;
741 u32 no_tskims;
742 u32 tm_qwait;
743 u32 tm_qresumes;
744
745 u32 tm_iocdowns;
746 u32 tm_cleanups;
747 u32 tm_cleanup_comps;
748 u32 rsvd[6];
749 };
750
751
752 enum bfa_port_states {
753 BFA_PORT_ST_UNINIT = 1,
754 BFA_PORT_ST_ENABLING_QWAIT = 2,
755 BFA_PORT_ST_ENABLING = 3,
756 BFA_PORT_ST_LINKDOWN = 4,
757 BFA_PORT_ST_LINKUP = 5,
758 BFA_PORT_ST_DISABLING_QWAIT = 6,
759 BFA_PORT_ST_DISABLING = 7,
760 BFA_PORT_ST_DISABLED = 8,
761 BFA_PORT_ST_STOPPED = 9,
762 BFA_PORT_ST_IOCDOWN = 10,
763 BFA_PORT_ST_IOCDIS = 11,
764 BFA_PORT_ST_FWMISMATCH = 12,
765 BFA_PORT_ST_PREBOOT_DISABLED = 13,
766 BFA_PORT_ST_TOGGLING_QWAIT = 14,
767 BFA_PORT_ST_FAA_MISCONFIG = 15,
768 BFA_PORT_ST_DPORT = 16,
769 BFA_PORT_ST_DDPORT = 17,
770 BFA_PORT_ST_MAX_STATE,
771 };
772
773
774
775
776 enum bfa_port_type {
777 BFA_PORT_TYPE_UNKNOWN = 1,
778 BFA_PORT_TYPE_NPORT = 5,
779 BFA_PORT_TYPE_NLPORT = 6,
780 BFA_PORT_TYPE_LPORT = 20,
781 BFA_PORT_TYPE_P2P = 21,
782 BFA_PORT_TYPE_VPORT = 22,
783 };
784
785
786
787
788
789 enum bfa_port_topology {
790 BFA_PORT_TOPOLOGY_NONE = 0,
791 BFA_PORT_TOPOLOGY_P2P_OLD_VER = 1,
792 BFA_PORT_TOPOLOGY_LOOP = 2,
793 BFA_PORT_TOPOLOGY_AUTO_OLD_VER = 3,
794 BFA_PORT_TOPOLOGY_AUTO = 4,
795 BFA_PORT_TOPOLOGY_P2P = 5,
796 };
797
798
799
800
801 enum bfa_port_opmode {
802 BFA_PORT_OPMODE_NORMAL = 0x00,
803 BFA_PORT_OPMODE_LB_INT = 0x01,
804 BFA_PORT_OPMODE_LB_SLW = 0x02,
805 BFA_PORT_OPMODE_LB_EXT = 0x04,
806 BFA_PORT_OPMODE_LB_CBL = 0x08,
807 BFA_PORT_OPMODE_LB_NLINT = 0x20,
808 };
809
810 #define BFA_PORT_OPMODE_LB_HARD(_mode) \
811 ((_mode == BFA_PORT_OPMODE_LB_INT) || \
812 (_mode == BFA_PORT_OPMODE_LB_SLW) || \
813 (_mode == BFA_PORT_OPMODE_LB_EXT))
814
815
816
817
818 enum bfa_port_linkstate {
819 BFA_PORT_LINKUP = 1,
820 BFA_PORT_LINKDOWN = 2,
821 };
822
823
824
825
826 enum bfa_port_linkstate_rsn {
827 BFA_PORT_LINKSTATE_RSN_NONE = 0,
828 BFA_PORT_LINKSTATE_RSN_DISABLED = 1,
829 BFA_PORT_LINKSTATE_RSN_RX_NOS = 2,
830 BFA_PORT_LINKSTATE_RSN_RX_OLS = 3,
831 BFA_PORT_LINKSTATE_RSN_RX_LIP = 4,
832 BFA_PORT_LINKSTATE_RSN_RX_LIPF7 = 5,
833 BFA_PORT_LINKSTATE_RSN_SFP_REMOVED = 6,
834 BFA_PORT_LINKSTATE_RSN_PORT_FAULT = 7,
835 BFA_PORT_LINKSTATE_RSN_RX_LOS = 8,
836 BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT = 9,
837 BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT = 10,
838 BFA_PORT_LINKSTATE_RSN_TIMEOUT = 11,
839 BFA_PORT_LINKSTATE_RSN_FAA_MISCONFIG = 12,
840
841
842
843
844 CEE_LLDP_INFO_AGED_OUT = 20,
845 CEE_LLDP_SHUTDOWN_TLV_RCVD = 21,
846 CEE_PEER_NOT_ADVERTISE_DCBX = 22,
847 CEE_PEER_NOT_ADVERTISE_PG = 23,
848 CEE_PEER_NOT_ADVERTISE_PFC = 24,
849 CEE_PEER_NOT_ADVERTISE_FCOE = 25,
850 CEE_PG_NOT_COMPATIBLE = 26,
851 CEE_PFC_NOT_COMPATIBLE = 27,
852 CEE_FCOE_NOT_COMPATIBLE = 28,
853 CEE_BAD_PG_RCVD = 29,
854 CEE_BAD_BW_RCVD = 30,
855 CEE_BAD_PFC_RCVD = 31,
856 CEE_BAD_APP_PRI_RCVD = 32,
857 CEE_FCOE_PRI_PFC_OFF = 33,
858 CEE_DUP_CONTROL_TLV_RCVD = 34,
859 CEE_DUP_FEAT_TLV_RCVD = 35,
860 CEE_APPLY_NEW_CFG = 36,
861 CEE_PROTOCOL_INIT = 37,
862 CEE_PHY_LINK_DOWN = 38,
863 CEE_LLS_FCOE_ABSENT = 39,
864 CEE_LLS_FCOE_DOWN = 40,
865 CEE_ISCSI_NOT_COMPATIBLE = 41,
866 CEE_ISCSI_PRI_PFC_OFF = 42,
867 CEE_ISCSI_PRI_OVERLAP_FCOE_PRI = 43
868 };
869
870 #define MAX_LUN_MASK_CFG 16
871
872
873
874
875
876
877
878 enum bfa_ioim_lun_mask_state_s {
879 BFA_IOIM_LUN_MASK_INACTIVE = 0,
880 BFA_IOIM_LUN_MASK_ACTIVE = 1,
881 BFA_IOIM_LUN_MASK_FETCHED = 2,
882 };
883
884 enum bfa_lunmask_state_s {
885 BFA_LUNMASK_DISABLED = 0x00,
886 BFA_LUNMASK_ENABLED = 0x01,
887 BFA_LUNMASK_MINCFG = 0x02,
888 BFA_LUNMASK_UNINITIALIZED = 0xff,
889 };
890
891
892
893
894 enum bfa_fec_state_s {
895 BFA_FEC_ONLINE = 1,
896 BFA_FEC_OFFLINE = 2,
897 BFA_FEC_OFFLINE_NOT_16G = 3,
898 };
899
900 #pragma pack(1)
901
902
903
904 struct bfa_lun_mask_s {
905 wwn_t lp_wwn;
906 wwn_t rp_wwn;
907 struct scsi_lun lun;
908 u8 ua;
909 u8 rsvd[3];
910 u16 rp_tag;
911 u8 lp_tag;
912 u8 state;
913 };
914
915 #define MAX_LUN_MASK_CFG 16
916 struct bfa_lunmask_cfg_s {
917 u32 status;
918 u32 rsvd;
919 struct bfa_lun_mask_s lun_list[MAX_LUN_MASK_CFG];
920 };
921
922 struct bfa_throttle_cfg_s {
923 u16 is_valid;
924 u16 value;
925 u32 rsvd;
926 };
927
928 struct bfa_defs_fcpim_throttle_s {
929 u16 max_value;
930 u16 cur_value;
931 u16 cfg_value;
932 u16 rsvd;
933 };
934
935 #define BFA_BB_SCN_DEF 3
936 #define BFA_BB_SCN_MAX 0x0F
937
938
939
940
941 struct bfa_port_cfg_s {
942 u8 topology;
943 u8 speed;
944 u8 trunked;
945 u8 qos_enabled;
946 u8 cfg_hardalpa;
947 u8 hardalpa;
948 __be16 maxfrsize;
949 u8 rx_bbcredit;
950 u8 tx_bbcredit;
951 u8 ratelimit;
952 u8 trl_def_speed;
953 u8 bb_cr_enabled;
954 u8 bb_scn;
955 u8 faa_state;
956 u8 rsvd1;
957 u16 path_tov;
958 u16 q_depth;
959 struct bfa_qos_bw_s qos_bw;
960 };
961 #pragma pack()
962
963
964
965
966 struct bfa_port_attr_s {
967
968
969
970 wwn_t nwwn;
971 wwn_t pwwn;
972 wwn_t factorynwwn;
973 wwn_t factorypwwn;
974 enum fc_cos cos_supported;
975
976 u32 rsvd;
977 struct fc_symname_s port_symname;
978 enum bfa_port_speed speed_supported;
979 bfa_boolean_t pbind_enabled;
980
981
982
983
984 struct bfa_port_cfg_s pport_cfg;
985
986
987
988
989 enum bfa_port_states port_state;
990 enum bfa_port_speed speed;
991 enum bfa_port_topology topology;
992 bfa_boolean_t beacon;
993 bfa_boolean_t link_e2e_beacon;
994 bfa_boolean_t bbsc_op_status;
995
996 enum bfa_fec_state_s fec_state;
997
998
999
1000
1001 u32 pid;
1002 enum bfa_port_type port_type;
1003 u32 loopback;
1004 u32 authfail;
1005
1006
1007 u16 fcoe_vlan;
1008 u8 rsvd1[2];
1009 };
1010
1011
1012
1013
1014 struct bfa_port_fcpmap_s {
1015 char osdevname[256];
1016 u32 bus;
1017 u32 target;
1018 u32 oslun;
1019 u32 fcid;
1020 wwn_t nwwn;
1021 wwn_t pwwn;
1022 u64 fcplun;
1023 char luid[256];
1024 };
1025
1026
1027
1028
1029 struct bfa_port_rnid_s {
1030 wwn_t wwn;
1031 u32 unittype;
1032 u32 portid;
1033 u32 attached_nodes_num;
1034 u16 ip_version;
1035 u16 udp_port;
1036 u8 ipaddr[16];
1037 u16 rsvd;
1038 u16 topologydiscoveryflags;
1039 };
1040
1041 #pragma pack(1)
1042 struct bfa_fcport_fcf_s {
1043 wwn_t name;
1044 wwn_t fabric_name;
1045 u8 fipenabled;
1046 u8 fipfailed;
1047 u8 resv[2];
1048 u8 pri;
1049 u8 version;
1050 u8 available;
1051 u8 fka_disabled;
1052 u8 maxsz_verified;
1053 u8 fc_map[3];
1054 __be16 vlan;
1055 u32 fka_adv_per;
1056 mac_t mac;
1057 };
1058
1059
1060
1061
1062 enum bfa_trunk_state {
1063 BFA_TRUNK_DISABLED = 0,
1064 BFA_TRUNK_ONLINE = 1,
1065 BFA_TRUNK_OFFLINE = 2,
1066 };
1067
1068
1069
1070
1071 struct bfa_trunk_vc_attr_s {
1072 u32 bb_credit;
1073 u32 elp_opmode_flags;
1074 u32 req_credit;
1075 u16 vc_credits[8];
1076 };
1077
1078 struct bfa_fcport_loop_info_s {
1079 u8 myalpa;
1080 u8 alpabm_val;
1081 u8 resvd[6];
1082 struct fc_alpabm_s alpabm;
1083 };
1084
1085
1086
1087
1088 struct bfa_port_link_s {
1089 u8 linkstate;
1090 u8 linkstate_rsn;
1091 u8 topology;
1092 u8 speed;
1093 u32 linkstate_opt;
1094 u8 trunked;
1095 u8 fec_state;
1096 u8 resvd[6];
1097 struct bfa_qos_attr_s qos_attr;
1098 union {
1099 struct bfa_fcport_loop_info_s loop_info;
1100 struct bfa_bbcr_attr_s bbcr_attr;
1101 union {
1102 struct bfa_qos_vc_attr_s qos_vc_attr;
1103
1104 struct bfa_trunk_vc_attr_s trunk_vc_attr;
1105 struct bfa_fcport_fcf_s fcf;
1106
1107 } vc_fcf;
1108 } attr;
1109 };
1110 #pragma pack()
1111
1112 enum bfa_trunk_link_fctl {
1113 BFA_TRUNK_LINK_FCTL_NORMAL,
1114 BFA_TRUNK_LINK_FCTL_VC,
1115 BFA_TRUNK_LINK_FCTL_VC_QOS,
1116 };
1117
1118 enum bfa_trunk_link_state {
1119 BFA_TRUNK_LINK_STATE_UP = 1,
1120 BFA_TRUNK_LINK_STATE_DN_LINKDN = 2,
1121 BFA_TRUNK_LINK_STATE_DN_GRP_MIS = 3,
1122 BFA_TRUNK_LINK_STATE_DN_SPD_MIS = 4,
1123 BFA_TRUNK_LINK_STATE_DN_MODE_MIS = 5,
1124 };
1125
1126 #define BFA_TRUNK_MAX_PORTS 2
1127 struct bfa_trunk_link_attr_s {
1128 wwn_t trunk_wwn;
1129 enum bfa_trunk_link_fctl fctl;
1130 enum bfa_trunk_link_state link_state;
1131 enum bfa_port_speed speed;
1132 u32 deskew;
1133 };
1134
1135 struct bfa_trunk_attr_s {
1136 enum bfa_trunk_state state;
1137 enum bfa_port_speed speed;
1138 u32 port_id;
1139 u32 rsvd;
1140 struct bfa_trunk_link_attr_s link_attr[BFA_TRUNK_MAX_PORTS];
1141 };
1142
1143 struct bfa_rport_hal_stats_s {
1144 u32 sm_un_cr;
1145 u32 sm_un_unexp;
1146 u32 sm_cr_on;
1147 u32 sm_cr_del;
1148 u32 sm_cr_hwf;
1149 u32 sm_cr_unexp;
1150 u32 sm_fwc_rsp;
1151 u32 sm_fwc_del;
1152 u32 sm_fwc_off;
1153 u32 sm_fwc_hwf;
1154 u32 sm_fwc_unexp;
1155 u32 sm_on_off;
1156 u32 sm_on_del;
1157 u32 sm_on_hwf;
1158 u32 sm_on_unexp;
1159 u32 sm_fwd_rsp;
1160 u32 sm_fwd_del;
1161 u32 sm_fwd_hwf;
1162 u32 sm_fwd_unexp;
1163 u32 sm_off_del;
1164 u32 sm_off_on;
1165 u32 sm_off_hwf;
1166 u32 sm_off_unexp;
1167 u32 sm_del_fwrsp;
1168 u32 sm_del_hwf;
1169 u32 sm_del_unexp;
1170 u32 sm_delp_fwrsp;
1171 u32 sm_delp_hwf;
1172 u32 sm_delp_unexp;
1173 u32 sm_offp_fwrsp;
1174 u32 sm_offp_del;
1175 u32 sm_offp_hwf;
1176 u32 sm_offp_unexp;
1177 u32 sm_iocd_off;
1178 u32 sm_iocd_del;
1179 u32 sm_iocd_on;
1180 u32 sm_iocd_unexp;
1181 u32 rsvd;
1182 };
1183 #pragma pack(1)
1184
1185
1186
1187 struct bfa_rport_qos_attr_s {
1188 u8 qos_priority;
1189 u8 rsvd[3];
1190 u32 qos_flow_id;
1191 };
1192 #pragma pack()
1193
1194 #define BFA_IOBUCKET_MAX 14
1195
1196 struct bfa_itnim_latency_s {
1197 u32 min[BFA_IOBUCKET_MAX];
1198 u32 max[BFA_IOBUCKET_MAX];
1199 u32 count[BFA_IOBUCKET_MAX];
1200 u32 avg[BFA_IOBUCKET_MAX];
1201 };
1202
1203 struct bfa_itnim_ioprofile_s {
1204 u32 clock_res_mul;
1205 u32 clock_res_div;
1206 u32 index;
1207 u32 io_profile_start_time;
1208 u32 iocomps[BFA_IOBUCKET_MAX];
1209 struct bfa_itnim_latency_s io_latency;
1210 };
1211
1212
1213
1214
1215 struct bfa_vhba_attr_s {
1216 wwn_t nwwn;
1217 wwn_t pwwn;
1218 u32 pid;
1219 bfa_boolean_t io_profile;
1220 bfa_boolean_t plog_enabled;
1221 u16 path_tov;
1222 u8 rsvd[2];
1223 };
1224
1225
1226
1227
1228 struct bfa_port_fc_stats_s {
1229 u64 secs_reset;
1230 u64 tx_frames;
1231 u64 tx_words;
1232 u64 tx_lip;
1233 u64 tx_lip_f7f7;
1234 u64 tx_lip_f8f7;
1235 u64 tx_arbf0;
1236 u64 tx_nos;
1237 u64 tx_ols;
1238 u64 tx_lr;
1239 u64 tx_lrr;
1240 u64 rx_frames;
1241 u64 rx_words;
1242 u64 lip_count;
1243 u64 rx_lip_f7f7;
1244 u64 rx_lip_f8f7;
1245 u64 rx_arbf0;
1246 u64 nos_count;
1247 u64 ols_count;
1248 u64 lr_count;
1249 u64 lrr_count;
1250 u64 invalid_crcs;
1251 u64 invalid_crc_gd_eof;
1252 u64 undersized_frm;
1253 u64 oversized_frm;
1254 u64 bad_eof_frm;
1255 u64 error_frames;
1256 u64 dropped_frames;
1257 u64 link_failures;
1258 u64 loss_of_syncs;
1259 u64 loss_of_signals;
1260 u64 primseq_errs;
1261 u64 bad_os_count;
1262 u64 err_enc_out;
1263 u64 err_enc;
1264 u64 bbcr_frames_lost;
1265 u64 bbcr_rrdys_lost;
1266 u64 bbcr_link_resets;
1267 u64 bbcr_frame_lost_intrs;
1268 u64 bbcr_rrdy_lost_intrs;
1269 u64 loop_timeouts;
1270 };
1271
1272
1273
1274
1275 struct bfa_port_eth_stats_s {
1276 u64 secs_reset;
1277 u64 frame_64;
1278 u64 frame_65_127;
1279 u64 frame_128_255;
1280 u64 frame_256_511;
1281 u64 frame_512_1023;
1282 u64 frame_1024_1518;
1283 u64 frame_1519_1522;
1284 u64 tx_bytes;
1285 u64 tx_packets;
1286 u64 tx_mcast_packets;
1287 u64 tx_bcast_packets;
1288 u64 tx_control_frame;
1289 u64 tx_drop;
1290 u64 tx_jabber;
1291 u64 tx_fcs_error;
1292 u64 tx_fragments;
1293 u64 rx_bytes;
1294 u64 rx_packets;
1295 u64 rx_mcast_packets;
1296 u64 rx_bcast_packets;
1297 u64 rx_control_frames;
1298 u64 rx_unknown_opcode;
1299 u64 rx_drop;
1300 u64 rx_jabber;
1301 u64 rx_fcs_error;
1302 u64 rx_alignment_error;
1303 u64 rx_frame_length_error;
1304 u64 rx_code_error;
1305 u64 rx_fragments;
1306 u64 rx_pause;
1307 u64 rx_zero_pause;
1308 u64 tx_pause;
1309 u64 tx_zero_pause;
1310 u64 rx_fcoe_pause;
1311 u64 rx_fcoe_zero_pause;
1312 u64 tx_fcoe_pause;
1313 u64 tx_fcoe_zero_pause;
1314 u64 rx_iscsi_pause;
1315 u64 rx_iscsi_zero_pause;
1316 u64 tx_iscsi_pause;
1317 u64 tx_iscsi_zero_pause;
1318 };
1319
1320
1321
1322
1323 union bfa_port_stats_u {
1324 struct bfa_port_fc_stats_s fc;
1325 struct bfa_port_eth_stats_s eth;
1326 };
1327
1328 struct bfa_port_cfg_mode_s {
1329 u16 max_pf;
1330 u16 max_vf;
1331 enum bfa_mode_s mode;
1332 };
1333
1334 #pragma pack(1)
1335
1336 #define BFA_CEE_LLDP_MAX_STRING_LEN (128)
1337 #define BFA_CEE_DCBX_MAX_PRIORITY (8)
1338 #define BFA_CEE_DCBX_MAX_PGID (8)
1339
1340 struct bfa_cee_lldp_str_s {
1341 u8 sub_type;
1342 u8 len;
1343 u8 rsvd[2];
1344 u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
1345 };
1346
1347 struct bfa_cee_lldp_cfg_s {
1348 struct bfa_cee_lldp_str_s chassis_id;
1349 struct bfa_cee_lldp_str_s port_id;
1350 struct bfa_cee_lldp_str_s port_desc;
1351 struct bfa_cee_lldp_str_s sys_name;
1352 struct bfa_cee_lldp_str_s sys_desc;
1353 struct bfa_cee_lldp_str_s mgmt_addr;
1354 u16 time_to_live;
1355 u16 enabled_system_cap;
1356 };
1357
1358
1359 struct bfa_cee_dcbx_cfg_s {
1360 u8 pgid[BFA_CEE_DCBX_MAX_PRIORITY];
1361 u8 pg_percentage[BFA_CEE_DCBX_MAX_PGID];
1362 u8 pfc_primap;
1363 u8 fcoe_primap;
1364 u8 iscsi_primap;
1365 u8 dcbx_version;
1366 u8 lls_fcoe;
1367 u8 lls_lan;
1368 u8 rsvd[2];
1369 };
1370
1371
1372 struct bfa_cee_attr_s {
1373 u8 cee_status;
1374 u8 error_reason;
1375 struct bfa_cee_lldp_cfg_s lldp_remote;
1376 struct bfa_cee_dcbx_cfg_s dcbx_remote;
1377 mac_t src_mac;
1378 u8 link_speed;
1379 u8 nw_priority;
1380 u8 filler[2];
1381 };
1382
1383
1384 struct bfa_cee_stats_s {
1385 u32 lldp_tx_frames;
1386 u32 lldp_rx_frames;
1387 u32 lldp_rx_frames_invalid;
1388 u32 lldp_rx_frames_new;
1389 u32 lldp_tlvs_unrecognized;
1390 u32 lldp_rx_shutdown_tlvs;
1391 u32 lldp_info_aged_out;
1392 u32 dcbx_phylink_ups;
1393 u32 dcbx_phylink_downs;
1394 u32 dcbx_rx_tlvs;
1395 u32 dcbx_rx_tlvs_invalid;
1396 u32 dcbx_control_tlv_error;
1397 u32 dcbx_feature_tlv_error;
1398 u32 dcbx_cee_cfg_new;
1399 u32 cee_status_down;
1400 u32 cee_status_up;
1401 u32 cee_hw_cfg_changed;
1402 u32 cee_rx_invalid_cfg;
1403 };
1404
1405 #pragma pack()
1406
1407
1408
1409
1410 #define BFAD_NL_VENDOR_ID (((u64)0x01 << SCSI_NL_VID_TYPE_SHIFT) \
1411 | BFA_PCI_VENDOR_ID_BROCADE)
1412
1413
1414 enum bfa_rport_aen_event {
1415 BFA_RPORT_AEN_ONLINE = 1,
1416 BFA_RPORT_AEN_OFFLINE = 2,
1417 BFA_RPORT_AEN_DISCONNECT = 3,
1418 BFA_RPORT_AEN_QOS_PRIO = 4,
1419 BFA_RPORT_AEN_QOS_FLOWID = 5,
1420 };
1421
1422 struct bfa_rport_aen_data_s {
1423 u16 vf_id;
1424 u16 rsvd[3];
1425 wwn_t ppwwn;
1426 wwn_t lpwwn;
1427 wwn_t rpwwn;
1428 union {
1429 struct bfa_rport_qos_attr_s qos;
1430 } priv;
1431 };
1432
1433 union bfa_aen_data_u {
1434 struct bfa_adapter_aen_data_s adapter;
1435 struct bfa_port_aen_data_s port;
1436 struct bfa_lport_aen_data_s lport;
1437 struct bfa_rport_aen_data_s rport;
1438 struct bfa_itnim_aen_data_s itnim;
1439 struct bfa_audit_aen_data_s audit;
1440 struct bfa_ioc_aen_data_s ioc;
1441 };
1442
1443 #define BFA_AEN_MAX_ENTRY 512
1444
1445 struct bfa_aen_entry_s {
1446 struct list_head qe;
1447 enum bfa_aen_category aen_category;
1448 int aen_type;
1449 union bfa_aen_data_u aen_data;
1450 u64 aen_tv_sec;
1451 u64 aen_tv_usec;
1452 u32 seq_num;
1453 u32 bfad_num;
1454 };
1455
1456 #endif