From: Andrew Lunn <andrew@lunn.ch>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: Mieczyslaw Nalewaj <namiltd@yahoo.com>,
linusw@kernel.org, olteanv@gmail.com, kuba@kernel.org,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
linux@armlinux.org.uk, maxime.chevallier@bootlin.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v6 3/9] net: dsa: realtek: rtl8365mb: set speed for family D
Date: Mon, 19 Oct 2026 01:04:20 +0200 [thread overview]
Message-ID: <2d26a270-fb06-4971-b9e1-3e3572a8b814@lunn.ch> (raw)
In-Reply-To: <CAJq09z5ZAxca0rRT0mSiU_3xp2wxEU4qahbDM3SBGpwe1vbMRw@mail.gmail.com>
On Sun, Oct 18, 2026 at 07:40:47PM -0300, Luiz Angelo Daros de Luca wrote:
> > diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> > index 840db5a..2dabc4d 100644
> > --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> > +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
> > @@ -344,6 +344,7 @@
> > #define RTL8365MB_PORT_SPEED_10M 0
> > #define RTL8365MB_PORT_SPEED_100M 1
> > #define RTL8365MB_PORT_SPEED_1000M 2
> > +#define RTL8365MB_D_PORT_SPEED_2500M 5
>
> I also used the same _<FAMILY>_ tag trick previously, but it gets
> confusing quickly. Does RTL8365MB_D_xxx mean something exclusive to
> family D, or family D and later? I hope a more seasoned reviewer can
> weigh in on this.
The Marvell switch driver does something similar. There are a few
families of devices, and within each family, a few devices. Within a
family, the devices are register compatible, but they either have
different number of ports, or features are not present.
The naming of functions and defines is based around the highest family
member of the family which introduced the feature. A few examples:
int mv88e6097_port_pause_limit(struct mv88e6xxx_chip *chip, int port, u8 in,
u8 out);
int mv88e6390_port_pause_limit(struct mv88e6xxx_chip *chip, int port, u8 in,
u8 out);
The feature was first introduced in mv88e6097, and this method is used
in all families until the mv88e6390 came along, which required a
different implementation because the registers changed.
So i would say RTL8365MB_D_xxx means D and later. And if you need
RTL8365MB_F_xxx, put it close by so other developers are aware it
exists.
What we also sometimes do is have a mv88e6xxx_foo function, which is
generic, but it calls mv88e6352_foo, mv88e6189_foo, mv88e6393_foo as
needed.
Andrew
next prev parent reply other threads:[~2026-10-18 23:04 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5a4715dd-89e0-4868-9ffb-c8fb73b18d04.ref@yahoo.com>
2026-10-16 0:59 ` [PATCH net-next v6 0/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-16 1:01 ` [PATCH net-next v6 1/9] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-10-16 13:50 ` Luiz Angelo Daros de Luca
2026-10-16 1:02 ` [PATCH net-next v6 2/9] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-10-16 13:53 ` Luiz Angelo Daros de Luca
2026-10-16 1:03 ` [PATCH net-next v6 3/9] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-10-16 20:04 ` Linus Walleij
2026-10-18 22:40 ` Luiz Angelo Daros de Luca
2026-10-18 23:04 ` Andrew Lunn [this message]
2026-10-19 8:28 ` Linus Walleij
2026-10-20 1:41 ` netdev-bot+sashiko
2026-10-16 1:04 ` [PATCH net-next v6 4/9] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-10-16 20:06 ` Linus Walleij
2026-10-20 1:41 ` netdev-bot+sashiko
2026-10-16 1:05 ` [PATCH net-next v6 5/9] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-10-16 20:06 ` Linus Walleij
2026-10-16 1:06 ` [PATCH net-next v6 6/9] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-10-16 20:08 ` Linus Walleij
2026-10-16 1:07 ` [PATCH net-next v6 7/9] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-10-16 20:14 ` Linus Walleij
2026-10-16 1:08 ` [PATCH net-next v6 8/9] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-10-16 20:17 ` Linus Walleij
2026-10-20 1:41 ` netdev-bot+sashiko
2026-10-16 1:09 ` [PATCH net-next v6 9/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-10-16 20:17 ` Linus Walleij
2026-10-20 1:41 ` netdev-bot+sashiko
2026-10-17 10:59 ` [PATCH net-next v6 0/9] " Stanislaw Pal
2026-10-19 2:44 ` Luiz Angelo Daros de Luca
2026-10-19 5:09 ` Mieczyslaw Nalewaj
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=2d26a270-fb06-4971-b9e1-3e3572a8b814@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=luizluca@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=namiltd@yahoo.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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®