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