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