]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: dsa: lantiq_gswip: store switch API version in priv
authorDaniel Golle <daniel@makrotopia.org>
Fri, 22 Aug 2025 16:12:21 +0000 (17:12 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 25 Aug 2025 22:15:46 +0000 (15:15 -0700)
commit8a7576d220c1d01a96fe2e7e537315013a71159e
treeb572672b824e6f9fd1ee2d8fe20d4e5ae0d56260
parent1ccc407285e284393f85b6c39f52e11b04a0694b
net: dsa: lantiq_gswip: store switch API version in priv

Store the switch API version in struct gswip_priv. As the hardware has
the 'major/minor' version bytes in the wrong order preventing numerical
comparisons the version to be stored in gswip_priv is constructed in
such a way that the REV field is the most significant byte and the MOD
field the least significant byte. Also provide a conveniance macro to
allow comparing the stored version of the hardware against the already
defined GSWIP_VERSION_* macros.

This is done in order to prepare supporting newer features such as 4096
VLANs and per-port configurable learning which are only available
starting from specific hardware versions.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/eddb51ae8d0b2046ca91906e93daad7be5af56d7.1755878232.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/lantiq_gswip.c
drivers/net/dsa/lantiq_gswip.h