linux/drivers/net/ethernet/mscc/ocelot_stats.c

// SPDX-License-Identifier: (GPL-2.0 OR MIT)
/* Statistics for Ocelot switch family
 *
 * Copyright (c) 2017 Microsemi Corporation
 * Copyright 2022 NXP
 */
#include <linux/ethtool_netlink.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include "ocelot.h"

enum ocelot_stat {};

struct ocelot_stat_layout {};

/* 32-bit counter checked for wraparound by ocelot_port_update_stats()
 * and copied to ocelot->stats.
 */
#define OCELOT_STAT(kind)
/* Same as above, except also exported to ethtool -S. Standard counters should
 * only be exposed to more specific interfaces rather than by their string name.
 */
#define OCELOT_STAT_ETHTOOL(kind, ethtool_name)

#define OCELOT_COMMON_STATS

struct ocelot_stats_region {};

static const struct ocelot_stat_layout ocelot_stats_layout[OCELOT_NUM_STATS] =;

static const struct ocelot_stat_layout ocelot_mm_stats_layout[OCELOT_NUM_STATS] =;

static const struct ocelot_stat_layout *
ocelot_get_stats_layout(struct ocelot *ocelot)
{}

/* Read the counters from hardware and keep them in region->buf.
 * Caller must hold &ocelot->stat_view_lock.
 */
static int ocelot_port_update_stats(struct ocelot *ocelot, int port)
{}

/* Transfer the counters from region->buf to ocelot->stats.
 * Caller must hold &ocelot->stat_view_lock and &ocelot->stats_lock.
 */
static void ocelot_port_transfer_stats(struct ocelot *ocelot, int port)
{}

static void ocelot_check_stats_work(struct work_struct *work)
{}

void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data)
{}
EXPORT_SYMBOL();

/* Update ocelot->stats for the given port and run the given callback */
static void ocelot_port_stats_run(struct ocelot *ocelot, int port, void *priv,
				  void (*cb)(struct ocelot *ocelot, int port,
					     void *priv))
{}

int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset)
{}
EXPORT_SYMBOL();

static void ocelot_port_ethtool_stats_cb(struct ocelot *ocelot, int port,
					 void *priv)
{}

void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data)
{}
EXPORT_SYMBOL();

static void ocelot_port_pause_stats_cb(struct ocelot *ocelot, int port, void *priv)
{}

static void ocelot_port_pmac_pause_stats_cb(struct ocelot *ocelot, int port,
					    void *priv)
{}

static void ocelot_port_mm_stats_cb(struct ocelot *ocelot, int port,
				    void *priv)
{}

void ocelot_port_get_pause_stats(struct ocelot *ocelot, int port,
				 struct ethtool_pause_stats *pause_stats)
{}
EXPORT_SYMBOL_GPL();

void ocelot_port_get_mm_stats(struct ocelot *ocelot, int port,
			      struct ethtool_mm_stats *stats)
{}
EXPORT_SYMBOL_GPL();

static const struct ethtool_rmon_hist_range ocelot_rmon_ranges[] =;

static void ocelot_port_rmon_stats_cb(struct ocelot *ocelot, int port, void *priv)
{}

static void ocelot_port_pmac_rmon_stats_cb(struct ocelot *ocelot, int port,
					   void *priv)
{}

void ocelot_port_get_rmon_stats(struct ocelot *ocelot, int port,
				struct ethtool_rmon_stats *rmon_stats,
				const struct ethtool_rmon_hist_range **ranges)
{}
EXPORT_SYMBOL_GPL();

static void ocelot_port_ctrl_stats_cb(struct ocelot *ocelot, int port, void *priv)
{}

static void ocelot_port_pmac_ctrl_stats_cb(struct ocelot *ocelot, int port,
					   void *priv)
{}

void ocelot_port_get_eth_ctrl_stats(struct ocelot *ocelot, int port,
				    struct ethtool_eth_ctrl_stats *ctrl_stats)
{}
EXPORT_SYMBOL_GPL();

static void ocelot_port_mac_stats_cb(struct ocelot *ocelot, int port, void *priv)
{}

static void ocelot_port_pmac_mac_stats_cb(struct ocelot *ocelot, int port,
					  void *priv)
{}

void ocelot_port_get_eth_mac_stats(struct ocelot *ocelot, int port,
				   struct ethtool_eth_mac_stats *mac_stats)
{}
EXPORT_SYMBOL_GPL();

static void ocelot_port_phy_stats_cb(struct ocelot *ocelot, int port, void *priv)
{}

static void ocelot_port_pmac_phy_stats_cb(struct ocelot *ocelot, int port,
					  void *priv)
{}

void ocelot_port_get_eth_phy_stats(struct ocelot *ocelot, int port,
				   struct ethtool_eth_phy_stats *phy_stats)
{}
EXPORT_SYMBOL_GPL();

void ocelot_port_get_stats64(struct ocelot *ocelot, int port,
			     struct rtnl_link_stats64 *stats)
{}
EXPORT_SYMBOL();

static int ocelot_prepare_stats_regions(struct ocelot *ocelot)
{}

int ocelot_stats_init(struct ocelot *ocelot)
{}

void ocelot_stats_deinit(struct ocelot *ocelot)
{}