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