162306a36Sopenharmony_ci/* This file is part of the Emulex RoCE Device Driver for
262306a36Sopenharmony_ci * RoCE (RDMA over Converged Ethernet) adapters.
362306a36Sopenharmony_ci * Copyright (C) 2012-2015 Emulex. All rights reserved.
462306a36Sopenharmony_ci * EMULEX and SLI are trademarks of Emulex.
562306a36Sopenharmony_ci * www.emulex.com
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * This software is available to you under a choice of one of two licenses.
862306a36Sopenharmony_ci * You may choose to be licensed under the terms of the GNU General Public
962306a36Sopenharmony_ci * License (GPL) Version 2, available from the file COPYING in the main
1062306a36Sopenharmony_ci * directory of this source tree, or the BSD license below:
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
1362306a36Sopenharmony_ci * modification, are permitted provided that the following conditions
1462306a36Sopenharmony_ci * are met:
1562306a36Sopenharmony_ci *
1662306a36Sopenharmony_ci * - Redistributions of source code must retain the above copyright notice,
1762306a36Sopenharmony_ci *   this list of conditions and the following disclaimer.
1862306a36Sopenharmony_ci *
1962306a36Sopenharmony_ci * - Redistributions in binary form must reproduce the above copyright
2062306a36Sopenharmony_ci *   notice, this list of conditions and the following disclaimer in
2162306a36Sopenharmony_ci *   the documentation and/or other materials provided with the distribution.
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2462306a36Sopenharmony_ci * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
2562306a36Sopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2662306a36Sopenharmony_ci * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2762306a36Sopenharmony_ci * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2862306a36Sopenharmony_ci * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2962306a36Sopenharmony_ci * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
3062306a36Sopenharmony_ci * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3162306a36Sopenharmony_ci * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
3262306a36Sopenharmony_ci * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3362306a36Sopenharmony_ci * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3462306a36Sopenharmony_ci *
3562306a36Sopenharmony_ci * Contact Information:
3662306a36Sopenharmony_ci * linux-drivers@emulex.com
3762306a36Sopenharmony_ci *
3862306a36Sopenharmony_ci * Emulex
3962306a36Sopenharmony_ci * 3333 Susan Street
4062306a36Sopenharmony_ci * Costa Mesa, CA 92626
4162306a36Sopenharmony_ci */
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#ifndef __OCRDMA_STATS_H__
4462306a36Sopenharmony_ci#define __OCRDMA_STATS_H__
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#include <linux/debugfs.h>
4762306a36Sopenharmony_ci#include "ocrdma.h"
4862306a36Sopenharmony_ci#include "ocrdma_hw.h"
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci#define OCRDMA_MAX_DBGFS_MEM 4096
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_cienum OCRDMA_STATS_TYPE {
5362306a36Sopenharmony_ci	OCRDMA_RSRC_STATS,
5462306a36Sopenharmony_ci	OCRDMA_RXSTATS,
5562306a36Sopenharmony_ci	OCRDMA_WQESTATS,
5662306a36Sopenharmony_ci	OCRDMA_TXSTATS,
5762306a36Sopenharmony_ci	OCRDMA_DB_ERRSTATS,
5862306a36Sopenharmony_ci	OCRDMA_RXQP_ERRSTATS,
5962306a36Sopenharmony_ci	OCRDMA_TXQP_ERRSTATS,
6062306a36Sopenharmony_ci	OCRDMA_TX_DBG_STATS,
6162306a36Sopenharmony_ci	OCRDMA_RX_DBG_STATS,
6262306a36Sopenharmony_ci	OCRDMA_DRV_STATS,
6362306a36Sopenharmony_ci	OCRDMA_RESET_STATS
6462306a36Sopenharmony_ci};
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_civoid ocrdma_rem_debugfs(void);
6762306a36Sopenharmony_civoid ocrdma_init_debugfs(void);
6862306a36Sopenharmony_cibool ocrdma_alloc_stats_resources(struct ocrdma_dev *dev);
6962306a36Sopenharmony_civoid ocrdma_release_stats_resources(struct ocrdma_dev *dev);
7062306a36Sopenharmony_civoid ocrdma_rem_port_stats(struct ocrdma_dev *dev);
7162306a36Sopenharmony_civoid ocrdma_add_port_stats(struct ocrdma_dev *dev);
7262306a36Sopenharmony_civoid ocrdma_pma_counters(struct ocrdma_dev *dev, struct ib_mad *out_mad);
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#endif	/* __OCRDMA_STATS_H__ */
75