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