171ee6730SDevesh Sharma /* This file is part of the Emulex RoCE Device Driver for
271ee6730SDevesh Sharma  * RoCE (RDMA over Converged Ethernet) adapters.
371ee6730SDevesh Sharma  * Copyright (C) 2012-2015 Emulex. All rights reserved.
471ee6730SDevesh Sharma  * EMULEX and SLI are trademarks of Emulex.
571ee6730SDevesh Sharma  * www.emulex.com
671ee6730SDevesh Sharma  *
771ee6730SDevesh Sharma  * This software is available to you under a choice of one of two licenses.
871ee6730SDevesh Sharma  * You may choose to be licensed under the terms of the GNU General Public
971ee6730SDevesh Sharma  * License (GPL) Version 2, available from the file COPYING in the main
1071ee6730SDevesh Sharma  * directory of this source tree, or the BSD license below:
1171ee6730SDevesh Sharma  *
1271ee6730SDevesh Sharma  * Redistribution and use in source and binary forms, with or without
1371ee6730SDevesh Sharma  * modification, are permitted provided that the following conditions
1471ee6730SDevesh Sharma  * are met:
1571ee6730SDevesh Sharma  *
1671ee6730SDevesh Sharma  * - Redistributions of source code must retain the above copyright notice,
1771ee6730SDevesh Sharma  *   this list of conditions and the following disclaimer.
1871ee6730SDevesh Sharma  *
1971ee6730SDevesh Sharma  * - Redistributions in binary form must reproduce the above copyright
2071ee6730SDevesh Sharma  *   notice, this list of conditions and the following disclaimer in
2171ee6730SDevesh Sharma  *   the documentation and/or other materials provided with the distribution.
2271ee6730SDevesh Sharma  *
2371ee6730SDevesh Sharma  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2471ee6730SDevesh Sharma  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
2571ee6730SDevesh Sharma  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2671ee6730SDevesh Sharma  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2771ee6730SDevesh Sharma  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2871ee6730SDevesh Sharma  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2971ee6730SDevesh Sharma  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
3071ee6730SDevesh Sharma  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3171ee6730SDevesh Sharma  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
3271ee6730SDevesh Sharma  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3371ee6730SDevesh Sharma  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34a51f06e1SSelvin Xavier  *
35a51f06e1SSelvin Xavier  * Contact Information:
36a51f06e1SSelvin Xavier  * linux-drivers@emulex.com
37a51f06e1SSelvin Xavier  *
38a51f06e1SSelvin Xavier  * Emulex
39a51f06e1SSelvin Xavier  * 3333 Susan Street
40a51f06e1SSelvin Xavier  * Costa Mesa, CA 92626
4171ee6730SDevesh Sharma  */
42a51f06e1SSelvin Xavier 
43a51f06e1SSelvin Xavier #ifndef __OCRDMA_STATS_H__
44a51f06e1SSelvin Xavier #define __OCRDMA_STATS_H__
45a51f06e1SSelvin Xavier 
46a51f06e1SSelvin Xavier #include <linux/debugfs.h>
47a51f06e1SSelvin Xavier #include "ocrdma.h"
48a51f06e1SSelvin Xavier #include "ocrdma_hw.h"
49a51f06e1SSelvin Xavier 
50a51f06e1SSelvin Xavier #define OCRDMA_MAX_DBGFS_MEM 4096
51a51f06e1SSelvin Xavier 
52a51f06e1SSelvin Xavier enum OCRDMA_STATS_TYPE {
53a51f06e1SSelvin Xavier 	OCRDMA_RSRC_STATS,
54a51f06e1SSelvin Xavier 	OCRDMA_RXSTATS,
55a51f06e1SSelvin Xavier 	OCRDMA_WQESTATS,
56a51f06e1SSelvin Xavier 	OCRDMA_TXSTATS,
57a51f06e1SSelvin Xavier 	OCRDMA_DB_ERRSTATS,
58a51f06e1SSelvin Xavier 	OCRDMA_RXQP_ERRSTATS,
59a51f06e1SSelvin Xavier 	OCRDMA_TXQP_ERRSTATS,
60a51f06e1SSelvin Xavier 	OCRDMA_TX_DBG_STATS,
61ad56ebb4SSelvin Xavier 	OCRDMA_RX_DBG_STATS,
62ad56ebb4SSelvin Xavier 	OCRDMA_DRV_STATS,
63ad56ebb4SSelvin Xavier 	OCRDMA_RESET_STATS
64a51f06e1SSelvin Xavier };
65a51f06e1SSelvin Xavier 
66a51f06e1SSelvin Xavier void ocrdma_rem_debugfs(void);
67a51f06e1SSelvin Xavier void ocrdma_init_debugfs(void);
68fd98d896SSelvin Xavier bool ocrdma_alloc_stats_resources(struct ocrdma_dev *dev);
69fd98d896SSelvin Xavier void ocrdma_release_stats_resources(struct ocrdma_dev *dev);
70a51f06e1SSelvin Xavier void ocrdma_rem_port_stats(struct ocrdma_dev *dev);
71a51f06e1SSelvin Xavier void ocrdma_add_port_stats(struct ocrdma_dev *dev);
726a42265cSLeon Romanovsky void ocrdma_pma_counters(struct ocrdma_dev *dev, struct ib_mad *out_mad);
73a51f06e1SSelvin Xavier 
74a51f06e1SSelvin Xavier #endif	/* __OCRDMA_STATS_H__ */
75