diff options
author | Andrew Lunn <andrew@lunn.ch> | 2018-09-12 02:53:11 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-13 06:24:20 +0300 |
commit | 58056c1e1b0e4951f3486bd552d8278194f8b84b (patch) | |
tree | a3aa813a842b5ad17c0639d92f0e1eede4161799 /drivers/net/ethernet/broadcom/bcm63xx_enet.c | |
parent | 15d8daf7bc2d1415f14f3cc3378226fc7d836156 (diff) | |
download | linux-58056c1e1b0e4951f3486bd552d8278194f8b84b.tar.xz |
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>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcm63xx_enet.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bcm63xx_enet.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 897302adc38e..2eee9459c2cf 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -890,14 +890,8 @@ static int bcm_enet_open(struct net_device *dev) } /* mask with MAC supported features */ - phydev->supported &= (SUPPORTED_10baseT_Half | - SUPPORTED_10baseT_Full | - SUPPORTED_100baseT_Half | - SUPPORTED_100baseT_Full | - SUPPORTED_Autoneg | - SUPPORTED_Pause | - SUPPORTED_MII); - phydev->advertising = phydev->supported; + phydev->supported |= SUPPORTED_Pause; + phy_set_max_speed(phydev, SPEED_100); if (priv->pause_auto && priv->pause_rx && priv->pause_tx) phydev->advertising |= SUPPORTED_Pause; |