Skip to content

Commit 48fb199

Browse files
oleremdavem330
authored andcommitted
net: phy: micrel: add ksz9477_get_features()
KSZ8563R, which has same PHYID as KSZ9477 family, will change "EEE control and capability 1" (Register 3.20) content depending on configuration of "EEE advertisement 1" (Register 7.60). Changes on the 7.60 will affect 3.20 register. So, instead of depending on register 3.20, driver should set supported_eee. Proper supported_eee configuration is needed to make use of generic PHY c45 set/get_eee functions provided by next patches. Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 14e47d1 commit 48fb199

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/net/phy/micrel.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,26 @@ static int ksz9131_config_aneg(struct phy_device *phydev)
13921392
return genphy_config_aneg(phydev);
13931393
}
13941394

1395+
static int ksz9477_get_features(struct phy_device *phydev)
1396+
{
1397+
int ret;
1398+
1399+
ret = genphy_read_abilities(phydev);
1400+
if (ret)
1401+
return ret;
1402+
1403+
/* The "EEE control and capability 1" (Register 3.20) seems to be
1404+
* influenced by the "EEE advertisement 1" (Register 7.60). Changes
1405+
* on the 7.60 will affect 3.20. So, we need to construct our own list
1406+
* of caps.
1407+
* KSZ8563R should have 100BaseTX/Full only.
1408+
*/
1409+
linkmode_and(phydev->supported_eee, phydev->supported,
1410+
PHY_EEE_CAP1_FEATURES);
1411+
1412+
return 0;
1413+
}
1414+
13951415
#define KSZ8873MLL_GLOBAL_CONTROL_4 0x06
13961416
#define KSZ8873MLL_GLOBAL_CONTROL_4_DUPLEX BIT(6)
13971417
#define KSZ8873MLL_GLOBAL_CONTROL_4_SPEED BIT(4)
@@ -4172,6 +4192,7 @@ static struct phy_driver ksphy_driver[] = {
41724192
.handle_interrupt = kszphy_handle_interrupt,
41734193
.suspend = genphy_suspend,
41744194
.resume = genphy_resume,
4195+
.get_features = ksz9477_get_features,
41754196
} };
41764197

41774198
module_phy_driver(ksphy_driver);

0 commit comments

Comments
 (0)