From: Andrew Lunn <andrew@lunn.ch>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Hauke Mehrtens <hauke@hauke-m.de>,
Simon Horman <horms@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Florian Fainelli <f.fainelli@gmail.com>,
Arkadi Sharshevsky <arkadis@mellanox.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Andreas Schirm <andreas.schirm@siemens.com>,
Lukas Stockmann <lukas.stockmann@siemens.com>,
Alexander Sverdlin <alexander.sverdlin@siemens.com>,
Peter Christen <peter.christen@siemens.com>,
Avinash Jayaraman <ajayaraman@maxlinear.com>,
Bing tao Xu <bxu@maxlinear.com>, Liang Xu <lxu@maxlinear.com>,
Juraj Povazanec <jpovazanec@maxlinear.com>,
"Fanni (Fang-Yi) Chan" <fchan@maxlinear.com>,
"Benny (Ying-Tsan) Weng" <yweng@maxlinear.com>,
"Livia M. Rosu" <lrosu@maxlinear.com>,
John Crispin <john@phrozen.org>
Subject: Re: [PATCH RFC net-next 09/23] net: dsa: lantiq_gswip: add support for SWAPI version 2.3
Date: Sun, 17 Aug 2025 17:36:13 +0200 [thread overview]
Message-ID: <712e82b5-62fc-423a-a356-8cc74fc22e3d@lunn.ch> (raw)
In-Reply-To: <aKDhigwyg2v5mtIG@pidgin.makrotopia.org>
On Sat, Aug 16, 2025 at 08:52:42PM +0100, Daniel Golle wrote:
> 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))
Don't this depend on the endiannes of the CPU?
It seems like it would be better to make your new version member cpu
endian, and when writing to it, do le16_to_cpu().
Also, if i remember correctly, you made version a u32. Should it
really be a u16?
Andrew
next prev parent reply other threads:[~2025-08-17 15:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-16 19:52 Daniel Golle
2025-08-17 15:36 ` Andrew Lunn [this message]
2025-08-17 20:16 ` Daniel Golle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=712e82b5-62fc-423a-a356-8cc74fc22e3d@lunn.ch \
--to=andrew@lunn.ch \
--cc=ajayaraman@maxlinear.com \
--cc=alexander.sverdlin@siemens.com \
--cc=andreas.schirm@siemens.com \
--cc=arkadis@mellanox.com \
--cc=bxu@maxlinear.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=fchan@maxlinear.com \
--cc=hauke@hauke-m.de \
--cc=horms@kernel.org \
--cc=john@phrozen.org \
--cc=jpovazanec@maxlinear.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lrosu@maxlinear.com \
--cc=lukas.stockmann@siemens.com \
--cc=lxu@maxlinear.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=peter.christen@siemens.com \
--cc=yweng@maxlinear.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®