[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <68ab398f.050a0220.29c994.a368@mx.google.com>
Date: Sun, 24 Aug 2025 18:10:52 +0200
From: Christian Marangi <ansuelsmth@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [net-next PATCH v2 1/2] net: phy: introduce
phy_id_compare_vendor() PHY ID helper
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@...il.com>
>
> Hi Christian
>
> Reviewed-by: Andrew Lunn <andrew@...n.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
Powered by blists - more mailing lists