net: ethernet: Use phy_set_max_speed() to limit advertised speed
Many Ethernet MAC drivers want to limit the PHY to only advertise a maximum speed of 100Mbs or 1Gbps. Rather than using a mask, make use of the helper function phy_set_max_speed(). Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
15d8daf7bc
commit
58056c1e1b
@@ -544,9 +544,9 @@ static int macb_mii_probe(struct net_device *dev)
|
||||
|
||||
/* mask with MAC supported features */
|
||||
if (macb_is_gem(bp) && bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE)
|
||||
phydev->supported &= PHY_GBIT_FEATURES;
|
||||
phy_set_max_speed(phydev, SPEED_1000);
|
||||
else
|
||||
phydev->supported &= PHY_BASIC_FEATURES;
|
||||
phy_set_max_speed(phydev, SPEED_100);
|
||||
|
||||
if (bp->caps & MACB_CAPS_NO_GIGABIT_HALF)
|
||||
phydev->supported &= ~SUPPORTED_1000baseT_Half;
|
||||
|
||||
Reference in New Issue
Block a user