diff options
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index ef0fc54949..dbcb1c41c4 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -2552,6 +2552,18 @@ ar8xxx_phy_config_aneg(struct phy_device *phydev) return genphy_config_aneg(phydev); } +static int +ar8xxx_get_features(struct phy_device *phydev) +{ + struct ar8xxx_priv *priv = phydev->priv; + + linkmode_copy(phydev->supported, PHY_BASIC_FEATURES); + if (ar8xxx_has_gige(priv)) + linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported); + + return 0; +} + static const u32 ar8xxx_phy_ids[] = { 0x004dd033, 0x004dd034, /* AR8327 */ @@ -2649,29 +2661,14 @@ ar8xxx_phy_probe(struct phy_device *phydev) found: priv->use_count++; - if (phydev->mdio.addr == 0) { - linkmode_zero(phydev->supported); - if (ar8xxx_has_gige(priv)) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported); - else - linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, phydev->supported); - linkmode_copy(phydev->advertising, phydev->supported); + if (phydev->mdio.addr == 0 && priv->chip->config_at_probe) { + priv->phy = phydev; - if (priv->chip->config_at_probe) { - priv->phy = phydev; - - ret = ar8xxx_start(priv); - if (ret) - goto err_unregister_switch; - } - } else { - if (ar8xxx_has_gige(priv)) { - linkmode_zero(phydev->supported); - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported); - linkmode_copy(phydev->advertising, phydev->supported); - } - if (priv->chip->phy_rgmii_set) - priv->chip->phy_rgmii_set(priv, phydev); + ret = ar8xxx_start(priv); + if (ret) + goto err_unregister_switch; + } else if (priv->chip->phy_rgmii_set) { + priv->chip->phy_rgmii_set(priv, phydev); } phydev->priv = priv; @@ -2746,7 +2743,6 @@ static struct phy_driver ar8xxx_phy_driver[] = { .phy_id = 0x004d0000, .name = "Atheros AR8216/AR8236/AR8316", .phy_id_mask = 0xffff0000, - .features = PHY_BASIC_FEATURES, .probe = ar8xxx_phy_probe, .remove = ar8xxx_phy_remove, .detach = ar8xxx_phy_detach, @@ -2754,6 +2750,7 @@ static struct phy_driver ar8xxx_phy_driver[] = { .config_aneg = ar8xxx_phy_config_aneg, .read_status = ar8xxx_phy_read_status, .soft_reset = ar8xxx_phy_soft_reset, + .get_features = ar8xxx_get_features, } }; |