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
@@ -2357,15 +2357,8 @@ static int sbmac_mii_probe(struct net_device *dev)
|
||||
}
|
||||
|
||||
/* Remove any features not supported by the controller */
|
||||
phy_dev->supported &= SUPPORTED_10baseT_Half |
|
||||
SUPPORTED_10baseT_Full |
|
||||
SUPPORTED_100baseT_Half |
|
||||
SUPPORTED_100baseT_Full |
|
||||
SUPPORTED_1000baseT_Half |
|
||||
SUPPORTED_1000baseT_Full |
|
||||
SUPPORTED_Autoneg |
|
||||
SUPPORTED_MII |
|
||||
SUPPORTED_Pause |
|
||||
phy_set_max_speed(phy_dev, SPEED_1000);
|
||||
phy_dev->supported |= SUPPORTED_Pause |
|
||||
SUPPORTED_Asym_Pause;
|
||||
|
||||
phy_attached_info(phy_dev);
|
||||
|
Reference in New Issue
Block a user