summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2021-11-27 09:50:12 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-06-21 10:57:42 +0100
commit72369cfc114b5583ff5e42048586c39ab243ca1f (patch)
treecb538ca4951f599fdfc3a6b6f99b5642d06b15e7
parentfc7b888a5449e894dcd972364f1cc4cb5809ed7f (diff)
net: phy: marvell10g: fill in possible_interfaces
Fill in the possible_interfaces member according to the selected mactype mode. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/marvell10g.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index d46b35caaf7a..9e1472a5dcce 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -778,6 +778,7 @@ static int mv3310_config_init(struct phy_device *phydev)
{
struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
const struct mv3310_chip *chip = to_mv3310_chip(phydev);
+ unsigned long *possible;
int err, mactype;
/* Check that the PHY interface type is compatible */
@@ -802,6 +803,18 @@ static int mv3310_config_init(struct phy_device *phydev)
priv->mactype = &chip->mactypes[mactype];
+ possible = phydev->possible_interfaces;
+ phy_interface_zero(possible);
+
+ if (priv->mactype->interface_10g != PHY_INTERFACE_MODE_NA)
+ __set_bit(priv->mactype->interface_10g, possible);
+
+ if (!priv->mactype->fixed_interface) {
+ __set_bit(PHY_INTERFACE_MODE_5GBASER, possible);
+ __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible);
+ __set_bit(PHY_INTERFACE_MODE_SGMII, possible);
+ }
+
/* Enable EDPD mode - saving 600mW */
err = mv3310_set_edpd(phydev, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS);
if (err)