netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "Broadcom internal kernel review list"
	<bcm-kernel-feedback-list@broadcom.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Marek Behún" <kabel@kernel.org>,
	netdev@vger.kernel.org, "Paolo Abeni" <pabeni@redhat.com>,
	"Marek Beh__n" <kabel@kernel.org>
Subject: [PATCH net-next 03/10] net: phy: marvell10g: fill in possible_interfaces
Date: Fri, 24 Nov 2023 12:28:03 +0000	[thread overview]
Message-ID: <E1r6VHv-00DDLZ-OL@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZWCWn+uNkVLPaQhn@shell.armlinux.org.uk>

Fill in the possible_interfaces member according to the selected
mactype mode.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/marvell10g.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index a880b3375dee..ad43e280930c 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -803,6 +803,22 @@ static const struct mv3310_mactype mv3340_mactypes[] = {
 	},
 };
 
+static void mv3310_fill_possible_interfaces(struct phy_device *phydev)
+{
+	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
+	unsigned long *possible = phydev->possible_interfaces;
+	const struct mv3310_mactype *mactype = priv->mactype;
+
+	if (mactype->interface_10g != PHY_INTERFACE_MODE_NA)
+		__set_bit(priv->mactype->interface_10g, possible);
+
+	if (!mactype->fixed_interface) {
+		__set_bit(PHY_INTERFACE_MODE_5GBASER, possible);
+		__set_bit(PHY_INTERFACE_MODE_2500BASEX, possible);
+		__set_bit(PHY_INTERFACE_MODE_SGMII, possible);
+	}
+}
+
 static int mv3310_config_init(struct phy_device *phydev)
 {
 	struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
@@ -845,6 +861,8 @@ static int mv3310_config_init(struct phy_device *phydev)
 
 	priv->mactype = &chip->mactypes[mactype];
 
+	mv3310_fill_possible_interfaces(phydev);
+
 	/* Enable EDPD mode - saving 600mW */
 	err = mv3310_set_edpd(phydev, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS);
 	if (err)
-- 
2.30.2


  parent reply	other threads:[~2023-11-24 12:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 12:27 [PATCH net-next 00/10] net: phylink: improve PHY validation Russell King (Oracle)
2023-11-24 12:27 ` [PATCH net-next 01/10] net: phy: add possible interfaces Russell King (Oracle)
2023-11-25 17:06   ` Andrew Lunn
2023-11-24 12:27 ` [PATCH net-next 02/10] net: phy: marvell10g: table driven mactype decode Russell King (Oracle)
2023-11-24 12:28 ` Russell King (Oracle) [this message]
2023-11-25 17:09   ` [PATCH net-next 03/10] net: phy: marvell10g: fill in possible_interfaces Andrew Lunn
2023-11-24 12:28 ` [PATCH net-next 04/10] net: phy: bcm84881: " Russell King (Oracle)
2023-11-25 17:10   ` Andrew Lunn
2023-11-24 12:28 ` [PATCH net-next 05/10] net: phy: aquantia: fill in possible_interfaces for AQR113C Russell King (Oracle)
2023-11-25 17:11   ` Andrew Lunn
2023-11-24 12:28 ` [PATCH net-next 06/10] net: phylink: split out per-interface validation Russell King (Oracle)
2023-11-25 17:12   ` Andrew Lunn
2023-11-24 12:28 ` [PATCH net-next 07/10] net: phylink: pass PHY into phylink_validate_one() Russell King (Oracle)
2023-11-25 17:13   ` Andrew Lunn
2023-11-24 12:28 ` [PATCH net-next 08/10] net: phylink: pass PHY into phylink_validate_mask() Russell King (Oracle)
2023-11-25 17:13   ` Andrew Lunn
2023-11-24 12:28 ` [PATCH net-next 09/10] net: phylink: split out PHY validation from phylink_bringup_phy() Russell King (Oracle)
2023-11-25 17:15   ` Andrew Lunn
2023-11-24 12:28 ` [PATCH net-next 10/10] net: phylink: use the PHY's possible_interfaces if populated Russell King (Oracle)
2023-11-25 17:18   ` Andrew Lunn
2023-11-28  2:08 ` [PATCH net-next 00/10] net: phylink: improve PHY validation Jakub Kicinski
2023-11-28  2: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=E1r6VHv-00DDLZ-OL@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).