> @@ -842,6 +863,12 @@ static void stmmac_adjust_link(struct net_device *dev)
>                       new_state = true;
>                       ctrl &= ~priv->hw->link.speed_mask;
>                       switch (phydev->speed) {
> +                     case SPEED_10000:
> +                             ctrl |= priv->hw->link.speed10000;
> +                             break;
> +                     case SPEED_2500:
> +                             ctrl |= priv->hw->link.speed2500;
> +                             break;
>                       case SPEED_1000:
>                               ctrl |= priv->hw->link.speed1000;
>                               break;

Hi Jose

What PHY did you test this with?

10G phys change the interface mode when the speed change. In general,
10/100/1000G copper uses SGMII. A 1G SFP optical module generally
wants 1000Base-X. 2.5G wants 2500Base-X, 10G copper wants 10GKR, etc.

So your adjust link callback needs to look at phydev->interface and
reconfigure the MAC as requested.

You might also want to consider moving from phylib to phylink. It has
a better interface for things like this, and makes support for SFP
interfaces much easier. A MAC which supports 10G is likely to be used
with SFPs...

     Andrew

Reply via email to