@@ -1032,20 +1032,8 @@ static void ag71xx_mac_validate(struct phylink_config *config,
phylink_set(mask, MII);
- phylink_set(mask, Pause);
- phylink_set(mask, Asym_Pause);
phylink_set(mask, Autoneg);
- phylink_set(mask, 10baseT_Half);
- phylink_set(mask, 10baseT_Full);
- phylink_set(mask, 100baseT_Half);
- phylink_set(mask, 100baseT_Full);
-
- if (state->interface == PHY_INTERFACE_MODE_SGMII ||
- state->interface == PHY_INTERFACE_MODE_RGMII ||
- state->interface == PHY_INTERFACE_MODE_GMII) {
- phylink_set(mask, 1000baseT_Full);
- phylink_set(mask, 1000baseX_Full);
- }
+ phylink_get_linkmodes(mask, state->interface, config->mac_capabilities);
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);
@@ -1138,6 +1126,8 @@ static int ag71xx_phylink_setup(struct ag71xx *ag)
ag->phylink_config.dev = &ag->ndev->dev;
ag->phylink_config.type = PHYLINK_NETDEV;
+ ag->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
+ MAC_10 | MAC_100 | MAC_1000FD;
if ((ag71xx_is(ag, AR9330) && ag->mac_idx == 0) ||
ag71xx_is(ag, AR9340) ||
ag71xx only supports MII port type, so can't use the generic phylink validation callback. Update to use phylink_get_linkmodes() instead. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- This implementation seems wrong. If it only supports the MII port type, then it doesn't support fibre or twisted pair - yet it can as a PHY can be connected. If this can be fixed, we can convert it to use phylink_generic_validate() and get rid of ag71xx_mac_validate() entirely. drivers/net/ethernet/atheros/ag71xx.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)