summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/qca/qca8k.h
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-07-27 13:35:16 +0200
committerJakub Kicinski <kuba@kernel.org>2022-07-29 07:24:38 +0200
commit472fcea160f27a5d9b7526093d9d8d89ba0b6137 (patch)
tree98deb954305971240dba3bfd6c52c45a3a877633 /drivers/net/dsa/qca/qca8k.h
parentnet: dsa: qca8k: move mib init function to common code (diff)
downloadlinux-472fcea160f27a5d9b7526093d9d8d89ba0b6137.tar.xz
linux-472fcea160f27a5d9b7526093d9d8d89ba0b6137.zip
net: dsa: qca8k: move port set status/eee/ethtool stats function to common code
The same logic to disable/enable port, set eee and get ethtool stats is used by drivers based on qca8k family switch. Move it to common code to make it accessible also by other drivers. While at it also drop unnecessary qca8k_priv cast for void pointers. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/dsa/qca/qca8k.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/dsa/qca/qca8k.h b/drivers/net/dsa/qca/qca8k.h
index f55ef97f826f..c73cbdfc6ac6 100644
--- a/drivers/net/dsa/qca/qca8k.h
+++ b/drivers/net/dsa/qca/qca8k.h
@@ -431,6 +431,7 @@ struct qca8k_fdb {
extern const struct qca8k_mib_desc ar8327_mib[];
extern const struct regmap_access_table qca8k_readable_table;
int qca8k_mib_init(struct qca8k_priv *priv);
+void qca8k_port_set_status(struct qca8k_priv *priv, int port, int enable);
/* Common read/write/rmw function */
int qca8k_read(struct qca8k_priv *priv, u32 reg, u32 *val);
@@ -443,4 +444,14 @@ int qca8k_bulk_write(struct qca8k_priv *priv, u32 reg, u32 *val, int len);
/* Common ops function */
int qca8k_busy_wait(struct qca8k_priv *priv, u32 reg, u32 mask);
+/* Common ethtool stats function */
+void qca8k_get_strings(struct dsa_switch *ds, int port, u32 stringset, uint8_t *data);
+void qca8k_get_ethtool_stats(struct dsa_switch *ds, int port,
+ uint64_t *data);
+int qca8k_get_sset_count(struct dsa_switch *ds, int port, int sset);
+
+/* Common eee function */
+int qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee);
+int qca8k_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
+
#endif /* __QCA8K_H */