linux/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h

/* bnx2x_stats.h: QLogic Everest network driver.
 *
 * Copyright (c) 2007-2013 Broadcom Corporation
 * Copyright (c) 2014 QLogic Corporation
 * All rights reserved
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation.
 *
 * Maintained by: Ariel Elior <[email protected]>
 * Written by: Eliezer Tamir
 * Based on code from Michael Chan's bnx2 driver
 * UDP CSUM errata workaround by Arik Gendelman
 * Slowpath and fastpath rework by Vladislav Zolotarov
 * Statistics and Link management by Yitchak Gertner
 *
 */
#ifndef BNX2X_STATS_H
#define BNX2X_STATS_H

#include <linux/types.h>

struct nig_stats {};

enum bnx2x_stats_event {};

enum bnx2x_stats_state {};

struct bnx2x_eth_stats {};

struct bnx2x_eth_q_stats {};

struct bnx2x_eth_stats_old {};

struct bnx2x_eth_q_stats_old {};

struct bnx2x_net_stats_old {};

struct bnx2x_fw_port_stats_old {};

/****************************************************************************
* Macros
****************************************************************************/

/* sum[hi:lo] += add[hi:lo] */
#define ADD_64(s_hi, a_hi, s_lo, a_lo)

#define LE32_0
#define LE16_0

/* The _force is for cases where high value is 0 */
#define ADD_64_LE(s_hi, a_hi_le, s_lo, a_lo_le)

#define ADD_64_LE16(s_hi, a_hi_le, s_lo, a_lo_le)

/* difference = minuend - subtrahend */
#define DIFF_64(d_hi, m_hi, s_hi, d_lo, m_lo, s_lo)

#define UPDATE_STAT64(s, t)

#define UPDATE_STAT64_NIG(s, t)

/* sum[hi:lo] += add */
#define ADD_EXTEND_64(s_hi, s_lo, a)

#define ADD_STAT64(diff, t)

#define UPDATE_EXTEND_STAT(s)

#define UPDATE_EXTEND_TSTAT_X(s, t, size)

#define UPDATE_EXTEND_TSTAT(s, t)

#define UPDATE_EXTEND_E_TSTAT(s, t, size)

#define UPDATE_EXTEND_USTAT(s, t)

#define UPDATE_EXTEND_E_USTAT(s, t)

#define UPDATE_EXTEND_XSTAT(s, t)

#define UPDATE_QSTAT(s, t)

#define UPDATE_QSTAT_OLD(f)

#define UPDATE_ESTAT_QSTAT_64(s)

#define UPDATE_ESTAT_QSTAT(s)

#define UPDATE_FSTAT_QSTAT(s)

#define UPDATE_FW_STAT(s)

#define UPDATE_FW_STAT_OLD(f)

#define UPDATE_ESTAT(s, t)

/* minuend -= subtrahend */
#define SUB_64(m_hi, s_hi, m_lo, s_lo)

/* minuend[hi:lo] -= subtrahend */
#define SUB_EXTEND_64(m_hi, m_lo, s)

#define SUB_EXTEND_USTAT(s, t)

/* forward */
struct bnx2x;

void bnx2x_memset_stats(struct bnx2x *bp);
void bnx2x_stats_init(struct bnx2x *bp);
void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event);
int bnx2x_stats_safe_exec(struct bnx2x *bp,
			  void (func_to_exec)(void *cookie),
			  void *cookie);

/**
 * bnx2x_save_statistics - save statistics when unloading.
 *
 * @bp:		driver handle
 */
void bnx2x_save_statistics(struct bnx2x *bp);

void bnx2x_afex_collect_stats(struct bnx2x *bp, void *void_afex_stats,
			      u32 stats_type);
#endif /* BNX2X_STATS_H */