Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: add qca8081 config_aneg

Reuse at803x phy driver config_aneg excepting
adding 2500M auto-negotiation.

Signed-off-by: Luo Jie <luoj@codeaurora.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Luo Jie and committed by
David S. Miller
f884d449 765c22aa

+25 -1
+25 -1
drivers/net/phy/at803x.c
··· 1109 1109 return ret; 1110 1110 } 1111 1111 1112 - return genphy_config_aneg(phydev); 1112 + /* Do not restart auto-negotiation by setting ret to 0 defautly, 1113 + * when calling __genphy_config_aneg later. 1114 + */ 1115 + ret = 0; 1116 + 1117 + if (phydev->drv->phy_id == QCA8081_PHY_ID) { 1118 + int phy_ctrl = 0; 1119 + 1120 + /* The reg MII_BMCR also needs to be configured for force mode, the 1121 + * genphy_config_aneg is also needed. 1122 + */ 1123 + if (phydev->autoneg == AUTONEG_DISABLE) 1124 + genphy_c45_pma_setup_forced(phydev); 1125 + 1126 + if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->advertising)) 1127 + phy_ctrl = MDIO_AN_10GBT_CTRL_ADV2_5G; 1128 + 1129 + ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL, 1130 + MDIO_AN_10GBT_CTRL_ADV2_5G, phy_ctrl); 1131 + if (ret < 0) 1132 + return ret; 1133 + } 1134 + 1135 + return __genphy_config_aneg(phydev, ret); 1113 1136 } 1114 1137 1115 1138 static int at803x_get_downshift(struct phy_device *phydev, u8 *d) ··· 1686 1663 .set_wol = at803x_set_wol, 1687 1664 .get_wol = at803x_get_wol, 1688 1665 .get_features = at803x_get_features, 1666 + .config_aneg = at803x_config_aneg, 1689 1667 .suspend = genphy_suspend, 1690 1668 .resume = genphy_resume, 1691 1669 .read_status = qca808x_read_status,