Commit 67f38b1c authored by Clément Léger's avatar Clément Léger Committed by David S. Miller

net: dsa: add support for ethtool get_rmon_stats()

Add support to allow dsa drivers to specify the .get_rmon_stats()
operation.
Signed-off-by: default avatarClément Léger <clement.leger@bootlin.com>
Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c6e8088
...@@ -888,6 +888,9 @@ struct dsa_switch_ops { ...@@ -888,6 +888,9 @@ struct dsa_switch_ops {
struct ethtool_eth_mac_stats *mac_stats); struct ethtool_eth_mac_stats *mac_stats);
void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port, void (*get_eth_ctrl_stats)(struct dsa_switch *ds, int port,
struct ethtool_eth_ctrl_stats *ctrl_stats); struct ethtool_eth_ctrl_stats *ctrl_stats);
void (*get_rmon_stats)(struct dsa_switch *ds, int port,
struct ethtool_rmon_stats *rmon_stats,
const struct ethtool_rmon_hist_range **ranges);
void (*get_stats64)(struct dsa_switch *ds, int port, void (*get_stats64)(struct dsa_switch *ds, int port,
struct rtnl_link_stats64 *s); struct rtnl_link_stats64 *s);
void (*self_test)(struct dsa_switch *ds, int port, void (*self_test)(struct dsa_switch *ds, int port,
......
...@@ -1002,6 +1002,18 @@ dsa_slave_get_eth_ctrl_stats(struct net_device *dev, ...@@ -1002,6 +1002,18 @@ dsa_slave_get_eth_ctrl_stats(struct net_device *dev,
ds->ops->get_eth_ctrl_stats(ds, dp->index, ctrl_stats); ds->ops->get_eth_ctrl_stats(ds, dp->index, ctrl_stats);
} }
static void
dsa_slave_get_rmon_stats(struct net_device *dev,
struct ethtool_rmon_stats *rmon_stats,
const struct ethtool_rmon_hist_range **ranges)
{
struct dsa_port *dp = dsa_slave_to_port(dev);
struct dsa_switch *ds = dp->ds;
if (ds->ops->get_rmon_stats)
ds->ops->get_rmon_stats(ds, dp->index, rmon_stats, ranges);
}
static void dsa_slave_net_selftest(struct net_device *ndev, static void dsa_slave_net_selftest(struct net_device *ndev,
struct ethtool_test *etest, u64 *buf) struct ethtool_test *etest, u64 *buf)
{ {
...@@ -2081,6 +2093,7 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = { ...@@ -2081,6 +2093,7 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
.get_eth_phy_stats = dsa_slave_get_eth_phy_stats, .get_eth_phy_stats = dsa_slave_get_eth_phy_stats,
.get_eth_mac_stats = dsa_slave_get_eth_mac_stats, .get_eth_mac_stats = dsa_slave_get_eth_mac_stats,
.get_eth_ctrl_stats = dsa_slave_get_eth_ctrl_stats, .get_eth_ctrl_stats = dsa_slave_get_eth_ctrl_stats,
.get_rmon_stats = dsa_slave_get_rmon_stats,
.set_wol = dsa_slave_set_wol, .set_wol = dsa_slave_set_wol,
.get_wol = dsa_slave_get_wol, .get_wol = dsa_slave_get_wol,
.set_eee = dsa_slave_set_eee, .set_eee = dsa_slave_set_eee,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment