xgehal-stats.h revision 330897
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2002-2007 Neterion, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: stable/11/sys/dev/nxge/include/xgehal-stats.h 330897 2018-03-14 03:19:51Z eadler $
29 */
30
31#ifndef XGE_HAL_STATS_H
32#define XGE_HAL_STATS_H
33
34#include <dev/nxge/include/xge-os-pal.h>
35#include <dev/nxge/include/xge-debug.h>
36#include <dev/nxge/include/xgehal-types.h>
37#include <dev/nxge/include/xgehal-config.h>
38
39__EXTERN_BEGIN_DECLS
40
41/**
42 * struct xge_hal_stats_hw_info_t - Xframe hardware statistics.
43 * Transmit MAC Statistics:
44 *
45 * @tmac_frms: Count of successfully transmitted MAC
46 * frames Note that this statistic may be inaccurate. The correct statistic may
47 * be derived by calcualating (tmac_ttl_octets - tmac_ttl_less_fb_octets) / 8
48 *
49 * @tmac_data_octets: Count of data and padding octets of successfully
50 * transmitted frames.
51 *
52 * @tmac_drop_frms: Count of frames that could not be sent for no other reason
53 * than internal MAC processing. Increments once whenever the
54 * transmit buffer is flushed (due to an ECC error on a memory descriptor).
55 *
56 * @tmac_mcst_frms: Count of successfully transmitted frames to a multicast
57 * address. Does not include frames sent to the broadcast address.
58 *
59 * @tmac_bcst_frms: Count of successfully transmitted frames to the broadcast
60 * address.
61 *
62 * @tmac_pause_ctrl_frms: Count of MAC PAUSE control frames that are
63 * transmitted. Since, the only control frames supported by this device
64 * are PAUSE frames, this register is a count of all transmitted MAC control
65 * frames.
66 *
67 * @tmac_ttl_octets: Count of total octets of transmitted frames, including
68 * framing characters.
69 *
70 * @tmac_ucst_frms: Count of transmitted frames containing a unicast address.
71 * @tmac_nucst_frms: Count of transmitted frames containing a non-unicast
72 * (broadcast, multicast) address.
73 *
74 * @tmac_any_err_frms: Count of transmitted frames containing any error that
75 * prevents them from being passed to the network. Increments if there is an ECC
76 * while reading the frame out of the transmit buffer.
77 *
78 * @tmac_ttl_less_fb_octets: Count of total octets of transmitted
79 * frames, not including framing characters (i.e. less framing bits)
80 *
81 * @tmac_vld_ip_octets: Count of total octets of transmitted IP datagrams that
82 * were passed to the network. Frames that are padded by the host have
83 * their padding counted as part of the IP datagram.
84 *
85 * @tmac_vld_ip: Count of transmitted IP datagrams that were passed to the
86 * network.
87 *
88 * @tmac_drop_ip: Count of transmitted IP datagrams that could not be passed to
89 * the network. Increments because of 1) an internal processing error (such as
90 * an uncorrectable ECC error); 2) a frame parsing error during IP checksum
91 * calculation.
92 *
93 * @tmac_icmp: Count of transmitted ICMP messages. Includes messages not sent
94 * due to problems within ICMP.
95 *
96 * @tmac_rst_tcp: Count of transmitted TCP segments containing the RST flag.
97 *
98 * @tmac_tcp: Count of transmitted TCP segments. Note that Xena has
99 * no knowledge of retransmission.
100 *
101 * @tmac_udp: Count of transmitted UDP datagrams.
102 * @reserved_0: Reserved.
103 *
104 * Receive MAC Statistics:
105 * @rmac_vld_frms: Count of successfully received MAC frames. Does not include
106 * frames received with frame-too-long, FCS, or length errors.
107 *
108 * @rmac_data_octets: Count of data and padding octets of successfully received
109 * frames. Does not include frames received with frame-too-long, FCS, or length
110 * errors.
111 *
112 * @rmac_fcs_err_frms: Count of received MAC frames that do not pass FCS. Does
113 * not include frames received with frame-too-long or frame-too-short error.
114 *
115 * @rmac_drop_frms: Count of received frames that could not be passed to the
116 * host because of 1) Random Early Discard (RED); 2) Frame steering algorithm
117 * found no available queue; 3) Receive ingress buffer overflow.
118 *
119 * @rmac_vld_mcst_frms: Count of successfully received MAC frames containing a
120 * multicast address. Does not include frames received with frame-too-long, FCS,
121 * or length errors.
122 *
123 * @rmac_vld_bcst_frms: Count of successfully received MAC frames containing a
124 * broadcast address. Does not include frames received with frame-too-long, FCS,
125 * or length errors.
126 *
127 * @rmac_in_rng_len_err_frms: Count of received frames with a length/type field
128 * value between 46 (42 for VLANtagged frames) and 1500 (also 1500 for
129 * VLAN-tagged frames), inclusive, that does not match the number of data octets
130 * (including pad) received. Also contains a count of received frames with a
131 * length/type field less than 46 (42 for VLAN-tagged frames) and the number of
132 * data octets (including pad) received is greater than 46 (42 for VLAN-tagged
133 * frames).
134 *
135 * @rmac_out_rng_len_err_frms: Count of received frames with length/type field
136 * between 1501 and 1535 decimal, inclusive.
137 *
138 * @rmac_long_frms: Count of received frames that are longer than
139 * rmac_max_pyld_len + 18 bytes (+22 bytes if VLAN-tagged).
140 *
141 * @rmac_pause_ctrl_frms: Count of received MAC PAUSE control frames.
142 *
143 * @rmac_unsup_ctrl_frms: Count of received MAC control frames
144 * that do not contain the PAUSE opcode. The sum of MAC_PAUSE_CTRL_FRMS and this
145 * register is a count of all received MAC control frames.
146 *
147 * @rmac_ttl_octets: Count of total octets of received frames, including framing
148 * characters.
149 *
150 * @rmac_accepted_ucst_frms: Count of successfully received frames
151 * containing a unicast address. Only includes frames that are passed to the
152 * system.
153 *
154 * @rmac_accepted_nucst_frms: Count of successfully received frames
155 * containing a non-unicast (broadcast or multicast) address. Only includes
156 * frames that are passed to the system. Could include, for instance,
157 * non-unicast frames that contain FCS errors if the MAC_ERROR_CFG register is
158 * set to pass FCSerrored frames to the host.
159 *
160 * @rmac_discarded_frms: Count of received frames containing any error that
161 * prevents them from being passed to the system. Includes, for example,
162 * received pause frames that are discarded by the MAC and frames discarded
163 * because of their destination address.
164 *
165 * @rmac_drop_events: Because the RMAC drops one frame at a time, this stat
166 * matches rmac_drop_frms.
167 *
168 * @reserved_1: Reserved.
169 * @rmac_ttl_less_fb_octets: Count of total octets of received frames,
170 * not including framing characters (i.e. less framing bits).
171 *
172 * @rmac_ttl_frms: Count of all received MAC frames, including frames received
173 * with frame-too-long, FCS, or length errors.
174 *
175 * @reserved_2: Reserved.
176 * @reserved_3: Reserved.
177 * @rmac_usized_frms: Count of received frames of length (including FCS, but not
178 * framing bits) less than 64 octets, that are otherwise well-formed.
179 *
180 * @rmac_osized_frms: Count of received frames of length (including FCS, but not
181 * framing bits) more than 1518 octets, that are otherwise well-formed.
182 *
183 * @rmac_frag_frms: Count of received frames of length (including FCS, but not
184 * framing bits) less than 64 octets that had bad FCS. In other words, counts
185 * fragments (i.e. runts).
186 *
187 * @rmac_jabber_frms: Count of received frames of length (including FCS, but not
188 * framing bits) more than MTU octets that had bad FCS. In other words, counts
189 * jabbers.
190 *
191 * @reserved_4: Reserved.
192 * @rmac_ttl_64_frms: Count of all received MAC frames with length (including
193 * FCS, but not framing bits) of exactly 64 octets. Includes frames received
194 * with frame-too-long, FCS, or length errors.
195 *
196 * @rmac_ttl_65_127_frms: Count of all received MAC frames with length
197 * (including FCS, but not framing bits) of between 65 and 127 octets
198 * inclusive. Includes frames received with frame-too-long, FCS, or length
199 * errors.
200 * @reserved_5: Reserved.
201 * @rmac_ttl_128_255_frms: Count of all received MAC frames with length
202 * (including FCS, but not framing bits) of between 128 and 255 octets
203 * inclusive. Includes frames received with frame-too-long, FCS, or length
204 * errors.
205 *
206 * @rmac_ttl_256_511_frms: Count of all received MAC frames with length
207 * (including FCS, but not framing bits) of between 256 and 511 octets
208 * inclusive. Includes frames received with frame-too-long, FCS, or length
209 * errors.
210 *
211 * @reserved_6: Reserved.
212 * @rmac_ttl_512_1023_frms: Count of all received MAC frames with length
213 * (including FCS, but not framing bits) of between 512 and 1023 octets
214 * inclusive. Includes frames received with frame-too-long, FCS, or length
215 * errors.
216 *
217 * @rmac_ttl_1024_1518_frms: Count of all received MAC frames with length
218 * (including FCS, but not framing bits) of between 1024 and 1518 octets
219 * inclusive. Includes frames received with frame-too-long, FCS, or length
220 * errors.
221 * @reserved_7: Reserved.
222 * @rmac_ip: Count of received IP datagrams. Includes errored IP datagrams.
223 *
224 * @rmac_ip_octets: Count of number of octets in received IP datagrams. Includes
225 * errored IP datagrams.
226 *
227 * @rmac_hdr_err_ip: Count of received IP datagrams that are discarded due to IP
228 * header errors.
229 *
230 * @rmac_drop_ip: Count of received IP datagrams that could not be passed to the
231 * host because of 1) Random Early Discard (RED); 2) Frame steering algorithm
232 * found no available queue; 3) Receive ingress buffer overflow.
233 * @rmac_icmp: Count of received ICMP messages. Includes errored ICMP messages
234 * (due to ICMP checksum fail).
235 *
236 * @reserved_8: Reserved.
237 * @rmac_tcp: Count of received TCP segments. Since Xena is unaware of
238 * connection context, counts all received TCP segments, regardless of whether
239 * or not they pertain to an established connection.
240 *
241 * @rmac_udp: Count of received UDP datagrams.
242 * @rmac_err_drp_udp: Count of received UDP datagrams that were not delivered to
243 * the system because of 1) Random Early Discard (RED); 2) Frame steering
244 * algorithm found no available queue; 3) Receive ingress buffer overflow.
245 *
246 * @rmac_xgmii_err_sym: Count of the number of symbol errors in the received
247 * XGMII data (i.e. PHY indicates "Receive Error" on the XGMII). Only includes
248 * symbol errors that are observed between the XGMII Start Frame Delimiter
249 * and End Frame Delimiter, inclusive. And only increments the count by one for
250 * each frame.
251 *
252 * @rmac_frms_q0: Count of number of frames that pass through queue 0 of receive
253 * buffer.
254 * @rmac_frms_q1: Count of number of frames that pass through queue 1 of receive
255 * buffer.
256 * @rmac_frms_q2: Count of number of frames that pass through queue 2 of receive
257 * buffer.
258 * @rmac_frms_q3: Count of number of frames that pass through queue 3 of receive
259 * buffer.
260 * @rmac_frms_q4: Count of number of frames that pass through queue 4 of receive
261 * buffer.
262 * @rmac_frms_q5: Count of number of frames that pass through queue 5 of receive
263 * buffer.
264 * @rmac_frms_q6: Count of number of frames that pass through queue 6 of receive
265 * buffer.
266 * @rmac_frms_q7: Count of number of frames that pass through queue 7 of receive
267 * buffer.
268 * @rmac_full_q0: Count of number of times that receive buffer queue 0 has
269 * filled up. If a queue is size 0, then this stat is incremented to a value of
270 * 1 when MAC receives its first frame.
271 *
272 * @rmac_full_q1: Count of number of times that receive buffer queue 1 has
273 * filled up. If a queue is size 0, then this stat is incremented to a value of
274 * 1 when MAC receives its first frame.
275 *
276 * @rmac_full_q2: Count of number of times that receive buffer queue 2 has
277 * filled up. If a queue is size 0, then this stat is incremented to a value of
278 * 1 when MAC receives its first frame.
279 *
280 * @rmac_full_q3: Count of number of times that receive buffer queue 3 has
281 * filled up. If a queue is size 0, then this stat is incremented to a value of
282 * 1 when MAC receives its first frame.
283 *
284 * @rmac_full_q4: Count of number of times that receive buffer queue 4 has
285 * filled up. If a queue is size 0, then this stat is incremented to a value of
286 * 1 when MAC receives its first frame.
287 *
288 * @rmac_full_q5: Count of number of times that receive buffer queue 5 has
289 * filled up. If a queue is size 0, then this stat is incremented to a value of
290 * 1 when MAC receives its first frame.
291 *
292 * @rmac_full_q6: Count of number of times that receive buffer queue 6 has
293 * filled up. If a queue is size 0, then this stat is incremented to a value of
294 * 1 when MAC receives its first frame.
295 *
296 * @rmac_full_q7: Count of number of times that receive buffer queue 7 has
297 * filled up. If a queue is size 0, then this stat is incremented to a value of
298 * 1 when MAC receives its first frame.
299 *
300 * @rmac_pause_cnt: Count of number of pause quanta that the MAC has been in the
301 * paused state. Recall, one pause quantum equates to 512 bit times.
302 * @reserved_9: Reserved.
303 * @rmac_xgmii_data_err_cnt: This counter is incremented when either 1) The
304 * Reconcilliation Sublayer (RS) is expecting one control character and gets
305 * another (i.e. expecting Start control character and gets another control
306 * character); 2) Start control character is not in lane 0 or lane 4; 3) The RS
307 * gets a Start control character, but the start frame delimiter is not found in
308 * the correct location.
309 * @rmac_xgmii_ctrl_err_cnt: Maintains a count of unexpected or
310 * misplaced control characters occuring outside of normal data transmission
311 * (i.e. not included in RMAC_XGMII_DATA_ERR_CNT).
312 *
313 * @rmac_accepted_ip: Count of received IP datagrams that were passed to the
314 * system.
315 *
316 * @rmac_err_tcp: Count of received TCP segments containing errors. For example,
317 * bad TCP checksum.
318 *
319 * PCI (bus) Statistics:
320 * @rd_req_cnt: Counts the total number of read requests made by the device.
321 * @new_rd_req_cnt: Counts the requests made for a new read sequence (request
322 * made for the same sequence after a retry or disconnect response are not
323 * counted).
324 * @new_rd_req_rtry_cnt: Counts the Retry responses received on the start of
325 * the new read sequences.
326 * @rd_rtry_cnt: Counts the Retry responses received for read requests.
327 * @wr_rtry_rd_ack_cnt: Increments whenever a read request is accepted by
328 * the target after a write request was terminated with retry.
329 * @wr_req_cnt: Counts the total number of Write requests made by the device.
330 * @new_wr_req_cnt: Counts the requests made for a new write sequence (request
331 * made for the same sequence after a retry or disconnect response are not
332 * counted).
333 * @new_wr_req_rtry_cnt: Counts the requests made for a new write sequence
334 * (request made for the same sequence after a retry or disconnect response are
335 * not counted).
336 *
337 * @wr_rtry_cnt: Counts the Retry responses received for write requests.
338 * @wr_disc_cnt: Write Disconnect. Counts the target initiated disconnects
339 * on write transactions.
340 * @rd_rtry_wr_ack_cnt: Increments whenever a write request is accepted by the
341 * target after a read request was terminated with retry.
342 *
343 * @txp_wr_cnt: Counts the host write transactions to the Tx Pointer
344 * FIFOs.
345 * @txd_rd_cnt: Count of the Transmit Descriptor (TxD) read requests.
346 * @txd_wr_cnt: Count of the TxD write requests.
347 * @rxd_rd_cnt: Count of the Receive Descriptor (RxD) read requests.
348 * @rxd_wr_cnt: Count of the RxD write requests.
349 * @txf_rd_cnt: Count of transmit frame read requests. This will not
350 * equal the number of frames transmitted, as frame data is typically spread
351 * across multiple PCI transactions.
352 * @rxf_wr_cnt: Count of receive frame write requests.
353 *
354 * @tmac_frms_oflow: tbd
355 * @tmac_data_octets_oflow: tbd
356 * @tmac_mcst_frms_oflow: tbd
357 * @tmac_bcst_frms_oflow: tbd
358 * @tmac_ttl_octets_oflow: tbd
359 * @tmac_ucst_frms_oflow: tbd
360 * @tmac_nucst_frms_oflow: tbd
361 * @tmac_any_err_frms_oflow: tbd
362 * @tmac_vlan_frms: tbd
363 * @tmac_vld_ip_oflow: tbd
364 * @tmac_drop_ip_oflow: tbd
365 * @tmac_icmp_oflow: tbd
366 * @tmac_rst_tcp_oflow: tbd
367 * @tmac_udp_oflow: tbd
368 * @reserved_10: tbd
369 * @tpa_unknown_protocol: tbd
370 * @tpa_parse_failure: tbd
371 * @rmac_vld_frms_oflow: tbd
372 * @rmac_data_octets_oflow: tbd
373 * @rmac_vld_mcst_frms_oflow: tbd
374 * @rmac_vld_bcst_frms_oflow: tbd
375 * @rmac_ttl_octets_oflow: tbd
376 * @rmac_accepted_ucst_frms_oflow: tbd
377 * @rmac_accepted_nucst_frms_oflow: tbd
378 * @rmac_discarded_frms_oflow: tbd
379 * @rmac_drop_events_oflow: tbd
380 * @rmac_usized_frms_oflow: tbd
381 * @rmac_osized_frms_oflow: tbd
382 * @rmac_frag_frms_oflow: tbd
383 * @rmac_jabber_frms_oflow: tbd
384 * @rmac_ip_oflow: tbd
385 * @rmac_drop_ip_oflow: tbd
386 * @rmac_icmp_oflow: tbd
387 * @rmac_udp_oflow: tbd
388 * @reserved_11: tbd
389 * @rmac_err_drp_udp_oflow: tbd
390 * @rmac_pause_cnt_oflow: tbd
391 * @rmac_ttl_1519_4095_frms: tbd
392 * @rmac_ttl_4096_8191_frms: tbd
393 * @rmac_ttl_8192_max_frms: tbd
394 * @rmac_ttl_gt_max_frms: tbd
395 * @rmac_osized_alt_frms: tbd
396 * @rmac_jabber_alt_frms: tbd
397 * @rmac_gt_max_alt_frms: tbd
398 * @rmac_vlan_frms: tbd
399 * @rmac_fcs_discard: tbd
400 * @rmac_len_discard: tbd
401 * @rmac_da_discard: tbd
402 * @rmac_pf_discard: tbd
403 * @rmac_rts_discard: tbd
404 * @rmac_wol_discard: tbd
405 * @rmac_red_discard: tbd
406 * @rmac_ingm_full_discard: tbd
407 * @rmac_accepted_ip_oflow: tbd
408 * @reserved_12: tbd
409 * @link_fault_cnt: TBD
410 * @reserved_13: tbd
411 * Xframe hardware statistics.
412 */
413typedef struct xge_hal_stats_hw_info_t {
414#ifdef  XGE_OS_HOST_BIG_ENDIAN
415/* Tx MAC statistics counters. */
416	u32 tmac_frms;
417	u32 tmac_data_octets;
418	u64 tmac_drop_frms;
419	u32 tmac_mcst_frms;
420	u32 tmac_bcst_frms;
421	u64 tmac_pause_ctrl_frms;
422	u32 tmac_ttl_octets;
423	u32 tmac_ucst_frms;
424	u32 tmac_nucst_frms;
425	u32 tmac_any_err_frms;
426	u64 tmac_ttl_less_fb_octets;
427	u64 tmac_vld_ip_octets;
428	u32 tmac_vld_ip;
429	u32 tmac_drop_ip;
430	u32 tmac_icmp;
431	u32 tmac_rst_tcp;
432	u64 tmac_tcp;
433	u32 tmac_udp;
434	u32 reserved_0;
435
436/* Rx MAC Statistics counters. */
437	u32 rmac_vld_frms;
438	u32 rmac_data_octets;
439	u64 rmac_fcs_err_frms;
440	u64 rmac_drop_frms;
441	u32 rmac_vld_mcst_frms;
442	u32 rmac_vld_bcst_frms;
443	u32 rmac_in_rng_len_err_frms;
444	u32 rmac_out_rng_len_err_frms;
445	u64 rmac_long_frms;
446	u64 rmac_pause_ctrl_frms;
447	u64 rmac_unsup_ctrl_frms;
448	u32 rmac_ttl_octets;
449	u32 rmac_accepted_ucst_frms;
450	u32 rmac_accepted_nucst_frms;
451	u32 rmac_discarded_frms;
452	u32 rmac_drop_events;
453	u32 reserved_1;
454	u64 rmac_ttl_less_fb_octets;
455	u64 rmac_ttl_frms;
456	u64 reserved_2;
457	u32 reserved_3;
458	u32 rmac_usized_frms;
459	u32 rmac_osized_frms;
460	u32 rmac_frag_frms;
461	u32 rmac_jabber_frms;
462	u32 reserved_4;
463	u64 rmac_ttl_64_frms;
464	u64 rmac_ttl_65_127_frms;
465	u64 reserved_5;
466	u64 rmac_ttl_128_255_frms;
467	u64 rmac_ttl_256_511_frms;
468	u64 reserved_6;
469	u64 rmac_ttl_512_1023_frms;
470	u64 rmac_ttl_1024_1518_frms;
471	u32 reserved_7;
472	u32 rmac_ip;
473	u64 rmac_ip_octets;
474	u32 rmac_hdr_err_ip;
475	u32 rmac_drop_ip;
476	u32 rmac_icmp;
477	u32 reserved_8;
478	u64 rmac_tcp;
479	u32 rmac_udp;
480	u32 rmac_err_drp_udp;
481	u64 rmac_xgmii_err_sym;
482	u64 rmac_frms_q0;
483	u64 rmac_frms_q1;
484	u64 rmac_frms_q2;
485	u64 rmac_frms_q3;
486	u64 rmac_frms_q4;
487	u64 rmac_frms_q5;
488	u64 rmac_frms_q6;
489	u64 rmac_frms_q7;
490	u16 rmac_full_q0;
491	u16 rmac_full_q1;
492	u16 rmac_full_q2;
493	u16 rmac_full_q3;
494	u16 rmac_full_q4;
495	u16 rmac_full_q5;
496	u16 rmac_full_q6;
497	u16 rmac_full_q7;
498	u32 rmac_pause_cnt;
499	u32 reserved_9;
500	u64 rmac_xgmii_data_err_cnt;
501	u64 rmac_xgmii_ctrl_err_cnt;
502	u32 rmac_accepted_ip;
503	u32 rmac_err_tcp;
504
505/* PCI/PCI-X Read transaction statistics. */
506	u32 rd_req_cnt;
507	u32 new_rd_req_cnt;
508	u32 new_rd_req_rtry_cnt;
509	u32 rd_rtry_cnt;
510	u32 wr_rtry_rd_ack_cnt;
511
512/* PCI/PCI-X write transaction statistics. */
513	u32 wr_req_cnt;
514	u32 new_wr_req_cnt;
515	u32 new_wr_req_rtry_cnt;
516	u32 wr_rtry_cnt;
517	u32 wr_disc_cnt;
518	u32 rd_rtry_wr_ack_cnt;
519
520/*  DMA Transaction statistics. */
521	u32 txp_wr_cnt;
522	u32 txd_rd_cnt;
523	u32 txd_wr_cnt;
524	u32 rxd_rd_cnt;
525	u32 rxd_wr_cnt;
526	u32 txf_rd_cnt;
527	u32 rxf_wr_cnt;
528
529/* Enhanced Herc statistics */
530	u32 tmac_frms_oflow;
531	u32 tmac_data_octets_oflow;
532	u32 tmac_mcst_frms_oflow;
533	u32 tmac_bcst_frms_oflow;
534	u32 tmac_ttl_octets_oflow;
535	u32 tmac_ucst_frms_oflow;
536	u32 tmac_nucst_frms_oflow;
537	u32 tmac_any_err_frms_oflow;
538	u64 tmac_vlan_frms;
539	u32 tmac_vld_ip_oflow;
540	u32 tmac_drop_ip_oflow;
541	u32 tmac_icmp_oflow;
542	u32 tmac_rst_tcp_oflow;
543	u32 tmac_udp_oflow;
544	u32 tpa_unknown_protocol;
545	u32 tpa_parse_failure;
546	u32 reserved_10;
547	u32 rmac_vld_frms_oflow;
548	u32 rmac_data_octets_oflow;
549	u32 rmac_vld_mcst_frms_oflow;
550	u32 rmac_vld_bcst_frms_oflow;
551	u32 rmac_ttl_octets_oflow;
552	u32 rmac_accepted_ucst_frms_oflow;
553	u32 rmac_accepted_nucst_frms_oflow;
554	u32 rmac_discarded_frms_oflow;
555	u32 rmac_drop_events_oflow;
556	u32 rmac_usized_frms_oflow;
557	u32 rmac_osized_frms_oflow;
558	u32 rmac_frag_frms_oflow;
559	u32 rmac_jabber_frms_oflow;
560	u32 rmac_ip_oflow;
561	u32 rmac_drop_ip_oflow;
562	u32 rmac_icmp_oflow;
563	u32 rmac_udp_oflow;
564	u32 rmac_err_drp_udp_oflow;
565	u32 rmac_pause_cnt_oflow;
566	u32 reserved_11;
567	u64 rmac_ttl_1519_4095_frms;
568	u64 rmac_ttl_4096_8191_frms;
569	u64 rmac_ttl_8192_max_frms;
570	u64 rmac_ttl_gt_max_frms;
571	u64 rmac_osized_alt_frms;
572	u64 rmac_jabber_alt_frms;
573	u64 rmac_gt_max_alt_frms;
574	u64 rmac_vlan_frms;
575	u32 rmac_fcs_discard;
576	u32 rmac_len_discard;
577	u32 rmac_da_discard;
578	u32 rmac_pf_discard;
579	u32 rmac_rts_discard;
580	u32 rmac_wol_discard;
581	u32 rmac_red_discard;
582	u32 rmac_ingm_full_discard;
583	u32 rmac_accepted_ip_oflow;
584	u32 reserved_12;
585	u32 link_fault_cnt;
586	u32 reserved_13;
587#else
588/* Tx MAC statistics counters. */
589	u32 tmac_data_octets;
590	u32 tmac_frms;
591	u64 tmac_drop_frms;
592	u32 tmac_bcst_frms;
593	u32 tmac_mcst_frms;
594	u64 tmac_pause_ctrl_frms;
595	u32 tmac_ucst_frms;
596	u32 tmac_ttl_octets;
597	u32 tmac_any_err_frms;
598	u32 tmac_nucst_frms;
599	u64 tmac_ttl_less_fb_octets;
600	u64 tmac_vld_ip_octets;
601	u32 tmac_drop_ip;
602	u32 tmac_vld_ip;
603	u32 tmac_rst_tcp;
604	u32 tmac_icmp;
605	u64 tmac_tcp;
606	u32 reserved_0;
607	u32 tmac_udp;
608
609/* Rx MAC Statistics counters. */
610	u32 rmac_data_octets;
611	u32 rmac_vld_frms;
612	u64 rmac_fcs_err_frms;
613	u64 rmac_drop_frms;
614	u32 rmac_vld_bcst_frms;
615	u32 rmac_vld_mcst_frms;
616	u32 rmac_out_rng_len_err_frms;
617	u32 rmac_in_rng_len_err_frms;
618	u64 rmac_long_frms;
619	u64 rmac_pause_ctrl_frms;
620	u64 rmac_unsup_ctrl_frms;
621	u32 rmac_accepted_ucst_frms;
622	u32 rmac_ttl_octets;
623	u32 rmac_discarded_frms;
624	u32 rmac_accepted_nucst_frms;
625	u32 reserved_1;
626	u32 rmac_drop_events;
627	u64 rmac_ttl_less_fb_octets;
628	u64 rmac_ttl_frms;
629	u64 reserved_2;
630	u32 rmac_usized_frms;
631	u32 reserved_3;
632	u32 rmac_frag_frms;
633	u32 rmac_osized_frms;
634	u32 reserved_4;
635	u32 rmac_jabber_frms;
636	u64 rmac_ttl_64_frms;
637	u64 rmac_ttl_65_127_frms;
638	u64 reserved_5;
639	u64 rmac_ttl_128_255_frms;
640	u64 rmac_ttl_256_511_frms;
641	u64 reserved_6;
642	u64 rmac_ttl_512_1023_frms;
643	u64 rmac_ttl_1024_1518_frms;
644	u32 rmac_ip;
645	u32 reserved_7;
646	u64 rmac_ip_octets;
647	u32 rmac_drop_ip;
648	u32 rmac_hdr_err_ip;
649	u32 reserved_8;
650	u32 rmac_icmp;
651	u64 rmac_tcp;
652	u32 rmac_err_drp_udp;
653	u32 rmac_udp;
654	u64 rmac_xgmii_err_sym;
655	u64 rmac_frms_q0;
656	u64 rmac_frms_q1;
657	u64 rmac_frms_q2;
658	u64 rmac_frms_q3;
659	u64 rmac_frms_q4;
660	u64 rmac_frms_q5;
661	u64 rmac_frms_q6;
662	u64 rmac_frms_q7;
663	u16 rmac_full_q3;
664	u16 rmac_full_q2;
665	u16 rmac_full_q1;
666	u16 rmac_full_q0;
667	u16 rmac_full_q7;
668	u16 rmac_full_q6;
669	u16 rmac_full_q5;
670	u16 rmac_full_q4;
671	u32 reserved_9;
672	u32 rmac_pause_cnt;
673	u64 rmac_xgmii_data_err_cnt;
674	u64 rmac_xgmii_ctrl_err_cnt;
675	u32 rmac_err_tcp;
676	u32 rmac_accepted_ip;
677
678/* PCI/PCI-X Read transaction statistics. */
679	u32 new_rd_req_cnt;
680	u32 rd_req_cnt;
681	u32 rd_rtry_cnt;
682	u32 new_rd_req_rtry_cnt;
683
684/* PCI/PCI-X Write/Read transaction statistics. */
685	u32 wr_req_cnt;
686	u32 wr_rtry_rd_ack_cnt;
687	u32 new_wr_req_rtry_cnt;
688	u32 new_wr_req_cnt;
689	u32 wr_disc_cnt;
690	u32 wr_rtry_cnt;
691
692/*  PCI/PCI-X Write / DMA Transaction statistics. */
693	u32 txp_wr_cnt;
694	u32 rd_rtry_wr_ack_cnt;
695	u32 txd_wr_cnt;
696	u32 txd_rd_cnt;
697	u32 rxd_wr_cnt;
698	u32 rxd_rd_cnt;
699	u32 rxf_wr_cnt;
700	u32 txf_rd_cnt;
701
702/* Enhanced Herc statistics */
703	u32 tmac_data_octets_oflow;
704	u32 tmac_frms_oflow;
705	u32 tmac_bcst_frms_oflow;
706	u32 tmac_mcst_frms_oflow;
707	u32 tmac_ucst_frms_oflow;
708	u32 tmac_ttl_octets_oflow;
709	u32 tmac_any_err_frms_oflow;
710	u32 tmac_nucst_frms_oflow;
711	u64 tmac_vlan_frms;
712	u32 tmac_drop_ip_oflow;
713	u32 tmac_vld_ip_oflow;
714	u32 tmac_rst_tcp_oflow;
715	u32 tmac_icmp_oflow;
716	u32 tpa_unknown_protocol;
717	u32 tmac_udp_oflow;
718	u32 reserved_10;
719	u32 tpa_parse_failure;
720	u32 rmac_data_octets_oflow;
721	u32 rmac_vld_frms_oflow;
722	u32 rmac_vld_bcst_frms_oflow;
723	u32 rmac_vld_mcst_frms_oflow;
724	u32 rmac_accepted_ucst_frms_oflow;
725	u32 rmac_ttl_octets_oflow;
726	u32 rmac_discarded_frms_oflow;
727	u32 rmac_accepted_nucst_frms_oflow;
728	u32 rmac_usized_frms_oflow;
729	u32 rmac_drop_events_oflow;
730	u32 rmac_frag_frms_oflow;
731	u32 rmac_osized_frms_oflow;
732	u32 rmac_ip_oflow;
733	u32 rmac_jabber_frms_oflow;
734	u32 rmac_icmp_oflow;
735	u32 rmac_drop_ip_oflow;
736	u32 rmac_err_drp_udp_oflow;
737	u32 rmac_udp_oflow;
738	u32 reserved_11;
739	u32 rmac_pause_cnt_oflow;
740	u64 rmac_ttl_1519_4095_frms;
741	u64 rmac_ttl_4096_8191_frms;
742	u64 rmac_ttl_8192_max_frms;
743	u64 rmac_ttl_gt_max_frms;
744	u64 rmac_osized_alt_frms;
745	u64 rmac_jabber_alt_frms;
746	u64 rmac_gt_max_alt_frms;
747	u64 rmac_vlan_frms;
748	u32 rmac_len_discard;
749	u32 rmac_fcs_discard;
750	u32 rmac_pf_discard;
751	u32 rmac_da_discard;
752	u32 rmac_wol_discard;
753	u32 rmac_rts_discard;
754	u32 rmac_ingm_full_discard;
755	u32 rmac_red_discard;
756	u32 reserved_12;
757	u32 rmac_accepted_ip_oflow;
758	u32 reserved_13;
759	u32 link_fault_cnt;
760#endif
761} xge_hal_stats_hw_info_t;
762
763/**
764 * struct xge_hal_stats_channel_into_t - HAL channel statistics.
765 * @full_cnt: TBD
766 * @usage_max: TBD
767 * @reserve_free_swaps_cnt: Reserve/free swap counter. Internal usage.
768 * @max_compl_per_intr_cnt: Maximum number of completions per interrupt.
769 * @avg_compl_per_intr_cnt: Average number of completions per interrupt.
770 *           Note that a total number of completed descriptors
771 *           for the given channel can be calculated as
772 *           (@traffic_intr_cnt * @avg_compl_per_intr_cnt).
773 * @total_compl_cnt: Total completion count.
774 *        @total_compl_cnt == (@traffic_intr_cnt * @avg_compl_per_intr_cnt).
775 * @total_posts: Total number of descriptor postings on the channel.
776 *        Counts the number of xge_hal_ring_dtr_post()
777 *        or xge_hal_fifo_dtr_post() calls by ULD, for ring and fifo
778 *        channel, respectively.
779 * @total_posts_many: Total number of posts on the channel that involved
780 *        more than one descriptor. Counts the number of
781 *        xge_hal_fifo_dtr_post_many() calls performed by ULD.
782 * @total_buffers: Total number of buffers posted on the channel.
783 * @copied_frags: TBD
784 * @copied_buffers: TBD
785 * @avg_buffers_per_post: Average number of buffers transferred in a single
786 *        post operation.
787 *        Calculated as @total_buffers/@total_posts.
788 * @avg_buffer_size: Average buffer size transferred by a single post
789 *       operation on a fifo channel. The counter is not supported for a ring
790 *       channel. Calculated as a total number of transmitted octets divided
791 *       by @total_buffers.
792 * @avg_post_size: Average amount of data transferred by a single post.
793 *       Calculated as a total number of transmitted octets divided by
794 *       @total_posts.
795 * @ring_bump_cnt: Ring "bump" count. Number of times the hardware could
796 *       not post receive data (and had to continue keeping it on-board)
797 *       because of unavailable receive descriptor(s).
798 * @total_posts_dtrs_many: Total number of posts on the channel that involving
799 *       more than one descriptor.
800 * @total_posts_frags_many: Total number of fragments posted on the channel
801 *   during post requests of multiple descriptors.
802 * @total_posts_dang_dtrs: Total number of posts on the channel involving
803 *       dangling descriptors.
804 * @total_posts_dang_frags: Total number of dangling fragments posted on the channel
805 *   during post request containing multiple descriptors.
806 *
807 * HAL channel counters.
808 * See also: xge_hal_stats_device_info_t{}.
809 */
810typedef struct xge_hal_stats_channel_info_t {
811	u32 full_cnt;
812	u32 usage_max;
813	u32 reserve_free_swaps_cnt;
814	u32 avg_compl_per_intr_cnt;
815	u32 total_compl_cnt;
816	u32 total_posts;
817	u32 total_posts_many;
818	u32 total_buffers;
819	u32 copied_frags;
820	u32 copied_buffers;
821	u32 avg_buffers_per_post;
822	u32 avg_buffer_size;
823	u32 avg_post_size;
824	u32 ring_bump_cnt;
825	u32 total_posts_dtrs_many;
826	u32 total_posts_frags_many;
827	u32 total_posts_dang_dtrs;
828	u32 total_posts_dang_frags;
829} xge_hal_stats_channel_info_t;
830
831/**
832 * struct xge_hal_xpak_counter_t - HAL xpak error counters
833 * @excess_temp: excess transceiver_temperature count
834 * @excess_bias_current: excess laser_bias_current count
835 * @excess_laser_output: excess laser_output_power count
836 * @tick_period: tick count for each cycle
837 */
838typedef struct xge_hal_xpak_counter_t {
839	    u32     excess_temp;
840	    u32     excess_bias_current;
841	    u32     excess_laser_output;
842	    u32     tick_period;
843} xge_hal_xpak_counter_t;
844
845/**
846 * struct xge_hal_stats_xpak_t - HAL xpak stats
847 * @alarm_transceiver_temp_high: alarm_transceiver_temp_high count value
848 * @alarm_transceiver_temp_low : alarm_transceiver_temp_low count value
849 * @alarm_laser_bias_current_high: alarm_laser_bias_current_high count value
850 * @alarm_laser_bias_current_low: alarm_laser_bias_current_low count value
851 * @alarm_laser_output_power_high: alarm_laser_output_power_high count value
852 * @alarm_laser_output_power_low: alarm_laser_output_power_low count value
853 * @warn_transceiver_temp_high: warn_transceiver_temp_high count value
854 * @warn_transceiver_temp_low: warn_transceiver_temp_low count value
855 * @warn_laser_bias_current_high: warn_laser_bias_current_high count value
856 * @warn_laser_bias_current_low: warn_laser_bias_current_low count value
857 * @warn_laser_output_power_high: warn_laser_output_power_high count value
858 * @warn_laser_output_power_low: warn_laser_output_power_low count value
859 */
860typedef struct xge_hal_stats_xpak_t {
861	    u16     alarm_transceiver_temp_high;
862	    u16     alarm_transceiver_temp_low;
863	    u16     alarm_laser_bias_current_high;
864	    u16     alarm_laser_bias_current_low;
865	    u16     alarm_laser_output_power_high;
866	    u16     alarm_laser_output_power_low;
867	    u16     warn_transceiver_temp_high;
868	    u16     warn_transceiver_temp_low;
869	    u16     warn_laser_bias_current_high;
870	    u16     warn_laser_bias_current_low;
871	    u16     warn_laser_output_power_high;
872	    u16     warn_laser_output_power_low;
873} xge_hal_stats_xpak_t;
874
875
876
877/**
878 * struct xge_hal_stats_sw_err_t - HAL device error statistics.
879 * @sm_err_cnt: TBD
880 * @single_ecc_err_cnt: TBD
881 * @double_ecc_err_cnt: TBD
882 * @ecc_err_cnt: ECC error count.
883 * @parity_err_cnt: Parity error count.
884 * @serr_cnt: Number of exceptions indicated to the host via PCI SERR#.
885 * @rxd_t_code_err_cnt: Array of receive transfer codes. The position
886 * (index) in this array reflects the transfer code type, for instance
887 * 0x7 - for "invalid receive buffer size", or 0x8 - for ECC.
888 * Value rxd_t_code_err_cnt[i] reflects the
889 * number of times the corresponding transfer code was encountered.
890 *
891 * @txd_t_code_err_cnt: Array of transmit transfer codes. The position
892 * (index) in this array reflects the transfer code type, for instance
893 * 0xA - "loss of link".
894 * Value txd_t_code_err_cnt[i] reflects the
895 * number of times the corresponding transfer code was encountered.
896 * @stats_xpak: TBD
897 * @xpak_counter: TBD
898 */
899typedef struct xge_hal_stats_sw_err_t {
900	u32     sm_err_cnt;
901	u32     single_ecc_err_cnt;
902	u32     double_ecc_err_cnt;
903	u32     ecc_err_cnt;
904	u32     parity_err_cnt;
905	u32     serr_cnt;
906	u32     rxd_t_code_err_cnt[16];
907	u32     txd_t_code_err_cnt[16];
908	xge_hal_stats_xpak_t    stats_xpak;
909	xge_hal_xpak_counter_t  xpak_counter;
910} xge_hal_stats_sw_err_t;
911
912/**
913 * struct xge_hal_stats_device_info_t - HAL own per-device statistics.
914 *
915 * @rx_traffic_intr_cnt: TBD
916 * @tx_traffic_intr_cnt: TBD
917 * @txpic_intr_cnt: TBD
918 * @txdma_intr_cnt: TBD
919 * @txmac_intr_cnt: TBD
920 * @txxgxs_intr_cnt: TBD
921 * @rxpic_intr_cnt: TBD
922 * @rxdma_intr_cnt: TBD
923 * @rxmac_intr_cnt: TBD
924 * @rxxgxs_intr_cnt: TBD
925 * @mc_intr_cnt: TBD
926 * @not_traffic_intr_cnt: Number of times the host was interrupted
927 *                        without new completions.
928 *                        "Non-traffic interrupt counter".
929 * @not_xge_intr_cnt: TBD
930 * @traffic_intr_cnt: Number of traffic interrupts for the device.
931 * @total_intr_cnt: Total number of traffic interrupts for the device.
932 *                  @total_intr_cnt == @traffic_intr_cnt +
933 *                              @not_traffic_intr_cnt
934 * @soft_reset_cnt: Number of times soft reset is done on this device.
935 * @rxufca_hi_adjust_cnt: TODO
936 * @rxufca_lo_adjust_cnt: TODO
937 * @bimodal_hi_adjust_cnt: TODO
938 * @bimodal_lo_adjust_cnt: TODO
939 *
940 * @tot_frms_lroised: TBD
941 * @tot_lro_sessions: TBD
942 * @lro_frm_len_exceed_cnt: TBD
943 * @lro_sg_exceed_cnt: TBD
944 * @lro_out_of_seq_pkt_cnt: TBD
945 * @lro_dup_pkt_cnt: TBD
946 *
947 * HAL per-device statistics.
948 * See also: xge_hal_stats_channel_info_t{}.
949 */
950typedef struct xge_hal_stats_device_info_t {
951	u32             rx_traffic_intr_cnt;
952	u32             tx_traffic_intr_cnt;
953	u32             txpic_intr_cnt;
954	u32             txdma_intr_cnt;
955	u32             pfc_err_cnt;
956	u32             tda_err_cnt;
957	u32             pcc_err_cnt;
958	u32             tti_err_cnt;
959	u32             lso_err_cnt;
960	u32             tpa_err_cnt;
961	u32             sm_err_cnt;
962	u32             txmac_intr_cnt;
963	u32             mac_tmac_err_cnt;
964	u32             txxgxs_intr_cnt;
965	u32             xgxs_txgxs_err_cnt;
966	u32             rxpic_intr_cnt;
967	u32             rxdma_intr_cnt;
968	u32             rc_err_cnt;
969	u32             rpa_err_cnt;
970	u32             rda_err_cnt;
971	u32             rti_err_cnt;
972	u32             rxmac_intr_cnt;
973	u32             mac_rmac_err_cnt;
974	u32             rxxgxs_intr_cnt;
975	u32             xgxs_rxgxs_err_cnt;
976	u32             mc_intr_cnt;
977	u32             not_traffic_intr_cnt;
978	u32             not_xge_intr_cnt;
979	u32             traffic_intr_cnt;
980	u32             total_intr_cnt;
981	u32             soft_reset_cnt;
982	u32             rxufca_hi_adjust_cnt;
983	u32             rxufca_lo_adjust_cnt;
984	u32             bimodal_hi_adjust_cnt;
985	u32             bimodal_lo_adjust_cnt;
986#ifdef XGE_HAL_CONFIG_LRO
987	u32             tot_frms_lroised;
988	u32             tot_lro_sessions;
989	u32             lro_frm_len_exceed_cnt;
990	u32             lro_sg_exceed_cnt;
991	u32             lro_out_of_seq_pkt_cnt;
992	u32             lro_dup_pkt_cnt;
993#endif
994} xge_hal_stats_device_info_t;
995
996/* ========================== XFRAME ER STATISTICS ======================== */
997#define XGE_HAL_MAC_LINKS   3
998#define XGE_HAL_MAC_AGGREGATORS 2
999#define XGE_HAL_VPATHS      17
1000/**
1001 * struct xge_hal_stats_link_info_t - XGMAC statistics for a link
1002 *
1003 * @tx_frms: Count of transmitted MAC frames for mac the link.
1004 * @tx_ttl_eth_octets: Count of total octets of transmitted frames
1005 * for mac the link.
1006 * @tx_data_octets: Count of data and padding octets of transmitted
1007 * frames for mac the link.
1008 * @tx_mcst_frms: Count of multicast MAC frames for mac the link.
1009 * @tx_bcst_frms: Count of broadcast MAC frames for mac the link.
1010 * @tx_ucst_frms: Count of unicast MAC frames for mac the link.
1011 * @tx_tagged_frms: Count of transmitted frames containing a VLAN tag
1012 * for mac the link.
1013 * @tx_vld_ip: Count of transmitted IP datagrams for mac the link.
1014 * @tx_vld_ip_octets: Count of transmitted IP octets for mac the link.
1015 * @tx_icmp: Count of transmitted ICMP messages for mac the link.
1016 * @tx_tcp: Count of transmitted TCP segments for mac the link.
1017 * @tx_rst_tcp: Count of transmitted TCP segments containing the RST
1018 * flag mac the link.
1019 * @tx_udp: Count of transmitted UDP datagrams for mac the link.
1020 * @tx_unknown_protocol: Count of transmitted packets of unknown
1021 * protocol for mac the link.
1022 * @tx_parse_error: Count of transmitted packets with parsing errors
1023 * for mac the link.
1024 * @tx_pause_ctrl_frms: Count of MAC PAUSE control frames for mac
1025 * the link.
1026 * @tx_lacpdu_frms: Count of LACPDUs transmitted for mac the link.
1027 * @tx_marker_pdu_frms: Count of Marker PDUs transmitted for mac the
1028 * link.
1029 * @tx_marker_resp_pdu_frms: Count of Marker Response PDUs transmitted
1030 * for mac the link.
1031 * @tx_drop_ip: Count of dropped IP packets from the transmission path
1032 * for mac the link.
1033 * @tx_xgmii_char1_match: Count of the number of transmitted XGMII
1034 * characters that match first pattern, for mac the link.
1035 * @tx_xgmii_char2_match: Count of the number of transmitted XGMII
1036 * characters that match second pattern, for mac the link.
1037 * @tx_xgmii_column1_match: Count of the number of transmitted XGMII
1038 * columns that match first pattern, for mac the link.
1039 * @tx_xgmii_column2_match: Count of the number of transmitted XGMII
1040 * columns that match second pattern, for mac the link.
1041 * @tx_drop_frms: Count of frames dropped due to internal errors during
1042 * transmission for mac the link.
1043 * @tx_any_err_frms: Count of frames dropped due to any error during
1044 * transmission for mac the link.
1045 * @rx_ttl_frms: Count of all received MAC frames for mac the link.
1046 * @rx_vld_frms: Count of all successfully received MAC frames for mac
1047 * the link.
1048 * @rx_offld_frms: Count of all offloaded received MAC frames for mac
1049 * the link.
1050 * @rx_ttl_eth_octets: Count of total octets of received frames, not
1051 * including framing characters for mac the link.
1052 * @rx_data_octets: Count of data and padding octets of successfully
1053 * received frames for mac the link.
1054 * @rx_offld_octets: Count of total octets, not including framing
1055 * characters, of offloaded received frames for mac the link.
1056 * @rx_vld_mcst_frms: Count of successfully received multicast MAC
1057 * frames for mac the link.
1058 * @rx_vld_bcst_frms: Count of successfully received broadcast MAC
1059 * frames for mac the link.
1060 * @rx_accepted_ucst_frms: Count of successfully received unicast MAC
1061 * frames for mac the link.
1062 * @rx_accepted_nucst_frms: Count of successfully received non-unicast
1063 * MAC frames for mac the link.
1064 * @rx_tagged_frms: Count of received frames containing a VLAN tag for
1065 * mac the link.
1066 * @rx_long_frms: Count of received frames that are longer than
1067 * RX_MAX_PYLD_LEN + 18 bytes (+ 22 bytes if VLAN-tagged) for mac the link.
1068 * @rx_usized_frms: Count of received frames of length less than 64
1069 * octets, for mac the link.
1070 * @rx_osized_frms:  Count of received frames of length more than 1518
1071 * octets for mac the link.
1072 * @rx_frag_frms:  Count of received frames of length less than 64
1073 * octets that had bad FCS, for mac the link.
1074 * @rx_jabber_frms:  Count of received frames of length more than 1518
1075 * octets that had bad FCS, for mac the link.
1076 * @rx_ttl_64_frms: Count of all received MAC frames with length of
1077 * exactly 64 octets, for mac the link.
1078 * @rx_ttl_65_127_frms: Count of all received MAC frames with length
1079 * of between 65 and 127 octets inclusive, for mac the link.
1080 * @rx_ttl_128_255_frms: Count of all received MAC frames with length
1081 * of between 128 and 255 octets inclusive, for mac the link.
1082 * @rx_ttl_256_511_frms: Count of all received MAC frames with length
1083 * of between 246 and 511 octets inclusive, for mac the link.
1084 * @rx_ttl_512_1023_frms: Count of all received MAC frames with length
1085 * of between 512 and 1023 octets inclusive, for mac the link.
1086 * @rx_ttl_1024_1518_frms: Count of all received MAC frames with length
1087 * of between 1024 and 1518 octets inclusive, for mac the link.
1088 * @rx_ttl_1519_4095_frms: Count of all received MAC frames with length
1089 * of between 1519 and 4095 octets inclusive, for mac the link.
1090 * @rx_ttl_40956_8191_frms: Count of all received MAC frames with length
1091 * of between 4096 and 8191 octets inclusive, for mac the link.
1092 * @rx_ttl_8192_max_frms: Count of all received MAC frames with length
1093 * of between 8192 and RX_MAX_PYLD_LEN+18 octets inclusive, for mac the link.
1094 * @rx_ttl_gt_max_frms: Count of all received MAC frames with length
1095 * exceeding RX_MAX_PYLD_LEN+18 octets inclusive, for mac the link.
1096 * @rx_ip:  Count of received IP datagrams, for mac the link.
1097 * @rx_accepted_ip:  Count of received  and accepted IP datagrams,
1098 * for mac the link.
1099 * @rx_ip_octets: Count of number of octets in received IP datagrams,
1100 * for mac the link.
1101 * @rx_hdr_err_ip: Count of received IP datagrams that are discarded
1102 * due to IP header errors, for mac the link.
1103 * @rx_icmp: Count of received ICMP messages for mac the link.
1104 * @rx_tcp: Count of received TCP segments for mac the link.
1105 * @rx_udp: Count of received UDP datagrams for mac the link.
1106 * @rx_err_tcp: Count of received TCP segments containing errors for
1107 * mac the link.
1108 * @rx_pause_cnt: Count of number of pause quanta that the MAC has
1109 * been in the paused state, for mac the link.
1110 * @rx_pause_ctrl_frms: Count of received MAC PAUSE control frames for
1111 * mac the link.
1112 * @rx_unsup_ctrl_frms: Count of received MAC control frames that do
1113 * not contain the PAUSE opcode for mac the link.
1114 * @rx_fcs_err_frms: Count of received MAC frames that do not pass FCS
1115 * for mac the link.
1116 * @rx_in_rng_len_err_frms: Count of received frames with a length/type
1117 * field value between 46 and 1500 inclusive, that does not match the number
1118 * of data octets received, for mac the link.
1119 * @rx_out_rng_len_err_frms: Count of received frames with length/type
1120 * field between 1501 and 1535 decimal, inclusive. for mac the link.
1121 * @rx_drop_frms: Count of dropped frames from receive path for mac
1122 * the link.
1123 * @rx_discarded_frms: Count of discarded frames from receive path for
1124 * mac the link.
1125 * @rx_drop_ip: Count of droppen IP datagrams from receive path for
1126 * mac the link.
1127 * @rx_err_drp_udp: Count of droppen UDP datagrams from receive path
1128 * for mac the link.
1129 * @rx_lacpdu_frms: Count of valid LACPDUs received for mac the link.
1130 * @rx_marker_pdu_frms: Count of valid Marker PDUs received for mac
1131 * the link.
1132 * @rx_marker_resp_pdu_frms: Count of valid Marker Response PDUs
1133 * received for mac the link.
1134 * @rx_unknown_pdu_frms: Count of unknown PDUs received for mac the link.
1135 * @rx_illegal_pdu_frms: Count of illegal PDUs received for mac the link.
1136 * @rx_fcs_discard: Count of discarded PDUs received for mac the link.
1137 * @rx_len_discard: Count of received frames that were discarded
1138 * because of an invalid frame length, for mac the link.
1139 * @rx_len_discard: Count of received frames that were discarded
1140 * because of an invalid destination MAC address, for mac the link.
1141 * @rx_pf_discard: Count of received frames that were discarded for
1142 * mac the link.
1143 * @rx_trash_discard: Count of received frames that were steered to the
1144 * trash queue for mac the link.
1145 * @rx_rts_discard: Count of received frames that were discarded by RTS
1146 * logic for mac the link.
1147 * @rx_wol_discard: Count of received frames that were discarded by WOL
1148 * logic for mac the link.
1149 * @rx_red_discard: Count of received frames that were discarded by RED
1150 * logic for mac the link.
1151 * @rx_ingm_full_discard: Count of received frames that were discarded
1152 * because the internal ingress memory was full for mac the link.
1153 * @rx_xgmii_data_err_cnt: Count of unexpected control characters
1154 * during normal data transmission for mac the link.
1155 * @rx_xgmii_ctrl_err_cnt: Count of unexpected or misplaced control
1156 * characters occuring between times of normal data transmission for mac
1157 * the link.
1158 * @rx_xgmii_err_sym: Count of the number of symbol errors in the
1159 * received XGMII data for mac the link.
1160 * @rx_xgmii_char1_match: Count of the number of XGMII characters
1161 * that match first pattern defined in MAC_STATS_RX_XGMII_CHAR_LINK_N.
1162 * @rx_xgmii_char2_match: Count of the number of XGMII characters
1163 * that match second pattern defined in MAC_STATS_RX_XGMII_CHAR_LINK_N.
1164 * @rx_xgmii_column1_match: Count of the number of XGMII columns
1165 * that match a pattern defined in MAC_STATS_RX_XGMII_COLUMN1_LINK_N.
1166 * @rx_xgmii_column2_match: Count of the number of XGMII columns
1167 * that match a pattern defined in MAC_STATS_RX_XGMII_COLUMN1_LINK_N.
1168 * @rx_local_fault: Count of the number of local faults for mac the link.
1169 * @rx_remote_fault: Count of the number of remote faults for mac the
1170 * link.
1171 * @rx_queue_full: Count of the number of frame destined for a full
1172 * queue for mac the link.
1173 */
1174typedef struct xge_hal_stats_link_info_t {
1175	u64 tx_frms;
1176	u64 tx_ttl_eth_octets;
1177	u64 tx_data_octets;
1178	u64 tx_mcst_frms;
1179	u64 tx_bcst_frms;
1180	u64 tx_ucst_frms;
1181	u64 tx_tagged_frms;
1182	u64 tx_vld_ip;
1183	u64 tx_vld_ip_octets;
1184	u64 tx_icmp;
1185	u64 tx_tcp;
1186	u64 tx_rst_tcp;
1187	u64 tx_udp;
1188	u64 tx_unknown_protocol;
1189	u64 tx_parse_error;
1190	u64 tx_pause_ctrl_frms;
1191	u64 tx_lacpdu_frms;
1192	u64 tx_marker_pdu_frms;
1193	u64 tx_marker_resp_pdu_frms;
1194	u64 tx_drop_ip;
1195	u64 tx_xgmii_char1_match;
1196	u64 tx_xgmii_char2_match;
1197	u64 tx_xgmii_column1_match;
1198	u64 tx_xgmii_column2_match;
1199	u64 tx_drop_frms;
1200	u64 tx_any_err_frms;
1201	u64 rx_ttl_frms;
1202	u64 rx_vld_frms;
1203	u64 rx_offld_frms;
1204	u64 rx_ttl_eth_octets;
1205	u64 rx_data_octets;
1206	u64 rx_offld_octets;
1207	u64 rx_vld_mcst_frms;
1208	u64 rx_vld_bcst_frms;
1209	u64 rx_accepted_ucst_frms;
1210	u64 rx_accepted_nucst_frms;
1211	u64 rx_tagged_frms;
1212	u64 rx_long_frms;
1213	u64 rx_usized_frms;
1214	u64 rx_osized_frms;
1215	u64 rx_frag_frms;
1216	u64 rx_jabber_frms;
1217	u64 rx_ttl_64_frms;
1218	u64 rx_ttl_65_127_frms;
1219	u64 rx_ttl_128_255_frms;
1220	u64 rx_ttl_256_511_frms;
1221	u64 rx_ttl_512_1023_frms;
1222	u64 rx_ttl_1024_1518_frms;
1223	u64 rx_ttl_1519_4095_frms;
1224	u64 rx_ttl_40956_8191_frms;
1225	u64 rx_ttl_8192_max_frms;
1226	u64 rx_ttl_gt_max_frms;
1227	u64 rx_ip;
1228	u64 rx_ip_octets;
1229	u64 rx_hdr_err_ip;
1230	u64 rx_icmp;
1231	u64 rx_tcp;
1232	u64 rx_udp;
1233	u64 rx_err_tcp;
1234	u64 rx_pause_cnt;
1235	u64 rx_pause_ctrl_frms;
1236	u64 rx_unsup_ctrl_frms;
1237	u64 rx_in_rng_len_err_frms;
1238	u64 rx_out_rng_len_err_frms;
1239	u64 rx_drop_frms;
1240	u64 rx_discarded_frms;
1241	u64 rx_drop_ip;
1242	u64 rx_err_drp_udp;
1243	u64 rx_lacpdu_frms;
1244	u64 rx_marker_pdu_frms;
1245	u64 rx_marker_resp_pdu_frms;
1246	u64 rx_unknown_pdu_frms;
1247	u64 rx_illegal_pdu_frms;
1248	u64 rx_fcs_discard;
1249	u64 rx_len_discard;
1250	u64 rx_pf_discard;
1251	u64 rx_trash_discard;
1252	u64 rx_rts_discard;
1253	u64 rx_wol_discard;
1254	u64 rx_red_discard;
1255	u64 rx_ingm_full_discard;
1256	u64 rx_xgmii_data_err_cnt;
1257	u64 rx_xgmii_ctrl_err_cnt;
1258	u64 rx_xgmii_err_sym;
1259	u64 rx_xgmii_char1_match;
1260	u64 rx_xgmii_char2_match;
1261	u64 rx_xgmii_column1_match;
1262	u64 rx_xgmii_column2_match;
1263	u64 rx_local_fault;
1264	u64 rx_remote_fault;
1265	u64 rx_queue_full;
1266}xge_hal_stats_link_info_t;
1267
1268/**
1269 * struct xge_hal_stats_aggr_info_t - XGMAC statistics for an aggregator
1270 *
1271 * @tx_frms: Count of data frames transmitted for the aggregator.
1272 * @tx_mcst_frms: Count of multicast data frames transmitted for
1273 * the aggregator.
1274 * @tx_bcst_frms: Count of broadcast data frames transmitted for
1275 * the aggregator.
1276 * @tx_discarded_frms: Count of discarded data frames transmitted for
1277 * the aggregator.
1278 * @tx_errored_frms: Count of errored data frames transmitted for
1279 * the aggregator.
1280 * @rx_frms: Count of received frames for aggregators
1281 * @rx_data_octets: Count of data and padding octets of frames received
1282 * the aggregator.
1283 * @rx_mcst_frms: Count of multicast frames received the aggregator.
1284 * @rx_bcst_frms: Count of broadast frames received the aggregator.
1285 * @rx_discarded_frms: Count of discarded frames received the aggregator.
1286 * @rx_errored_frms: Count of errored frames received the aggregator.
1287 * @rx_unknown_protocol_frms: Count of unknown protocol frames received
1288 * the aggregator.
1289*/
1290typedef struct xge_hal_stats_aggr_info_t {
1291	u64 tx_frms;
1292	u64 tx_mcst_frms;
1293	u64 tx_bcst_frms;
1294	u64 tx_discarded_frms;
1295	u64 tx_errored_frms;
1296	u64 rx_frms;
1297	u64 rx_data_octets;
1298	u64 rx_mcst_frms;
1299	u64 rx_bcst_frms;
1300	u64 rx_discarded_frms;
1301	u64 rx_errored_frms;
1302	u64 rx_unknown_protocol_frms;
1303}xge_hal_stats_aggr_info_t;
1304
1305/**
1306 * struct xge_hal_stats_vpath_info_t - XGMAC statistics for a vpath.
1307 *
1308 * @tx_frms: Count of transmitted MAC frames for the vpath.
1309 * @tx_ttl_eth_octets: Count of total octets of transmitted frames
1310 * for the vpath.
1311 * @tx_data_octets: Count of data and padding octets of transmitted
1312 * frames for the vpath.
1313 * @tx_mcst_frms: Count of multicast MAC frames for the vpath.
1314 * @tx_bcst_frms: Count of broadcast MAC frames for the vpath.
1315 * @tx_ucst_frms: Count of unicast MAC frames for the vpath.
1316 * @tx_tagged_frms: Count of transmitted frames containing a VLAN
1317 * tag for the vpath.
1318 * @tx_vld_ip: Count of transmitted IP datagrams for the vpath.
1319 * @tx_vld_ip_octets: Count of transmitted IP octets for the vpath.
1320 * @tx_icmp: Count of transmitted ICMP messages for the vpath.
1321 * @tx_tcp: Count of transmitted TCP segments for the vpath.
1322 * @tx_rst_tcp: Count of transmitted TCP segments containing the RST
1323 * flag the vpath.
1324 * @tx_udp: Count of transmitted UDP datagrams for the vpath.
1325 * @tx_unknown_protocol: Count of transmitted packets of unknown
1326 * protocol for the vpath.
1327 * @tx_parse_error: Count of transmitted packets with parsing errors
1328 * for the vpath.
1329 * @rx_ttl_frms: Count of all received MAC frames for the vpath.
1330 * @rx_vld_frms: Count of all successfully received MAC frames for
1331 * the vpath.
1332 * @rx_offld_frms: Count of all offloaded received MAC frames for
1333 * the vpath.
1334 * @rx_ttl_eth_octets: Count of total octets of received frames, not
1335 * including framing characters for the vpath.
1336 * @rx_data_octets: Count of data and padding octets of successfully
1337 * received frames for the vpath.
1338 * @rx_offld_octets: Count of total octets, not including framing
1339 * characters, of offloaded received frames for the vpath.
1340 * @rx_vld_mcst_frms: Count of successfully received multicast MAC
1341 * frames for the vpath.
1342 * @rx_vld_bcst_frms: Count of successfully received broadcast MAC
1343 * frames for the vpath.
1344 * @rx_accepted_ucst_frms: Count of successfully received unicast
1345 * MAC frames for the vpath.
1346 * @rx_accepted_nucst_frms: Count of successfully received
1347 * non-unicast MAC frames for the vpath.
1348 * @rx_tagged_frms: Count of received frames containing a VLAN tag
1349 * for the vpath.
1350 * @rx_long_frms: Count of received frames that are longer than
1351 * RX_MAX_PYLD_LEN + 18 bytes (+ 22 bytes if VLAN-tagged) for the vpath.
1352 * @rx_usized_frms: Count of received frames of length less than 64
1353 * octets, for the vpath.
1354 * @rx_usized_frms: Count of received frames of length more than
1355 * 1518 octets, for the vpath.
1356 * @rx_osized_frms:  Count of received frames of length more than
1357 * 1518 octets for the vpath.
1358 * @rx_frag_frms:  Count of received frames of length less than 64
1359 * octets that had bad FCS, for the vpath.
1360 * @rx_jabber_frms:  Count of received frames of length more than
1361 * 1518 octets that had bad FCS, for the vpath.
1362 * @rx_ttl_64_frms: Count of all received MAC frames with length of
1363 * exactly 64 octets, for the vpath.
1364 * @rx_ttl_65_127_frms: Count of all received MAC frames with length
1365 * of between 65 and 127 octets inclusive, for the vpath.
1366 * @rx_ttl_128_255_frms: Count of all received MAC frames with
1367 * length of between 128 and 255 octets inclusive, for the vpath.
1368 * @rx_ttl_256_511_frms: Count of all received MAC frames with
1369 * length of between 246 and 511 octets inclusive, for the vpath.
1370 * @rx_ttl_512_1023_frms: Count of all received MAC frames with
1371 * length of between 512 and 1023 octets inclusive, for the vpath.
1372 * @rx_ttl_1024_1518_frms: Count of all received MAC frames with
1373 * length of between 1024 and 1518 octets inclusive, for the vpath.
1374 * @rx_ttl_1519_4095_frms: Count of all received MAC frames with
1375 * length of between 1519 and 4095 octets inclusive, for the vpath.
1376 * @rx_ttl_40956_8191_frms: Count of all received MAC frames with
1377 * of between 4096 and 8191 octets inclusive, for the vpath.
1378 * @rx_ttl_8192_max_frms: Count of all received MAC frames with
1379 * length of between 8192 and RX_MAX_PYLD_LEN+18 octets inclusive, for the
1380 * vpath.
1381 * @rx_ttl_gt_max_frms: Count of all received MAC frames with length
1382 * exceeding RX_MAX_PYLD_LEN+18 octets inclusive, for the vpath.
1383 * @rx_ip:  Count of received IP datagrams, for the vpath.
1384 * @rx_accepted_ip: Count of received  and accepted IP datagrams,
1385 * for the vpath.
1386 * @rx_ip_octets: Count of number of octets in received IP datagrams
1387 * for the vpath.
1388 * @rx_hdr_err_ip: Count of received IP datagrams that are discarded
1389 * due to IP header errors, for the vpath.
1390 * @rx_icmp: Count of received ICMP messages for the vpath.
1391 * @rx_tcp: Count of received TCP segments for the vpath.
1392 * @rx_udp: Count of received UDP datagrams for the vpath.
1393 * @rx_err_tcp: Count of received TCP segments containing errors for
1394 * the vpath.
1395 * @rx_mpa_ok_frms: Count of received frames that pass the MPA
1396 * checks for vptah.
1397 * @rx_mpa_crc_fail_frms: Count of received frames that fail the MPA
1398 * CRC check for the vpath.
1399 * @rx_mpa_mrk_fail_frms: Count of received frames that fail the
1400 * MPA marker check for the vpath.
1401 * @rx_mpa_len_fail_frms: Count of received frames that fail the MPA
1402 * length check for the vpath.
1403 * @rx_wol_frms: Count of received "magic packet" frames for
1404 * the vpath.
1405 */
1406typedef struct xge_hal_stats_vpath_info_t {
1407	u64 tx_frms;
1408	u64 tx_ttl_eth_octets;
1409	u64 tx_data_octets;
1410	u64 tx_mcst_frms;
1411	u64 tx_bcst_frms;
1412	u64 tx_ucst_frms;
1413	u64 tx_tagged_frms;
1414	u64 tx_vld_ip;
1415	u64 tx_vld_ip_octets;
1416	u64 tx_icmp;
1417	u64 tx_tcp;
1418	u64 tx_rst_tcp;
1419	u64 tx_udp;
1420	u64 tx_unknown_protocol;
1421	u64 tx_parse_error;
1422	u64 rx_ttl_frms;
1423	u64 rx_vld_frms;
1424	u64 rx_offld_frms;
1425	u64 rx_ttl_eth_octets;
1426	u64 rx_data_octets;
1427	u64 rx_offld_octets;
1428	u64 rx_vld_mcst_frms;
1429	u64 rx_vld_bcst_frms;
1430	u64 rx_accepted_ucst_frms;
1431	u64 rx_accepted_nucst_frms;
1432	u64 rx_tagged_frms;
1433	u64 rx_long_frms;
1434	u64 rx_usized_frms;
1435	u64 rx_osized_frms;
1436	u64 rx_frag_frms;
1437	u64 rx_jabber_frms;
1438	u64 rx_ttl_64_frms;
1439	u64 rx_ttl_65_127_frms;
1440	u64 rx_ttl_128_255_frms;
1441	u64 rx_ttl_256_511_frms;
1442	u64 rx_ttl_512_1023_frms;
1443	u64 rx_ttl_1024_1518_frms;
1444	u64 rx_ttl_1519_4095_frms;
1445	u64 rx_ttl_40956_8191_frms;
1446	u64 rx_ttl_8192_max_frms;
1447	u64 rx_ttl_gt_max_frms;
1448	u64 rx_ip;
1449	u64 rx_accepted_ip;
1450	u64 rx_ip_octets;
1451	u64 rx_hdr_err_ip;
1452	u64 rx_icmp;
1453	u64 rx_tcp;
1454	u64 rx_udp;
1455	u64 rx_err_tcp;
1456	u64 rx_mpa_ok_frms;
1457	u64 rx_mpa_crc_fail_frms;
1458	u64 rx_mpa_mrk_fail_frms;
1459	u64 rx_mpa_len_fail_frms;
1460	u64 rx_wol_frms;
1461}xge_hal_stats_vpath_info_t;
1462
1463/**
1464 * struct xge_hal_stats_pcim_info_t - Contains PCIM statistics
1465 *
1466 * @link_info: PCIM links info for link 0, 1, and 2.
1467 * @aggr_info: PCIM aggregators info for aggregator 0 and 1.
1468 * See also: xge_hal_stats_link_info_t{}, xge_hal_stats_aggr_info_t{}.
1469 */
1470typedef struct xge_hal_stats_pcim_info_t {
1471	xge_hal_stats_link_info_t   link_info[XGE_HAL_MAC_LINKS];
1472	xge_hal_stats_aggr_info_t   aggr_info[XGE_HAL_MAC_AGGREGATORS];
1473}xge_hal_stats_pcim_info_t;
1474
1475/**
1476 * struct xge_hal_stats_t - Contains HAL per-device statistics,
1477 * including hw.
1478 * @devh: HAL device handle.
1479 * @dma_addr: DMA addres of the %hw_info. Given to device to fill-in the stats.
1480 * @hw_info_dmah: DMA handle used to map hw statistics onto the device memory
1481 *                space.
1482 * @hw_info_dma_acch: One more DMA handle used subsequently to free the
1483 *                    DMA object. Note that this and the previous handle have
1484 *                    physical meaning for Solaris; on Windows and Linux the
1485 *                    corresponding value will be simply pointer to PCI device.
1486 *
1487 * @hw_info: Xframe statistics maintained by the hardware.
1488 * @hw_info_saved: TBD
1489 * @hw_info_latest: TBD
1490 * @pcim_info: Xframe PCIM statistics maintained by the hardware.
1491 * @pcim_info_saved: TBD
1492 * @pcim_info_latest: TBD
1493 * @sw_dev_info_stats: HAL's "soft" device informational statistics, e.g. number
1494 *                     of completions per interrupt.
1495 * @sw_dev_err_stats: HAL's "soft" device error statistics.
1496 *
1497 * @is_initialized: True, if all the subordinate structures are allocated and
1498 *                  initialized.
1499 * @is_enabled: True, if device stats collection is enabled.
1500 *
1501 * Structure-container of HAL per-device statistics. Note that per-channel
1502 * statistics are kept in separate structures under HAL's fifo and ring
1503 * channels.
1504 * See also: xge_hal_stats_hw_info_t{}, xge_hal_stats_sw_err_t{},
1505 * xge_hal_stats_device_info_t{}.
1506 * See also: xge_hal_stats_channel_info_t{}.
1507 */
1508typedef struct xge_hal_stats_t {
1509	    /* handles */
1510	xge_hal_device_h        devh;
1511	dma_addr_t          dma_addr;
1512	pci_dma_h           hw_info_dmah;
1513	pci_dma_acc_h           hw_info_dma_acch;
1514
1515	    /* HAL device hardware statistics */
1516	xge_hal_stats_hw_info_t     *hw_info;
1517	xge_hal_stats_hw_info_t     hw_info_saved;
1518	xge_hal_stats_hw_info_t     hw_info_latest;
1519
1520	/* HAL device hardware statistics for XFRAME ER */
1521	xge_hal_stats_pcim_info_t   *pcim_info;
1522	xge_hal_stats_pcim_info_t   *pcim_info_saved;
1523	xge_hal_stats_pcim_info_t   *pcim_info_latest;
1524
1525	    /* HAL device "soft" stats */
1526	xge_hal_stats_sw_err_t          sw_dev_err_stats;
1527	xge_hal_stats_device_info_t     sw_dev_info_stats;
1528
1529	    /* flags */
1530	int             is_initialized;
1531	int             is_enabled;
1532} xge_hal_stats_t;
1533
1534/* ========================== STATS PRIVATE API ========================= */
1535
1536xge_hal_status_e __hal_stats_initialize(xge_hal_stats_t *stats,
1537	        xge_hal_device_h devh);
1538
1539void __hal_stats_terminate(xge_hal_stats_t *stats);
1540
1541void __hal_stats_enable(xge_hal_stats_t *stats);
1542
1543void __hal_stats_disable(xge_hal_stats_t *stats);
1544
1545void __hal_stats_soft_reset(xge_hal_device_h devh, int reset_all);
1546
1547/* ========================== STATS PUBLIC API ========================= */
1548
1549xge_hal_status_e xge_hal_stats_hw(xge_hal_device_h devh,
1550	        xge_hal_stats_hw_info_t **hw_info);
1551
1552xge_hal_status_e xge_hal_stats_pcim(xge_hal_device_h devh,
1553	        xge_hal_stats_pcim_info_t   **pcim_info);
1554
1555xge_hal_status_e xge_hal_stats_device(xge_hal_device_h devh,
1556	        xge_hal_stats_device_info_t **device_info);
1557
1558xge_hal_status_e xge_hal_stats_channel(xge_hal_channel_h channelh,
1559	        xge_hal_stats_channel_info_t **channel_info);
1560
1561xge_hal_status_e xge_hal_stats_reset(xge_hal_device_h devh);
1562
1563
1564__EXTERN_END_DECLS
1565
1566#endif /* XGE_HAL_STATS_H */
1567