From: Andrew Lunn <andrew@lunn.ch>
To: Christian Marangi <ansuelsmth@gmail.com>
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:08:34 +0200 [thread overview]
Message-ID: <d440416f-103b-49a1-a077-c6003be9f80f@lunn.ch> (raw)
In-Reply-To: <20250823134431.4854-1-ansuelsmth@gmail.com>
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.
Andrew
next prev parent reply other threads:[~2025-08-24 16:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-23 13:44 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 ` Andrew Lunn [this message]
2025-08-24 16:10 ` [net-next PATCH v2 1/2] net: phy: introduce phy_id_compare_vendor() PHY ID helper Christian Marangi
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=d440416f-103b-49a1-a077-c6003be9f80f@lunn.ch \
--to=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--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 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®