summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac.h
diff options
context:
space:
mode:
authorJose Abreu <Jose.Abreu@synopsys.com>2019-05-24 10:20:19 +0200
committerDavid S. Miller <davem@davemloft.net>2019-05-24 13:45:56 -0700
commit091810dbded96c2af81f645e386e4262553e3493 (patch)
tree0c2cbdd9ae2efd64dc97c61e3e9fc61af0274672 /drivers/net/ethernet/stmicro/stmmac/stmmac.h
parent8c5f48d99de21ef7591051985e602a3204619260 (diff)
net: stmmac: Introduce selftests support
We add support for selftests on stmmac driver with 9 basic sanity checks for now: - MAC Loopback - PHY Loopback - MMC Counters - EEE - Hash Filter Multicast - Perfect Filter Unicast - Multicast Filter All - Unicast Filter All - Flow Control This allows for fast tracking of regressions in the driver and helps in spotting mis-configuration of HW. Changes from v1: - Fix build error as module (David) - Check for link status before running tests Changes from RFC v2: - Return proper error code in stmmac_test_mmc (Corentin) - Use only 1 MMC counter in stmmac_test_mmc (Alexandre) Changes from RFC v1: - Change test_loopback to test_mac_loopback (Andrew) - Change timeout to retries (Andrew) - Add MC/UC filter tests (Andrew) - Only test in offline mode (Andrew) - Do not call phy_loopback twice (Alexandre) Signed-off-by: Jose Abreu <joabreu@synopsys.com> Cc: Joao Pinto <jpinto@synopsys.com> Cc: David S. Miller <davem@davemloft.net> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Corentin Labbe <clabbe.montjoie@gmail.com> Cc: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac.h')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index dd95d959c1ce..a16ada8b8507 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -229,4 +229,26 @@ int stmmac_dvr_probe(struct device *device,
void stmmac_disable_eee_mode(struct stmmac_priv *priv);
bool stmmac_eee_init(struct stmmac_priv *priv);
+#if IS_ENABLED(CONFIG_STMMAC_SELFTESTS)
+void stmmac_selftest_run(struct net_device *dev,
+ struct ethtool_test *etest, u64 *buf);
+void stmmac_selftest_get_strings(struct stmmac_priv *priv, u8 *data);
+int stmmac_selftest_get_count(struct stmmac_priv *priv);
+#else
+static inline void stmmac_selftest_run(struct net_device *dev,
+ struct ethtool_test *etest, u64 *buf)
+{
+ /* Not enabled */
+}
+static inline void stmmac_selftest_get_strings(struct stmmac_priv *priv,
+ u8 *data)
+{
+ /* Not enabled */
+}
+static inline int stmmac_selftest_get_count(struct stmmac_priv *priv)
+{
+ return -EOPNOTSUPP;
+}
+#endif /* CONFIG_STMMAC_SELFTESTS */
+
#endif /* __STMMAC_H__ */