1
2
3
4
5
6
7
8
9
10
11 #ifndef __BFA_DEFS_CNA_H__
12 #define __BFA_DEFS_CNA_H__
13
14 #include "bfa_defs.h"
15
16
17 struct bfa_port_fc_stats {
18 u64 secs_reset;
19 u64 tx_frames;
20 u64 tx_words;
21 u64 tx_lip;
22 u64 tx_nos;
23 u64 tx_ols;
24 u64 tx_lr;
25 u64 tx_lrr;
26 u64 rx_frames;
27 u64 rx_words;
28 u64 lip_count;
29 u64 nos_count;
30 u64 ols_count;
31 u64 lr_count;
32 u64 lrr_count;
33 u64 invalid_crcs;
34 u64 invalid_crc_gd_eof;
35 u64 undersized_frm;
36 u64 oversized_frm;
37 u64 bad_eof_frm;
38 u64 error_frames;
39 u64 dropped_frames;
40 u64 link_failures;
41 u64 loss_of_syncs;
42 u64 loss_of_signals;
43 u64 primseq_errs;
44 u64 bad_os_count;
45 u64 err_enc_out;
46 u64 err_enc;
47 u64 bbsc_frames_lost;
48 u64 bbsc_credits_lost;
49 u64 bbsc_link_resets;
50 };
51
52
53 struct bfa_port_eth_stats {
54 u64 secs_reset;
55 u64 frame_64;
56 u64 frame_65_127;
57 u64 frame_128_255;
58 u64 frame_256_511;
59 u64 frame_512_1023;
60 u64 frame_1024_1518;
61 u64 frame_1519_1522;
62 u64 tx_bytes;
63 u64 tx_packets;
64 u64 tx_mcast_packets;
65 u64 tx_bcast_packets;
66 u64 tx_control_frame;
67 u64 tx_drop;
68 u64 tx_jabber;
69 u64 tx_fcs_error;
70 u64 tx_fragments;
71 u64 rx_bytes;
72 u64 rx_packets;
73 u64 rx_mcast_packets;
74 u64 rx_bcast_packets;
75 u64 rx_control_frames;
76 u64 rx_unknown_opcode;
77 u64 rx_drop;
78 u64 rx_jabber;
79 u64 rx_fcs_error;
80 u64 rx_alignment_error;
81 u64 rx_frame_length_error;
82 u64 rx_code_error;
83 u64 rx_fragments;
84 u64 rx_pause;
85 u64 rx_zero_pause;
86 u64 tx_pause;
87 u64 tx_zero_pause;
88 u64 rx_fcoe_pause;
89 u64 rx_fcoe_zero_pause;
90 u64 tx_fcoe_pause;
91 u64 tx_fcoe_zero_pause;
92 u64 rx_iscsi_pause;
93 u64 rx_iscsi_zero_pause;
94 u64 tx_iscsi_pause;
95 u64 tx_iscsi_zero_pause;
96 };
97
98
99 union bfa_port_stats_u {
100 struct bfa_port_fc_stats fc;
101 struct bfa_port_eth_stats eth;
102 };
103
104 #define BFA_CEE_LLDP_MAX_STRING_LEN (128)
105 #define BFA_CEE_DCBX_MAX_PRIORITY (8)
106 #define BFA_CEE_DCBX_MAX_PGID (8)
107
108 #define BFA_CEE_LLDP_SYS_CAP_OTHER 0x0001
109 #define BFA_CEE_LLDP_SYS_CAP_REPEATER 0x0002
110 #define BFA_CEE_LLDP_SYS_CAP_MAC_BRIDGE 0x0004
111 #define BFA_CEE_LLDP_SYS_CAP_WLAN_AP 0x0008
112 #define BFA_CEE_LLDP_SYS_CAP_ROUTER 0x0010
113 #define BFA_CEE_LLDP_SYS_CAP_TELEPHONE 0x0020
114 #define BFA_CEE_LLDP_SYS_CAP_DOCSIS_CD 0x0040
115 #define BFA_CEE_LLDP_SYS_CAP_STATION 0x0080
116 #define BFA_CEE_LLDP_SYS_CAP_CVLAN 0x0100
117 #define BFA_CEE_LLDP_SYS_CAP_SVLAN 0x0200
118 #define BFA_CEE_LLDP_SYS_CAP_TPMR 0x0400
119
120
121 struct bfa_cee_lldp_str {
122 u8 sub_type;
123 u8 len;
124 u8 rsvd[2];
125 u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
126 } __packed;
127
128
129 struct bfa_cee_lldp_cfg {
130 struct bfa_cee_lldp_str chassis_id;
131 struct bfa_cee_lldp_str port_id;
132 struct bfa_cee_lldp_str port_desc;
133 struct bfa_cee_lldp_str sys_name;
134 struct bfa_cee_lldp_str sys_desc;
135 struct bfa_cee_lldp_str mgmt_addr;
136 u16 time_to_live;
137 u16 enabled_system_cap;
138 } __packed;
139
140 enum bfa_cee_dcbx_version {
141 DCBX_PROTOCOL_PRECEE = 1,
142 DCBX_PROTOCOL_CEE = 2,
143 };
144
145 enum bfa_cee_lls {
146
147 CEE_LLS_DOWN_NO_TLV = 0,
148
149 CEE_LLS_DOWN = 1,
150 CEE_LLS_UP = 2,
151 };
152
153
154 struct bfa_cee_dcbx_cfg {
155 u8 pgid[BFA_CEE_DCBX_MAX_PRIORITY];
156 u8 pg_percentage[BFA_CEE_DCBX_MAX_PGID];
157 u8 pfc_primap;
158 u8 fcoe_primap;
159 u8 iscsi_primap;
160 u8 dcbx_version;
161 u8 lls_fcoe;
162 u8 lls_lan;
163 u8 rsvd[2];
164 } __packed;
165
166
167
168 enum bfa_cee_status {
169 CEE_UP = 0,
170 CEE_PHY_UP = 1,
171 CEE_LOOPBACK = 2,
172 CEE_PHY_DOWN = 3,
173 };
174
175
176 struct bfa_cee_attr {
177 u8 cee_status;
178 u8 error_reason;
179 struct bfa_cee_lldp_cfg lldp_remote;
180 struct bfa_cee_dcbx_cfg dcbx_remote;
181 u8 src_mac[ETH_ALEN];
182 u8 link_speed;
183 u8 nw_priority;
184 u8 filler[2];
185 } __packed;
186
187
188 struct bfa_cee_stats {
189 u32 lldp_tx_frames;
190 u32 lldp_rx_frames;
191 u32 lldp_rx_frames_invalid;
192 u32 lldp_rx_frames_new;
193 u32 lldp_tlvs_unrecognized;
194 u32 lldp_rx_shutdown_tlvs;
195 u32 lldp_info_aged_out;
196 u32 dcbx_phylink_ups;
197 u32 dcbx_phylink_downs;
198 u32 dcbx_rx_tlvs;
199 u32 dcbx_rx_tlvs_invalid;
200 u32 dcbx_control_tlv_error;
201 u32 dcbx_feature_tlv_error;
202 u32 dcbx_cee_cfg_new;
203 u32 cee_status_down;
204 u32 cee_status_up;
205 u32 cee_hw_cfg_changed;
206 u32 cee_rx_invalid_cfg;
207 } __packed;
208
209 #endif