lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180425191254.3467-9-f.fainelli@gmail.com>
Date:   Wed, 25 Apr 2018 12:12:54 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     netdev@...r.kernel.org
Cc:     Florian Fainelli <f.fainelli@...il.com>, andrew@...n.ch,
        vivien.didelot@...oirfairelinux.com, cphealy@...il.com,
        davem@...emloft.net, nikita.yoush@...entembedded.com
Subject: [PATCH net-next 8/8] net: dsa: loop: Hook PHY statistics

We just return the same statistics through ethtool_get_stats() and
ethtool_get_phy_stats() for simplicity since this is just a mock-up driver.

Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
 drivers/net/dsa/dsa_loop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index 9354cc08d3fd..58f14af04639 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -88,7 +88,7 @@ static int dsa_loop_setup(struct dsa_switch *ds)
 
 static int dsa_loop_get_sset_count(struct dsa_switch *ds, int port, int sset)
 {
-	if (sset != ETH_SS_STATS)
+	if (sset != ETH_SS_STATS && sset != ETH_SS_PHY_STATS)
 		return 0;
 
 	return __DSA_LOOP_CNT_MAX;
@@ -100,7 +100,7 @@ static void dsa_loop_get_strings(struct dsa_switch *ds, int port,
 	struct dsa_loop_priv *ps = ds->priv;
 	unsigned int i;
 
-	if (stringset != ETH_SS_STATS)
+	if (stringset != ETH_SS_STATS && stringset != ETH_SS_PHY_STATS)
 		return;
 
 	for (i = 0; i < __DSA_LOOP_CNT_MAX; i++)
@@ -263,6 +263,7 @@ static const struct dsa_switch_ops dsa_loop_driver = {
 	.get_strings		= dsa_loop_get_strings,
 	.get_ethtool_stats	= dsa_loop_get_ethtool_stats,
 	.get_sset_count		= dsa_loop_get_sset_count,
+	.get_ethtool_phy_stats	= dsa_loop_get_ethtool_stats,
 	.phy_read		= dsa_loop_phy_read,
 	.phy_write		= dsa_loop_phy_write,
 	.port_bridge_join	= dsa_loop_port_bridge_join,
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ