Subject: Re: [PATCH net-next] net: macb: convert to phylink

From: Andrew Lunn <[email-masked]>
Date: Fri, 18 Oct 2019 21:14:20 +0200

> +	if (bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE &&
> +	    (state->interface == PHY_INTERFACE_MODE_NA ||
> +	     state->interface == PHY_INTERFACE_MODE_GMII ||
> +	     state->interface == PHY_INTERFACE_MODE_SGMII ||
> +	     phy_interface_mode_is_rgmii(state->interface))) {
> +		phylink_set(mask, 1000baseT_Full);
> +		phylink_set(mask, 1000baseX_Full);
> +
> +		if (!(bp->caps & MACB_CAPS_NO_GIGABIT_HALF))
> +			phylink_set(mask, 1000baseT_Half);
> +	}
> +
> +	bitmap_and(supported, supported, mask, __ETHTOOL_LINK_MODE_MASK_NBITS);
> +	bitmap_and(state->advertising, state->advertising, mask,
> +		   __ETHTOOL_LINK_MODE_MASK_NBITS);
> +}
> +
> +static int macb_mac_link_state(struct phylink_config *config,
> +			       struct phylink_link_state *state)
> +{
> +	return -EOPNOTSUPP;
> +}

The hardware supports SGMII, but you have no way of knowing if the
SGMII link is up? That seems odd.

      Andrew