xref: /OK3568_Linux_fs/kernel/drivers/infiniband/hw/ocrdma/ocrdma_stats.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* This file is part of the Emulex RoCE Device Driver for
2*4882a593Smuzhiyun  * RoCE (RDMA over Converged Ethernet) adapters.
3*4882a593Smuzhiyun  * Copyright (C) 2012-2015 Emulex. All rights reserved.
4*4882a593Smuzhiyun  * EMULEX and SLI are trademarks of Emulex.
5*4882a593Smuzhiyun  * www.emulex.com
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * This software is available to you under a choice of one of two licenses.
8*4882a593Smuzhiyun  * You may choose to be licensed under the terms of the GNU General Public
9*4882a593Smuzhiyun  * License (GPL) Version 2, available from the file COPYING in the main
10*4882a593Smuzhiyun  * directory of this source tree, or the BSD license below:
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  * Redistribution and use in source and binary forms, with or without
13*4882a593Smuzhiyun  * modification, are permitted provided that the following conditions
14*4882a593Smuzhiyun  * are met:
15*4882a593Smuzhiyun  *
16*4882a593Smuzhiyun  * - Redistributions of source code must retain the above copyright notice,
17*4882a593Smuzhiyun  *   this list of conditions and the following disclaimer.
18*4882a593Smuzhiyun  *
19*4882a593Smuzhiyun  * - Redistributions in binary form must reproduce the above copyright
20*4882a593Smuzhiyun  *   notice, this list of conditions and the following disclaimer in
21*4882a593Smuzhiyun  *   the documentation and/or other materials provided with the distribution.
22*4882a593Smuzhiyun  *
23*4882a593Smuzhiyun  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24*4882a593Smuzhiyun  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
25*4882a593Smuzhiyun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26*4882a593Smuzhiyun  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27*4882a593Smuzhiyun  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28*4882a593Smuzhiyun  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29*4882a593Smuzhiyun  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30*4882a593Smuzhiyun  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31*4882a593Smuzhiyun  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
32*4882a593Smuzhiyun  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33*4882a593Smuzhiyun  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*4882a593Smuzhiyun  *
35*4882a593Smuzhiyun  * Contact Information:
36*4882a593Smuzhiyun  * linux-drivers@emulex.com
37*4882a593Smuzhiyun  *
38*4882a593Smuzhiyun  * Emulex
39*4882a593Smuzhiyun  * 3333 Susan Street
40*4882a593Smuzhiyun  * Costa Mesa, CA 92626
41*4882a593Smuzhiyun  */
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun #ifndef __OCRDMA_STATS_H__
44*4882a593Smuzhiyun #define __OCRDMA_STATS_H__
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun #include <linux/debugfs.h>
47*4882a593Smuzhiyun #include "ocrdma.h"
48*4882a593Smuzhiyun #include "ocrdma_hw.h"
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun #define OCRDMA_MAX_DBGFS_MEM 4096
51*4882a593Smuzhiyun 
52*4882a593Smuzhiyun enum OCRDMA_STATS_TYPE {
53*4882a593Smuzhiyun 	OCRDMA_RSRC_STATS,
54*4882a593Smuzhiyun 	OCRDMA_RXSTATS,
55*4882a593Smuzhiyun 	OCRDMA_WQESTATS,
56*4882a593Smuzhiyun 	OCRDMA_TXSTATS,
57*4882a593Smuzhiyun 	OCRDMA_DB_ERRSTATS,
58*4882a593Smuzhiyun 	OCRDMA_RXQP_ERRSTATS,
59*4882a593Smuzhiyun 	OCRDMA_TXQP_ERRSTATS,
60*4882a593Smuzhiyun 	OCRDMA_TX_DBG_STATS,
61*4882a593Smuzhiyun 	OCRDMA_RX_DBG_STATS,
62*4882a593Smuzhiyun 	OCRDMA_DRV_STATS,
63*4882a593Smuzhiyun 	OCRDMA_RESET_STATS
64*4882a593Smuzhiyun };
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun void ocrdma_rem_debugfs(void);
67*4882a593Smuzhiyun void ocrdma_init_debugfs(void);
68*4882a593Smuzhiyun bool ocrdma_alloc_stats_resources(struct ocrdma_dev *dev);
69*4882a593Smuzhiyun void ocrdma_release_stats_resources(struct ocrdma_dev *dev);
70*4882a593Smuzhiyun void ocrdma_rem_port_stats(struct ocrdma_dev *dev);
71*4882a593Smuzhiyun void ocrdma_add_port_stats(struct ocrdma_dev *dev);
72*4882a593Smuzhiyun void ocrdma_pma_counters(struct ocrdma_dev *dev, struct ib_mad *out_mad);
73*4882a593Smuzhiyun 
74*4882a593Smuzhiyun #endif	/* __OCRDMA_STATS_H__ */
75