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-01-18 10:17:22 +0000
commit92fe5b2f6d9d812e372bc3d21ea87aa817c6da2f (patch)
tree3729083ef874b5669d80b751e2aa04cf94f95010
parent5638a446559276f385456953179a11bc5452bb11 (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 6317f94577bc..07524046531e 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)