phy: add phy_interface_mode_is_8023z() helper

Add and use phy_interface_mode_is_8023z() helper to identify the
interface modes that use 802.3z negotiation.  Use it in phylink's
phylink_mac_an_restart().

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Russell King
2017-12-01 10:24:16 +00:00
committed by David S. Miller
parent b0e9fe1ba7
commit 365c1e64ad
2 changed files with 15 additions and 2 deletions

View File

@@ -320,8 +320,7 @@ static void phylink_mac_config(struct phylink *pl,
static void phylink_mac_an_restart(struct phylink *pl)
{
if (pl->link_config.an_enabled &&
(pl->link_config.interface == PHY_INTERFACE_MODE_1000BASEX ||
pl->link_config.interface == PHY_INTERFACE_MODE_2500BASEX))
phy_interface_mode_is_8023z(pl->link_config.interface))
pl->ops->mac_an_restart(pl->netdev);
}