netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC net-next 09/23] net: dsa: lantiq_gswip: add support for SWAPI version 2.3
@ 2025-08-16 19:52 Daniel Golle
  2025-08-17 15:36 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Golle @ 2025-08-16 19:52 UTC (permalink / raw)
  To: Andrew Lunn, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Hauke Mehrtens, Simon Horman,
	Russell King, Florian Fainelli, Arkadi Sharshevsky, linux-kernel,
	netdev
  Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
	Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
	Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
	Livia M. Rosu, John Crispin

Add definition for switch API version 2.3 and a macro to make comparing
the version more conveniant.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/net/dsa/lantiq_gswip.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/lantiq_gswip.h b/drivers/net/dsa/lantiq_gswip.h
index 433b65b047dd..fd0c01edb914 100644
--- a/drivers/net/dsa/lantiq_gswip.h
+++ b/drivers/net/dsa/lantiq_gswip.h
@@ -7,6 +7,7 @@
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
+#include <linux/swab.h>
 #include <net/dsa.h>
 
 /* GSWIP MDIO Registers */
@@ -93,6 +94,8 @@
 #define   GSWIP_VERSION_2_1		0x021
 #define   GSWIP_VERSION_2_2		0x122
 #define   GSWIP_VERSION_2_2_ETC		0x022
+#define   GSWIP_VERSION_2_3		0x023
+#define GSWIP_VERSION_GE(priv, ver)	(swab16(priv->version) >= swab16(ver))
 
 #define GSWIP_BM_RAM_VAL(x)		(0x043 - (x))
 #define GSWIP_BM_RAM_ADDR		0x044
-- 
2.50.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-17 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-16 19:52 [PATCH RFC net-next 09/23] net: dsa: lantiq_gswip: add support for SWAPI version 2.3 Daniel Golle
2025-08-17 15:36 ` Andrew Lunn
2025-08-17 20:16   ` Daniel Golle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).