From: Christian Marangi <ansuelsmth@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [net-next PATCH v2 1/2] net: phy: introduce phy_id_compare_vendor() PHY ID helper
Date: Sun, 24 Aug 2025 18:10:52 +0200 [thread overview]
Message-ID: <68ab398f.050a0220.29c994.a368@mx.google.com> (raw)
In-Reply-To: <d440416f-103b-49a1-a077-c6003be9f80f@lunn.ch>
On Sun, Aug 24, 2025 at 06:08:34PM +0200, Andrew Lunn wrote:
> On Sat, Aug 23, 2025 at 03:44:28PM +0200, Christian Marangi wrote:
> > Introduce phy_id_compare_vendor() PHY ID helper to compare a PHY ID with
> > the PHY ID Vendor using the generic PHY ID Vendor mask.
> >
> > While at it also rework the PHY_ID_MATCH macro and move the mask to
> > dedicated define so that PHY driver can make use of the mask if needed.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
>
> Hi Christian
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> > +/**
> > + * phy_id_compare_vendor - compare @id with @vendor mask
> > + * @id: PHY ID
> > + * @vendor_mask: PHY Vendor mask
> > + *
> > + * Return: true if the bits from @id match @vendor using the
> > + * generic PHY Vendor mask.
> > + */
> > +static inline bool phy_id_compare_vendor(u32 id, u32 vendor_mask)
> > +{
> > + return phy_id_compare(id, vendor_mask, PHY_ID_MATCH_VENDOR_MASK);
> > +}
> > +
>
> broadcom.c: if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
> broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) {
> broadcom.c: if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM57780) {
> broadcom.c: if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
> broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
> broadcom.c: if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E ||
> broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810 ||
> broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54811)
> broadcom.c: if ((BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610 ||
> broadcom.c: BRCM_PHY_MODEL(phydev) == PHY_ID_BCM50610M) &&
>
> It looks like there is a use case of phy_id_compare_model(), if you
> feel like adding it.
>
Thanks for pointing this out, I wasn't sure to add a _model() variant as
there wasn't an user for it. I will submit a new series after this gets
merged introducing also this variant.
--
Ansuel
next prev parent reply other threads:[~2025-08-24 16:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-23 13:44 [net-next PATCH v2 1/2] net: phy: introduce phy_id_compare_vendor() PHY ID helper Christian Marangi
2025-08-23 13:44 ` [net-next PATCH v2 2/2] net: phy: as21xxx: better handle PHY HW reset on soft-reboot Christian Marangi
2025-08-24 16:08 ` [net-next PATCH v2 1/2] net: phy: introduce phy_id_compare_vendor() PHY ID helper Andrew Lunn
2025-08-24 16:10 ` Christian Marangi [this message]
2025-08-27 0:20 ` patchwork-bot+netdevbpf
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=68ab398f.050a0220.29c994.a368@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.